jean-airoldie / zeromq-src-rs

Source code and logic to build ZeroMQ from source
MIT License
11 stars 15 forks source link

Add libsodium linking support #9

Closed jean-airoldie closed 5 years ago

AxelNennker commented 5 years ago

Why are you setting the link type to dynmic if libsodium is provided from outside? https://github.com/jean-airoldie/zeromq-src-rs/blob/4fa5079d099209586234c70e318aa5a4d8c73b9c/src/lib.rs#L254

Hyperledger Indy uses the static libraries especially when cross-compiling to e.g. Android libsodium.so is not even built by sodiumoxide.

PATH=/home/ignisvulpis/Android/standalone/bin:$PATH cargo build --target=aarch64-linux-android

ignisvulpis@namenlos:~/development/hyperledger/indy-sdk/libindy$ find target -name libsodium.so
ignisvulpis@namenlos:~/development/hyperledger/indy-sdk/libindy$ find target -name libsodium.a
target/debug/build/libsodium-sys-b63338687415fde6/out/installed/lib/libsodium.a
target/debug/build/libsodium-sys-b63338687415fde6/out/source/libsodium-1.0.17/src/libsodium/.libs/libsodium.a
target/aarch64-linux-android/debug/build/libsodium-sys-4ee477c867c47cd0/out/installed/lib/libsodium.a
target/aarch64-linux-android/debug/build/libsodium-sys-4ee477c867c47cd0/out/source/libsodium-1.0.17/src/libsodium/.libs/libsodium.a
ignisvulpis@namenlos:~/development/hyperledger/indy-sdk/libindy$ 

Probably I am overlooking something as your testcrate works.

jean-airoldie commented 5 years ago

Good point, I should put it LinkType::Unspecified so that the compiler infers.

jean-airoldie commented 5 years ago

Alright https://github.com/sodiumoxide/sodiumoxide/pull/344 was merged. Now we just for it to be actually release on crates.io

jean-airoldie commented 5 years ago

Alright so libsodium-sys was just released (https://github.com/sodiumoxide/sodiumoxide/issues/352). Which means I can finally take the appropriate steps to close this issue.

jean-airoldie commented 5 years ago

Getting another issue for windows builds, see https://github.com/sodiumoxide/sodiumoxide/issues/370. I'll provide a PR.

jean-airoldie commented 5 years ago

Alright so I'm gonna open a separate issue for windows libsodium linking, because its not a priority for now. See #12.