#!/bin/sh
fatal()
{
echo $*
exit 1
}
Usage()
{
fatal mkinstdir.sh targetdir
}
test $# -eq 1 || Usage
DESTDIR=$1
test -d $DESTDIR || mkdir $DESTDIR || fatal cant create $DESTDIR
# Script to make a prototype recoll install directory from locally compiled
# software. *** Needs msys or cygwin ***
################################
# Local values (to be adjusted)
# Upplay src tree
UPP=c:/users/bill/documents/upnp/upplay
ReleaseBuild=y
# Where to find libgcc_s_dw2-1.dll for progs which need it copied
gccpath=`which gcc`
MINGWBIN=`dirname $gccpath`
test -z "$MINGWBIN" && fatal cannot find gcc
# Where to copy the Qt Dlls from:
QTBIN=C:/Qt/Qt5.8.0/5.8/mingw53_32/bin
PATH=$QTBIN:$PATH
export PATH
# Qt arch
QTA=Desktop_Qt_5_8_0_MinGW_32bit
if test X$ReleaseBuild = X'y'; then
qtsdir=release
else
qtsdir=debug
fi
# Release/debug needs to be changed in the left pane of qtcreator for
# this to work
GUIBIN=$UPP/../build-upplay-${QTA}-${qtsdir}/${qtsdir}/upplay.exe
# checkcopy.
chkcp()
{
cp $@ || fatal cp $@ failed
}
copyupplay()
{
chkcp $UPP/dirbrowser/cdbrowser.css $DESTDIR//share/cdbrowser
chkcp $UPP/dirbrowser/standard.css $DESTDIR/share/cdbrowser
chkcp $UPP/dirbrowser/dark.css $DESTDIR/share/cdbrowser
cp -rp $UPP/GUI/icons $DESTDIR/share
chkcp $UPP/GUI/standard.qss $DESTDIR/share
chkcp $UPP/GUI/dark.qss $DESTDIR/share
chkcp $UPP/GUI/common.qss $DESTDIR/share
chkcp $UPP/GUI/icons/upplay.ico $DESTDIR
chkcp -rp $UPP/GUI/icons $DESTDIR
chkcp $GUIBIN $DESTDIR
}
copyqt()
{
cd $DESTDIR
$QTBIN/windeployqt upplay.exe
# Apparently because the webkit part was grafted "by hand" on the
# Qt set, we need to copy some dll explicitely
addlibs="Qt5Core.dll Qt5Multimedia.dll \
Qt5MultimediaWidgets.dll Qt5OpenGL.dll \
Qt5Positioning.dll Qt5PrintSupport.dll Qt5Sensors.dll \
Qt5Sql.dll icudt57.dll \
icuin57.dll icuuc57.dll libQt5WebKit.dll \
libQt5WebKitWidgets.dll \
libxml2-2.dll libxslt-1.dll"
for i in $addlibs;do
chkcp $QTBIN/$i $DESTDIR
done
}
test -d $DESTDIR/share/cdbrowser || mkdir -p $DESTDIR/share/cdbrowser || exit 1
copyupplay
copyqt