Browse Source

refactor: make bootstrap-osx.sh verbose and fail on error

pull/3802/head
Zetok Zalbavar 9 years ago
parent
commit
c9b1de0c27
No known key found for this signature in database
GPG Key ID: C953D3880212068A
  1. 74
      bootstrap-osx.sh

74
bootstrap-osx.sh

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# This script's purpose is to ease compiling qTox for users. # This script's purpose is to ease compiling qTox for users.
# #
# NO AUTOMATED BUILDS SHOULD DEPEND ON IT. # NO AUTOMATED BUILDS SHOULD DEPEND ON IT.
# #
# This script is and will be a subject to breaking changes, and at no time one # This script is and will be a subject to breaking changes, and at no time one
# should expect it to work - it's something that you could try to use but # should expect it to work - it's something that you could try to use but
# don't expect that it will work for sure. # don't expect that it will work for sure.
@ -14,26 +14,56 @@
# With that being said, reporting that this script doesn't work would be nice. # With that being said, reporting that this script doesn't work would be nice.
# #
# If you are contributing code to qTox that change its dependencies / the way # If you are contributing code to qTox that change its dependencies / the way
# it's being build, please keep in mind that changing just bootstrap.sh # it's being build, please keep in mind that changing just bootstrap.sh
# *IS NOT* and will not be sufficient - you should update INSTALL.md first. # *IS NOT* and will not be sufficient - you should update INSTALL.md first.
echo Creating directories… set -eu -o pipefail
mkdir -p libs/lib
mkdir -p libs/include
echo Copying libraries… # copy libs to given destination
cp /usr/local/lib/libsodium* libs/lib copy_libs() {
cp /usr/local/lib/libvpx* libs/lib local dest="$@"
cp /usr/local/lib/libopus* libs/lib local libs=(
cp /usr/local/lib/libav* libs/lib /usr/local/lib/libsodium*
cp /usr/local/lib/libswscale* libs/lib /usr/local/lib/libvpx*
cp /usr/local/lib/libqrencode* libs/lib /usr/local/lib/libopus*
cp /usr/local/lib/libsqlcipher* libs/lib /usr/local/lib/libav*
echo Copying include files... /usr/local/lib/libswscale*
cp -r /usr/local/include/vpx* libs/include /usr/local/lib/libqrencode*
cp -r /usr/local/include/sodium* libs/include /usr/local/lib/libsqlcipher*
cp -r /usr/local/include/qrencode* libs/include )
cp -r /usr/local/include/libav* libs/include echo Copying libraries…
cp -r /usr/local/include/libswscale* libs/include for lib in "${libs[@]}"
cp -r /usr/local/include/sqlcipher* libs/include do
echo Done. cp -v "$lib" "$dest"
done
}
# copy includes to given destination
copy_includes() {
local dest="$@"
local includes=(
/usr/local/include/vpx*
/usr/local/include/sodium*
/usr/local/include/qrencode*
/usr/local/include/libav*
/usr/local/include/libswscale*
/usr/local/include/sqlcipher*
)
echo Copying include files…
for include in "${includes[@]}"
do
cp -v -r "$include" "$dest"
done
}
main() {
local libs_dir="libs/lib"
local inc_dir="libs/include"
echo Creating directories…
mkdir -v -p "$libs_dir" "$inc_dir"
copy_libs "$libs_dir"
copy_includes "$inc_dir"
echo Done.
}
main

Loading…
Cancel
Save