Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable sodium #104

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
2 changes: 0 additions & 2 deletions build-kaliumjni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

. ./setenv.sh

sudo cp ./libsodium/libsodium-host/lib/libsodium.so /usr/local/lib

pushd jni
./compile.sh
popd
Expand Down
4 changes: 0 additions & 4 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@

./submodule-update.sh

export LIBSODIUM_FULL_BUILD="true"

gradle generateSWIGsource --full-stacktrace
gradle build --full-stacktrace

pushd jni
./jnilib.sh
popd

sudo cp ./libsodium/libsodium-host/lib/libsodium.so /usr/lib
mvn -q clean install
./singleTest.sh

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ buildscript {
exec {
workingDir 'libsodium'
executable "dist-build/android-${opts['input_arch']}.sh"
environment 'LIBSODIUM_FULL_BUILD', 'true'
environment 'CONFIG_SITE', '' // This makes ./configure load information about the host and guess this is information valid for the target. However, the target is Android here, the host information does not apply.
//environment 'NDK_PLATFORM', opts['ndk_platform'] // The lowest possible value is android-9 here. Certain Android API levels below android-16 do not have posix_memalign. This should not make a difference in practice, as android-9 has MAP_ANONYMOUS and HAVE_MMAP and posix_memalign is only used as fallback in the current libsodium code if MAP_ANONYMOUS or HAVE_MMAP are unavailable.
}
Expand Down
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ set -ev
pushd libsodium

./autogen.sh
./configure --quiet
make --quiet && make --quiet check
sudo make --quiet install
./configure --disable-soname-versions --prefix="$PWD/libsodium-host" --libdir="$PWD/libsodium-host/lib"
make --quiet
make --quiet check
make -j3 install

date
./dist-build/android-arm.sh
Expand Down
20 changes: 1 addition & 19 deletions jni/jnilib.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!/bin/bash -ev

jnilib=libsodiumjni.so
destlib=/usr/lib
if uname -a | grep -q -i darwin; then
jnilib=libsodiumjni.jnilib
destlib=/Library/Java/Extensions
if [ ! -d $destlib ]; then
sudo mkdir $destlib
fi
else
sudo ldconfig
fi
echo $jnilib
echo $destlib
echo $destlib/$jnilib

#sudo cp /usr/local/lib/libsodium.* /usr/lib

gcc -I../libsodium/src/libsodium/include -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin sodium_wrap.c -shared -fPIC -L ../libsodium/libsodium-host/lib -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib
sudo rm -f $destlib/$jnilib
sudo cp $jnilib $destlib
gcc -I../libsodium/src/libsodium/include -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -I"$JAVA_HOME/include/darwin" sodium_wrap.c -shared -fPIC -L ../libsodium/libsodium-host/lib -L/usr/local/lib -L/usr/lib -lsodium -o "$jnilib"

1 change: 1 addition & 0 deletions setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ fi
#export PATH=/usr/lib/llvm-${CLANG_VERSION}/bin:$PATH
export PATH=${ANDROID_HOME}/emulator:$ANDROID_HOME/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}:$PATH

export LIBSODIUM_FULL_BUILD="true"
9 changes: 1 addition & 8 deletions submodule-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ set -ev

. ./setenv.sh

rm -rf libsodium
( cd libsodium && git reset --hard )

git submodule init
git submodule sync
#git submodule update --remote --merge
git submodule update

pushd libsodium

git fetch && git checkout stable
git reset --hard origin/stable
git pull
popd