fixed packlibs

This commit is contained in:
Simon Stürz 2015-08-25 16:54:55 +02:00 committed by Michael Zanetti
parent f0871006c0
commit bdca95de79
3 changed files with 42 additions and 34 deletions

43
guh.pro
View File

@ -45,16 +45,41 @@ coverage {
message("Building coverage.") message("Building coverage.")
} }
!isEmpty(PREFIX) { # Build tests
message("Install guhd to $$PREFIX") !disabletesting {
message("Building guh tests enabled")
SUBDIRS += tests
DEFINES += TESTING_ENABLED
} else {
message("Building guh tests disabled")
} }
# Bluetooth LE support
contains(DEFINES, BLUETOOTH_LE) {
message("Bluetooth LE enabled.")
} else {
message("Bluetooth LE disabled (Qt $${QT_VERSION} < 5.4.0).")
}
# Websocket support
contains(DEFINES, WEBSOCKET){
message("Building guh with websocket.")
} else {
message("Building guh without websocket.")
}
# GPIO RF 433 MHz support
contains(DEFINES, GPIO433){ contains(DEFINES, GPIO433){
message("Radio 433 for GPIO's enabled") message("Radio 433 for GPIO's enabled")
} else { } else {
message("Radio 433 for GPIO's disabled") message("Radio 433 for GPIO's disabled")
} }
# Check installation prefix
!isEmpty(PREFIX) {
message("Install guhd to $$PREFIX")
}
contains(DEFINES, SNAPPY){ contains(DEFINES, SNAPPY){
message("Building Ubuntu snappy package.") message("Building Ubuntu snappy package.")
isEmpty(PREFIX) { isEmpty(PREFIX) {
@ -73,17 +98,6 @@ contains(DEFINES, SNAPPY){
wrapper.files = meta/guhd-wrapper.sh wrapper.files = meta/guhd-wrapper.sh
wrapper.path = $$INSTALLDIR/usr/bin/ wrapper.path = $$INSTALLDIR/usr/bin/
# # We need to bring our own Qt libs, at least for now
# qtlibs.files = /usr/lib/arm-linux-gnueabihf/libQt5Network.so.5 \
# /usr/lib/arm-linux-gnueabihf/libQt5Sql.so.5 \
# /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 \
# /usr/lib/arm-linux-gnueabihf/libQt5Test.so.5 \
# /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 \
# /usr/lib/arm-linux-gnueabihf/libicui18n.so.52 \
# /usr/lib/arm-linux-gnueabihf/libicuuc.so.52 \
# /usr/lib/arm-linux-gnueabihf/libicudata.so.52
# qtlibs.path = /usr/lib/
# install sqlite driver # install sqlite driver
sqlplugin.files = /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers/libqsqlite.so sqlplugin.files = /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers/libqsqlite.so
sqlplugin.path = $$INSTALLDIR/usr/lib/qt5/plugins/sqldrivers/ sqlplugin.path = $$INSTALLDIR/usr/lib/qt5/plugins/sqldrivers/
@ -96,8 +110,7 @@ contains(DEFINES, SNAPPY){
# command to pack libs for snappy package # command to pack libs for snappy package
packlibs.depends = libguh server packlibs.depends = libguh server
packlibs.commands = $$top_srcdir/meta/packLibs.sh $$INSTALLDIR/usr/lib/ packlibs.commands = $$top_srcdir/meta/packLibs.sh $$INSTALLDIR
QMAKE_EXTRA_TARGETS += packlibs QMAKE_EXTRA_TARGETS += packlibs
} }

View File

@ -2,4 +2,4 @@
export QT_PLUGIN_PATH=$SNAPP_APP_PATH/usr/lib/qt5/plugins export QT_PLUGIN_PATH=$SNAPP_APP_PATH/usr/lib/qt5/plugins
export LD_LIBRARY_PATH=$SNAPP_APP_PATH/usr/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$SNAPP_APP_PATH/usr/lib:$LD_LIBRARY_PATH
$SNAPP_APP_PATH/usr/bin/guhd -n -d LogEngine $SNAPP_APP_PATH/usr/bin/guhd -n

View File

@ -1,33 +1,28 @@
#!/bin/bash #!/bin/bash
#################################################
function packLib() function packLib()
{ {
echo -e "\nCopy dependencies for ${1}" echo -e "\nCopy dependencies for ${1}"
deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1 ~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/') deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1 ~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/')
#Check if the paths are vaild #Check if the paths are vaild
[[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1 [[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1
[[ -d $2 ]] || echo -e "No such directory $2 "&& mkdir -pv "$2" [[ -d $2 ]] || echo -e "No such directory $2" && mkdir -pv "$2"
#Copy the deps #Copy the deps
for dep in $deps for dep in $deps
do do
cp -v "$dep" "$2" cp -v "$dep" "$2"
done done
} }
################################################# #################################################
if [ -z $1 ]; then if [ -z $1 ]; then
echo "usage: $0 <prefix>" echo "usage: $0 <prefix>"
exit 1 exit 1
fi fi
if [ -d $1 ]; then packLib $1/usr/lib/libguh.so $1/usr/lib/
echo "Clean dependency folder" packLib $1/usr/bin/guhd $1/usr/lib/
rm -rf $1/*
fi
packLib $1/usr/lib/libguh.so $1
packLib $1/usr/bin/guhd $1