Browse Source

Make scripts compatible with FreeBSD

master
Kristaps Kaupe 6 years ago
parent
commit
a39991a6cf
No known key found for this signature in database
GPG Key ID: D47B1B4232B55437
  1. 36
      install.sh
  2. 3
      test/run_tests.sh

36
install.sh

@ -4,11 +4,21 @@ check_exists() {
command -v "$1" > /dev/null
}
# This is needed for systems where GNU is not the default make, like FreeBSD.
if check_exists gmake; then
make=gmake
else
make=make
fi
sha256_verify ()
{
if [[ "$(uname)" == "Darwin" ]]; then
shasum -a 256 -c <<<"$1 $2"
return "$?"
elif [[ "$(uname)" == "FreeBSD" ]]; then
sha256 -c "$1" "$2"
return "$?"
else
sha256sum -c <<<"$1 $2"
return "$?"
@ -124,7 +134,7 @@ dep_get ()
openssl_build ()
{
./config shared --prefix="${jm_root}"
make
$make
rm -rf "${jm_root}/ssl" \
"${jm_root}/lib/engines" \
"${jm_root}/lib/pkgconfig/openssl.pc" \
@ -133,7 +143,7 @@ openssl_build ()
"${jm_root}/include/openssl" \
"${jm_root}/bin/c_rehash" \
"${jm_root}/bin/openssl"
if ! make test; then
if ! $make test; then
return 1
fi
}
@ -153,7 +163,7 @@ openssl_install ()
fi
pushd "${openssl_version}"
if openssl_build; then
make install_sw
$make install_sw
else
return 1
fi
@ -202,9 +212,9 @@ libffi_build ()
{
./autogen.sh
./configure --disable-docs --enable-shared --prefix="${jm_root}"
make uninstall
make
if ! make check; then
$make uninstall
$make
if ! $make check; then
return 1
fi
}
@ -227,7 +237,7 @@ libffi_install ()
return 1
fi
if libffi_build; then
make install
$make install
else
return 1
fi
@ -236,16 +246,16 @@ libffi_install ()
libsodium_build ()
{
make uninstall
make distclean
$make uninstall
$make distclean
./autogen.sh
./configure \
--enable-minimal \
--enable-shared \
--prefix="${jm_root}"
make uninstall
make
if ! make check; then
$make uninstall
$make
if ! $make check; then
return 1
fi
}
@ -265,7 +275,7 @@ libsodium_install ()
fi
pushd "${sodium_version}"
if libsodium_build; then
make install
$make install
else
return 1
fi

3
test/run_tests.sh

@ -9,6 +9,9 @@ sha256_verify ()
if [[ "$(uname)" == "Darwin" ]]; then
shasum -a 256 -c <<<"$1 $2"
return "$?"
elif [[ "$(uname)" == "FreeBSD" ]]; then
sha256 -c "$1" "$2"
return "$?"
else
sha256sum -c <<<"$1 $2"
return "$?"

Loading…
Cancel
Save