feat: acsm handle env vars

This commit is contained in:
nydragon 2025-03-19 11:14:44 +01:00
parent 314b328689
commit 377a978a31
Signed by: nydragon
SSH key fingerprint: SHA256:WcjW5NJPQ8Dx4uQDmoIlVPLWE27Od3fxoe0IUvuoPHE

View file

@ -33,17 +33,19 @@ stdenv.mkDerivation {
openssl_3 openssl_3
]; ];
buildPhase = '' buildPhase =
set -e # sh
''
cp ${asn1crypto} calibre-plugin/asn1crypto.zip set -e
cp ${oscrypto} calibre-plugin/oscrypto.zip
substituteInPlace ./calibre-plugin/__init__.py \ cp ${asn1crypto} calibre-plugin/asn1crypto.zip
--replace-fail "libcrypto_path = os.getenv(\"ACSM_LIBCRYPTO\", None)" "libcrypto_path = \"${openssl_3.out}/lib/libcrypto.so\"" \ cp ${oscrypto} calibre-plugin/oscrypto.zip
--replace-fail "libssl_path = os.getenv(\"ACSM_LIBSSL\", None)" "libssl_path = \"${openssl_3.out}/lib/libssl.so\""
bash ./bundle_calibre_plugin.sh substituteInPlace ./calibre-plugin/__init__.py \
cp calibre-plugin.zip $out --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
'';
} }