{ stdenv, fetchFromGitHub, zip, unzip, fetchurl, openssl_3, ... }: let oscrypto = fetchurl { url = "https://github.com/wbond/oscrypto/archive/refs/tags/1.3.0.zip"; hash = "sha256-oUpDnTLkaNpoWRFx+R4yFTeUKjGdriB+C6cHHzd/P80="; }; asn1crypto = fetchurl { url = "https://github.com/wbond/asn1crypto/archive/refs/tags/1.5.1.zip"; hash = "sha256-5H8BLisxlT4Wk/MOiJtI8yjHgy3B5hgufiScmC6YGjU="; }; in stdenv.mkDerivation { name = "acsm-calibre-plugin"; src = fetchFromGitHub { owner = "Leseratte10"; repo = "acsm-calibre-plugin"; rev = "97e6ddc1f13024c4406f2a6f2af1d9bca259fa84"; hash = "sha256-uVPs6hgpIrWywcFkbSsGoIA4ZpBBk96zbNVhU4MsJ/Y="; }; buildInputs = [ zip unzip openssl_3 ]; buildPhase = # sh '' set -e cp ${asn1crypto} calibre-plugin/asn1crypto.zip cp ${oscrypto} calibre-plugin/oscrypto.zip substituteInPlace ./calibre-plugin/__init__.py \ --replace-fail 'libcrypto_path = os.getenv("ACSM_LIBCRYPTO", None)' 'libcrypto_path = os.getenv("ACSM_LIBCRYPTO", "${openssl_3.out}/lib/libcrypto.so")' \ --replace-fail 'libssl_path = os.getenv("ACSM_LIBSSL", None)' 'libssl_path = os.getenv("ACSM_LIBSSL", "${openssl_3.out}/lib/libssl.so")' bash ./bundle_calibre_plugin.sh cp calibre-plugin.zip $out ''; }