diff --git a/bindings/nostr-sdk-ffi/justfile b/bindings/nostr-sdk-ffi/justfile index 175cace23..363b864b5 100755 --- a/bindings/nostr-sdk-ffi/justfile +++ b/bindings/nostr-sdk-ffi/justfile @@ -55,6 +55,10 @@ x86_64-linux-android: ndk [private] android: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android +[private] +strip-jni-libs: + strip ffi/kotlin/jniLibs/*/*.so + kotlin: clean-android android find ./ffi/kotlin/jniLibs -name libnostr_ffi.so -type f -delete cargo run -p uniffi-bindgen generate --library ../../target/x86_64-linux-android/release/libnostr_sdk_ffi.so --language kotlin --no-format -o ffi/kotlin @@ -72,7 +76,7 @@ assemble-aar: cp android/lib/build/outputs/aar/lib-release.aar ffi/android # Compile and build Android Archive (AAR) -aar: sdk-root kotlin assemble-aar +aar: sdk-root kotlin strip-jni-libs assemble-aar # Publish android bindings [confirm] @@ -132,6 +136,7 @@ python: cargo build --release cargo run -p uniffi-bindgen generate --library ../../target/release/libnostr_sdk_ffi.so --language python --no-format -o python/src/nostr-sdk/ cp ../../target/release/libnostr_sdk_ffi.so python/src/nostr-sdk/ + strip python/src/nostr-sdk/libnostr_sdk_ffi.so cd python && python setup.py --verbose bdist_wheel pip install ./python/dist/nostr_sdk*.whl --force-reinstall @@ -142,6 +147,7 @@ python: cargo build --release cargo run -p uniffi-bindgen generate --library ../../target/release/libnostr_sdk_ffi.dylib --language python --no-format -o python/src/nostr-sdk/ cp ../../target/release/libnostr_sdk_ffi.dylib python/src/nostr-sdk/ + strip python/src/nostr-sdk/libnostr_sdk_ffi.dylib cd python && python setup.py --verbose bdist_wheel pip install ./python/dist/nostr_sdk*.whl --force-reinstall @@ -151,6 +157,7 @@ python: cargo build --release cargo run -p uniffi-bindgen generate --library ..\..\target\release\nostr_sdk_ffi.dll --language python --no-format -o python\src\nostr-sdk\ copy ..\..\target\release\nostr_sdk_ffi.dll python\src\nostr-sdk + strip python\src\nostr-sdk\nostr_sdk_ffi.dll del /F /Q python\dist\* 2>nul || exit /b 0 cd python && python setup.py --verbose bdist_wheel FOR %%i in (.\python\dist\*.whl) DO pip install %i --force-reinstall diff --git a/bindings/nostr-sdk-ffi/python/scripts/generate-linux-aarch64.sh b/bindings/nostr-sdk-ffi/python/scripts/generate-linux-aarch64.sh index 8c370e113..94617dc81 100755 --- a/bindings/nostr-sdk-ffi/python/scripts/generate-linux-aarch64.sh +++ b/bindings/nostr-sdk-ffi/python/scripts/generate-linux-aarch64.sh @@ -15,4 +15,7 @@ cargo run -p uniffi-bindgen generate --library ../../target/aarch64-unknown-linu echo "Copying linux libnostr_sdk_ffi.so..." cp ../../target/aarch64-unknown-linux-gnu/release/libnostr_sdk_ffi.so python/src/nostr-sdk/ +echo "Stripping libnostr_sdk_ffi.so..." +strip python/src/nostr-sdk/libnostr_sdk_ffi.so + echo "All done!" diff --git a/bindings/nostr-sdk-ffi/python/scripts/generate-linux-x86_64.sh b/bindings/nostr-sdk-ffi/python/scripts/generate-linux-x86_64.sh index 116b72783..da6dbbe77 100644 --- a/bindings/nostr-sdk-ffi/python/scripts/generate-linux-x86_64.sh +++ b/bindings/nostr-sdk-ffi/python/scripts/generate-linux-x86_64.sh @@ -15,4 +15,7 @@ cargo run -p uniffi-bindgen generate --library ../../target/x86_64-unknown-linux echo "Copying linux libnostr_sdk_ffi.so..." cp ../../target/x86_64-unknown-linux-gnu/release/libnostr_sdk_ffi.so python/src/nostr-sdk/ +echo "Stripping libnostr_sdk_ffi.so..." +strip python/src/nostr-sdk/libnostr_sdk_ffi.so + echo "All done!" diff --git a/bindings/nostr-sdk-ffi/python/scripts/generate-macos-arm64.sh b/bindings/nostr-sdk-ffi/python/scripts/generate-macos-arm64.sh index 66989d6f6..d54048ca9 100644 --- a/bindings/nostr-sdk-ffi/python/scripts/generate-macos-arm64.sh +++ b/bindings/nostr-sdk-ffi/python/scripts/generate-macos-arm64.sh @@ -15,4 +15,7 @@ cargo run -p uniffi-bindgen generate --library ../../target/aarch64-apple-darwin echo "Copying libraries libnostr_sdk_ffi.dylib..." cp ../../target/aarch64-apple-darwin/release/libnostr_sdk_ffi.dylib python/src/nostr-sdk/ +echo "Stripping libnostr_sdk_ffi.dylib..." +strip python/src/nostr-sdk/libnostr_sdk_ffi.dylib + echo "All done!" diff --git a/bindings/nostr-sdk-ffi/python/scripts/generate-macos-x86_64.sh b/bindings/nostr-sdk-ffi/python/scripts/generate-macos-x86_64.sh index e51225fd2..b7c9b2b5e 100644 --- a/bindings/nostr-sdk-ffi/python/scripts/generate-macos-x86_64.sh +++ b/bindings/nostr-sdk-ffi/python/scripts/generate-macos-x86_64.sh @@ -15,4 +15,7 @@ cargo run -p uniffi-bindgen generate --library ../../target/x86_64-apple-darwin/ echo "Copying libraries libnostr_sdk_ffi.dylib..." cp ../../target/x86_64-apple-darwin/release/libnostr_sdk_ffi.dylib python/src/nostr-sdk/ +echo "Stripping libnostr_sdk_ffi.dylib..." +strip python/src/nostr-sdk/libnostr_sdk_ffi.dylib + echo "All done!" diff --git a/bindings/nostr-sdk-ffi/python/scripts/generate-windows.sh b/bindings/nostr-sdk-ffi/python/scripts/generate-windows.sh index 08678ae15..08475c4f8 100644 --- a/bindings/nostr-sdk-ffi/python/scripts/generate-windows.sh +++ b/bindings/nostr-sdk-ffi/python/scripts/generate-windows.sh @@ -15,4 +15,7 @@ cargo run -p uniffi-bindgen generate --library ../../target/x86_64-pc-windows-ms echo "Copying libraries nostr_sdk_ffi.dll..." cp ../../target/x86_64-pc-windows-msvc/release/nostr_sdk_ffi.dll python/src/nostr-sdk/ +echo "Stripping nostr_sdk_ffi.dll..." +strip python/src/nostr-sdk/nostr_sdk_ffi.dll + echo "All done!"