1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Update build-appimage.sh

This commit is contained in:
David Rosca 2018-02-11 19:25:42 +01:00
parent 56513dddc2
commit ef1f0256d3
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
############################################################################### ###############################################################################
# Configure and compile QupZilla source. # Compile Falkon source and pack it as Appimage.
############################################################################### ###############################################################################
set -e set -e
@ -31,16 +31,10 @@ DFFG="\033[39m"
DFBG="\033[49m" DFBG="\033[49m"
ALL0="\033[00m" ALL0="\033[00m"
NO_SYSTEM_DATAPATH=${NO_SYSTEM_DATAPATH:-false} ; export NO_SYSTEM_DATAPATH LIBDIRPATH=lib ; export LIBDIRPATH
PORTABLE_BUILD=${PORTABLE_BUILD:-false} ; export PORTABLE_BUILD
NONBLOCK_JS_DIALOGS=${NONBLOCK_JS_DIALOGS:-false} ; export NONBLOCK_JS_DIALOGS
NO_X11=${NO_X11:-false} ; export NO_X11
USE_WEBGL=${USE_WEBGL:-true} ; export USE_WEBGL
KDE_INTEGRATION=${KDE_INTEGRATION:-false} ; export KDE_INTEGRATION
GNOME_INTEGRATION=${GNOME_INTEGRATION:-false} ; export GNOME_INTEGRATION
DISABLE_DBUS=${DISABLE_DBUS:-false} ; export DISABLE_DBUS
QMAKE=${QMAKE:-$SYSTEM_QMAKE} ; export QMAKE
SOURCE_DIR=${SOURCE_DIR:-${SCRIPT_PATH}/..} ; export SOURCE_DIR SOURCE_DIR=${SOURCE_DIR:-${SCRIPT_PATH}/..} ; export SOURCE_DIR
QMAKE=${QMAKE:-$SYSTEM_QMAKE} ; export QMAKE
DEBUG_BUILD="-DCMAKE_BUILD_TYPE=Debug" ; export DEBUG_BUILD
CFLAGS="${CFLAGS:--O2 -g -pipe -Wall }" ; export CFLAGS ; CFLAGS="${CFLAGS:--O2 -g -pipe -Wall }" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall }" ; export CXXFLAGS ; CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall }" ; export CXXFLAGS ;
@ -48,52 +42,20 @@ LDFLAGS="${LDFLAGS:--Wl,-z,relro }"; export LDFLAGS ;
optPrint(){ optPrint(){
printf "\n\t\t${ITL1}VALID OPTIONS ARE${ITL0}:\n printf "\n\t\t${ITL1}VALID OPTIONS ARE${ITL0}:\n
--prefix=[path]
--sourcedir=[path] --sourcedir=[path]
--shared=[path]
--libdir=[path]
--qmake=[path to executable] --qmake=[path to executable]
--debug | -D --disable-debug | -D
--appimage | -A
--runtime=[path] --runtime=[path]
--portable --disable-x11
--nojs --disable-dbus
--no-x11 --update-source | -U
--with-kde | -K
--with-gnome | -G
--nodatapath
--nodbus
--disable-webgl
--with-system-qtsingleapp
--update-git-source | -U
--no-clean | --noclean
--help | -h | help |-H\n\n" --help | -h | help |-H\n\n"
} }
helpPrint(){ helpPrint(){
printf "\n\t\t\t${ITL1}PARAMETERS${ITL0}: printf "\n\t\t\t${ITL1}PARAMETERS${ITL0}:
${BLD1}--portable${BLD0} ${BLD1}--disable-x11${BLD0}
QupZilla won't write any data outside of path of execution.
It will also disable plugins by default.
(disabled by default)
${BLD1}--nojs${BLD0}
Enable non-blocking JavaScript dialogs from alert() prompt()
and confirm() functions. They are shown inside page and are not
blocking application window.
However, due to synchronous API, there is a possible crash when
closing browser windows with opened dialogs.
If you can take this risk and/or make sure you aren't closing browser
with opened dialogs, you may enable this option.
These dialogs are much more beautiful than normal QDialogs.
(disabled by default)
${BLD1}--no-x11${BLD0}
Disable all X11 calls. Disable all X11 calls.
Enable this when building for Wayland-only. Enable this when building for Wayland-only.
@ -101,60 +63,7 @@ ${BLD1}--no-x11${BLD0}
even without this option. even without this option.
${BLD1}--with-kde | -K ${BLD0} ${BLD1}--disable-dbus${BLD0}
Enable KDE integration.
Currently it enables building of KWallet Password plugin,
which provides support for storing passwords in KWallet.
${BLD1}--with-gnome | -G${BLD0}
Enable Gnome integration.
Currently it enables building of Gnome-Keyring Password plugin,
which provides support for storing passwords in Gnome-Keyring.
${BLD1}--libdir=${BLD0}
By default, /usr/lib/ is used for libQupZilla and /usr/lib/qupzilla
for plugins.
You can change it by setting this define.
${UDR1}example:--libdir="/usr/lib64"${UDR0}
${BLD1}--nodatapath=${BLD0}
By default, QupZilla is using /usr/share/qupzilla/ path
for storing themes and translations.
By setting this define, QupZilla will use path of execution.
(disabled by default)
${BLD1}--prefix=${BLD0}
You can define different prefix.
QupZilla binary will then be moved to PREFIX/bin/, use
PREFIX/share/qupzilla/ as datadir, PREFIX/share/applications for
desktop launcher and PREFIX/share/pixmaps for icon.
(default prefix is "/usr/local")
${UDR1}example:--prefix="/usr"${UDR0}
${BLD1}--shared=${BLD0}
You can define the path of the share folder, i.e. /usr/share
QupZilla will then use shared/qupzilla as datadir,
shared/applications for desktop launcher and
shared/pixmaps for the icon. By default it is not defined
and files will be installed as described above.
(default share folder is "/usr/local/share")
${UDR1}example:--shared="/usr/share"${UDR0}
${BLD1}--nodbus${BLD0}
Build without QtDBus module. Native desktop notifications Build without QtDBus module. Native desktop notifications
will be disabled. will be disabled.
@ -162,65 +71,31 @@ ${BLD1}--nodbus${BLD0}
${BLD1}--sourcedir=${BLD0} ${BLD1}--sourcedir=${BLD0}
Assuming this script is located in ${ITL1}qupzilla/scripts${ITL0}, Assuming this script is located in ${ITL1}falkon/scripts${ITL0},
otherwise you must specify the path to otherwise you must specify the path to
QupZilla source directory. Falkon source directory.
${UDR1}example:--sourcedir="/home/build/qupzilla"${UDR0} ${UDR1}example:--sourcedir="/home/build/falkon"${UDR0}
${BLD1}--runtime=[path]${BLD0} ${BLD1}--runtime=[path]${BLD0}
Path to precompiled „${BLD1}runtime.c${BLD0}${ITL1}(part of AppImageKit)${ITL0}. Path to precompiled „${BLD1}runtime.c${BLD0}${ITL1}(part of AppImageKit)${ITL0}.
More info at: ${UDR1}https://github.com/probonopd/AppImageKit${UDR0} More info at: ${UDR1}https://github.com/probonopd/AppImageKit${UDR0}
Requires ${BLD1}--appimage${BLD0} ${BLD1}Mandatory option${BLD0}
${BLD1}--appimage | -A${BLD0} ${BLD1}--disable-debug | -D${BLD0}
Also create an AppImage. You may want to disable debug build.
In order to build AppImage, (enabled by default)
you must have installed the following tools:
${ITL1}mmksquashfs, patchelf${ITL0}!
Also, you should use precompiled Qt package
downloaded from ${UDR1}${ITL1}http://download.qt.io/official_releases/qt/${ALL0},
and precompiled „${BLD1}runtime${BLD0}“ binary - part of ${ITL1}AppImageKit${ITL0}
${UDR1}https://github.com/probonopd/AppImageKit${UDR0},
otherwise this option will be ignored.
Requires ${BLD1}--runtime${BLD0}
Implies ${BLD1}--nodatapath${BLD0}
${BLD1}--disable-webgl${BLD0} ${BLD1}--update-source | -U${BLD0}
Disable WebGL. You need to build QupZilla with WebKit built Fetches the information from Falkon online git repository
with WebGL support, otherwise you won't be able to compile
without errors.
Only for QtWebKit lower than 2.3
(disabled by default)
${BLD1}--with-system-qtsingleapp${BLD0}
Use system QtSingleApplication library.
This option can only be used with system qmake!
${BLD1}--debug | -D${BLD0}
You may want to build QupZilla with debugging symbols (for generating
backtrace of crash).
${BLD1}--update-git-source | -U${BLD0}
Fetches the information from QupZilla online git repository
and merges it with your local copy and merges it with your local copy
${BLD1}--no-clean | --noclean${BLD0}
Skip cleaning previously compilled files.
${BLD1}--qmake=${BLD0} ${BLD1}--qmake=${BLD0}
Full path to qmake executable. Full path to qmake executable.
@ -231,24 +106,13 @@ ${BLD1}--qmake=${BLD0}
printConf(){ printConf(){
printf "\n\tBuild configuration:\n printf "\n\tBuild configuration:\n
QUPZILLA_PREFIX=${QUPZILLA_PREFIX} Library path=${LIBDIRPATH}
SOURCE_DIR=${SOURCE_DIR} Source dir=${SOURCE_DIR}
SHARE_FOLDER=${SHARE_FOLDER} Debug build=${DEBUG_BUILD}
USE_LIBPATH=${USE_LIBPATH} Disable X11=${YNOX11}
DEBUG_BUILD=${DEBUG_BUILD} Disable DBUS=${DISABLE_DBUS}
BUILD_AI=${BUILD_AI} Runtime binary=${RUNTIME_BINARY}
PORTABLE_BUILD=${PORTABLE_BUILD} Qmake=${QMAKE}\n" | sed -r 's/=$/ » Not set/g'
NONBLOCK_JS_DIALOGS=${NONBLOCK_JS_DIALOGS}
NO_X11=${NO_X11}
KDE_INTEGRATION=${KDE_INTEGRATION}
GNOME_INTEGRATION=${GNOME_INTEGRATION}
NO_SYSTEM_DATAPATH=${NO_SYSTEM_DATAPATH}
DISABLE_DBUS=${DISABLE_DBUS}
USE_WEBGL=${USE_WEBGL}
SKIP_CLEANNING=${SKIP_CLEANNING}
USE_SYS_QTSA=${USE_SYS_QTSA}
RUNTIME_BINARY=${RUNTIME_BINARY}
QMAKE=${QMAKE}\n" | sed -r 's/=$/ » Not set/g'
} }
getVal(){ getVal(){
@ -259,79 +123,30 @@ varAssign(){
while [ $# != 0 ] ;do while [ $# != 0 ] ;do
CFG_OPT="$1" CFG_OPT="$1"
case "${CFG_OPT}" in case "${CFG_OPT}" in
--prefix=*)
QUPZILLA_PREFIX=$(getVal "${CFG_OPT}")
export QUPZILLA_PREFIX
;;
--sourcedir=*) --sourcedir=*)
SOURCE_DIR=$(getVal "${CFG_OPT}") SOURCE_DIR=$(getVal "${CFG_OPT}")
export SOURCE_DIR export SOURCE_DIR
;; ;;
--shared=*) --disable-debug|-D)
SHARE_FOLDER=$(getVal "${CFG_OPT}") unset DEBUG_BUILD
export SHARE_FOLDER
;;
--libdir=*)
USE_LIBPATH=$(getVal "${CFG_OPT}")
export USE_LIBPATH
;;
--debug|-D)
DEBUG_BUILD="CONFIG+=debug"
export DEBUG_BUILD
;;
--appimage|-A)
BUILD_AI="true"
export BUILD_AI
;; ;;
--runtime=*) --runtime=*)
RUNTIME_BINARY=$(getVal "${CFG_OPT}") RUNTIME_BINARY=$(getVal "${CFG_OPT}")
export RUNTIME_BINARY export RUNTIME_BINARY
;; ;;
--portable) --disable-x11)
PORTABLE_BUILD="true" YNOX11="-DNO_X11:BOOL=TRUE"
export PORTABLE_BUILD export YNOX11
;; ;;
--nojs) --disable-bus)
NONBLOCK_JS_DIALOGS="true" DISABLE_DBUS="-DDISABLE_DBUS:BOOL=TRUE"
export NONBLOCK_JS_DIALOGS
;;
--no-clean|--noclean)
SKIP_CLEANNING="true"
export SKIP_CLEANNING
;;
--no-x11)
NO_X11="true"
export NO_X11
;;
--with-kde|-K)
KDE_INTEGRATION="true"
export KDE_INTEGRATION
;;
--with-gnome|-G)
GNOME_INTEGRATION="true"
export GNOME_INTEGRATION
;;
--nodatapath)
NO_SYSTEM_DATAPATH="true"
export NO_SYSTEM_DATAPATH
;;
--nodbus)
DISABLE_DBUS="true"
export DISABLE_DBUS export DISABLE_DBUS
;; ;;
--disable-webgl)
USE_WEBGL="false"
export USE_WEBGL
;;
--with-system-qtsingleapp)
USE_SYS_QTSA="CONFIG+=QtSingleApplication"
export USE_SYS_QTSA
;;
--qmake=*) --qmake=*)
QMAKE=$(getVal "${CFG_OPT}") QMAKE=$(getVal "${CFG_OPT}")
export QMAKE export QMAKE
;; ;;
--update-git-source|-U) --update-source|-U)
UPDATE_SOURCE="true" UPDATE_SOURCE="true"
export UPDATE_SOURCE export UPDATE_SOURCE
;; ;;
@ -349,40 +164,16 @@ while [ $# != 0 ] ;do
done done
} }
nowBuild() nowBldImg(){
{
QUPZILLA_PREFIX=${QUPZILLA_PREFIX:-/usr/local} ; export QUPZILLA_PREFIX
SHARE_FOLDER=${SHARE_FOLDER:-$QUPZILLA_PREFIX/share} ; export SHARE_FOLDER
USE_LIBPATH=${USE_LIBPATH:-$QUPZILLA_PREFIX/lib} ; export USE_LIBPATH
printConf
cd "${SOURCE_DIR}" cd "${SOURCE_DIR}"
if [[ -z "${SKIP_CLEANNING}" ]]; then
make distclean >/dev/null 2>&1 || :
rm -fr bundle_build_dir qupzilla.squashfs bin/QupZilla.AppImage || :
fi
if [[ "${UPDATE_SOURCE}" == "true" ]]; then if [[ "${UPDATE_SOURCE}" == "true" ]]; then
git pull || : git pull || :
fi fi
if [[ ! -z "${USE_SYS_QTSA}" ]]; then rm -fr build || :
HEADERSARETHERE=$(${QMAKE} -query | grep INSTALL_HEADERS | sed 's/QT_INSTALL_HEADERS://') mkdir build && cd build
rm -fr src/lib/3rdparty/qtsingleapplication
ln -s ${HEADERSARETHERE}/QtSolutions src/lib/3rdparty/qtsingleapplication
sed -i 's,include.*qtsingleapplication.*,,' src/plugins.pri
sed -i 's,include.*qtsingleapplication.*,,' src/lib/lib.pro
fi
${QMAKE} ${DEBUG_BUILD} ${USE_SYS_QTSA}
printf "Compiling QupZilla\n"
make -j$NCPUS
}
nowBldImg(){
NO_SYSTEM_DATAPATH="true"; export NO_SYSTEM_DATAPATH
QTFILESARETHERE=$(${QMAKE} -query | grep INSTALL_PREFIX | sed 's/QT_INSTALL_PREFIX://') QTFILESARETHERE=$(${QMAKE} -query | grep INSTALL_PREFIX | sed 's/QT_INSTALL_PREFIX://')
LIBSARETHERE=$(${QMAKE} -query | grep INSTALL_LIBS | sed 's/QT_INSTALL_LIBS://') LIBSARETHERE=$(${QMAKE} -query | grep INSTALL_LIBS | sed 's/QT_INSTALL_LIBS://')
@ -391,33 +182,59 @@ QMLSARETHERE=$(${QMAKE} -query | grep INSTALL_QML | sed 's/QT_INSTALL_QML://')
TRANSLATIONSARETHERE=$(${QMAKE} -query | grep INSTALL_TRANSLATIONS | sed 's/QT_INSTALL_TRANSLATIONS://') TRANSLATIONSARETHERE=$(${QMAKE} -query | grep INSTALL_TRANSLATIONS | sed 's/QT_INSTALL_TRANSLATIONS://')
LIBEXECSARETHERE=$(${QMAKE} -query | grep INSTALL_LIBEXECS | sed 's/QT_INSTALL_LIBEXECS://') LIBEXECSARETHERE=$(${QMAKE} -query | grep INSTALL_LIBEXECS | sed 's/QT_INSTALL_LIBEXECS://')
NEEDEDLIBSLIST="libicudata.so NODEFOPT="${DEBUG_BUILD} ${YNOX11} ${DISABLE_DBUS}"
libicui18n.so
libicuuc.so
libQt5Core.so
libQt5DBus.so
libQt5Gui.so
libQt5Multimedia.so
libQt5MultimediaWidgets.so
libQt5Network.so
libQt5OpenGL.so
libQt5Positioning.so
libQt5PrintSupport.so
libQt5Qml.so
libQt5Quick.so
libQt5QuickWidgets.so
libQt5Sql.so
libQt5Svg.so
libQt5WebChannel.so
libQt5WebEngineCore.so
libQt5WebEngineCore.so
libQt5WebEngine.so
libQt5WebEngineWidgets.so
libQt5Widgets.so
libQt5X11Extras.so
libQt5XcbQpa.so"
NEEDEDPLUGINSLIST="generic cmake ${NODEFOPT} \
-DBUILD_SHARED_LIBS:BOOL=TRUE \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=NO \
-DQMAKE_EXECUTABLE:FILEPATH=${QMAKE} \
-DCMAKE_PREFIX_PATH=${QTFILESARETHERE} \
-DFALKON_PLUGIN_PATH="" \
-DKDE_INSTALL_LIBDIR:PATH="${LIBDIRPATH}" ..
printf "Compiling Falkon with the following settings:\n"
printConf
make -j$NCPUS
if [[ $? == 0 ]] ; then
make DESTDIR="${PWD}" install
fi
mv usr/local bundle_build_dir
mv bundle_build_dir/lib/plugins/falkon bundle_build_dir/share/falkon/plugins
rmdir bundle_build_dir/lib/plugins
pushd bundle_build_dir/share/falkon/plugins
chrpath --replace '$ORIGIN/../../../lib' *.so
popd
NEEDEDLIBSLIST="libicudata.so.56
libicui18n.so.56
libicuuc.so.56
libQt5Core.so.5
libQt5DBus.so.5
libQt5Gui.so.5
libQt5Multimedia.so.5
libQt5MultimediaWidgets.so.5
libQt5Network.so.5
libQt5OpenGL.so.5
libQt5Positioning.so.5
libQt5PrintSupport.so.5
libQt5Qml.so.5
libQt5Quick.so.5
libQt5QuickWidgets.so.5
libQt5Sql.so.5
libQt5Svg.so.5
libQt5WebChannel.so.5
libQt5WebEngineCore.so.5
libQt5WebEngine.so.5
libQt5WebEngineWidgets.so.5
libQt5Widgets.so.5
libQt5X11Extras.so.5
libQt5XcbQpa.so.5"
NEEDEDPLUGINSLIST="bearer
generic
iconengines iconengines
imageformats imageformats
platforminputcontexts platforminputcontexts
@ -425,16 +242,7 @@ platformthemes
printsupport printsupport
xcbglintegrations" xcbglintegrations"
nowBuild mkdir -p bundle_build_dir/plugins/{platforms,sqldrivers} \
mkdir bundle_build_dir || :
cp -r bin/* bundle_build_dir
pushd bundle_build_dir/plugins
patchelf --set-rpath '$ORIGIN/../lib' *.so
popd
mkdir -p bundle_build_dir/lib \
bundle_build_dir/plugins/{platforms,sqldrivers} \
bundle_build_dir/qtwebengine_dictionaries \ bundle_build_dir/qtwebengine_dictionaries \
bundle_build_dir/qml \ bundle_build_dir/qml \
bundle_build_dir/translations || : bundle_build_dir/translations || :
@ -452,17 +260,35 @@ cp -r ${QTFILESARETHERE}/resources bundle_build_dir
cp -r ${TRANSLATIONSARETHERE}/qtwebengine_locales bundle_build_dir/translations cp -r ${TRANSLATIONSARETHERE}/qtwebengine_locales bundle_build_dir/translations
cp ${LIBEXECSARETHERE}/QtWebEngineProcess bundle_build_dir cp ${LIBEXECSARETHERE}/QtWebEngineProcess bundle_build_dir
CRYPTONEEDED=$(ldd 'bin/qupzilla'| grep libcrypto | sed 's/.*=>//;s/(.*//') CRYPTONEEDED="$(ldd 'bin/falkon'| grep libcrypto | sed 's/.*=>//;s/(.*//')"
cp ${CRYPTONEEDED} bundle_build_dir/lib LIBSSLNEEDED="$(echo "${CRYPTONEEDED}" | sed 's/crypto/ssl/')"
install ${CRYPTONEEDED} ${LIBSSLNEEDED} bundle_build_dir/lib
cp linux/applications/qupzilla.desktop bundle_build_dir CRYPTOLINKED="$(basename "${CRYPTONEEDED}")"
cp linux/pixmaps/qupzilla.png bundle_build_dir LIBSSLLINKED="$(basename "${LIBSSLNEEDED}")"
ln -sf qupzilla.png bundle_build_dir/.DirIcon
#Try to include all ssl v1.0 variants.
for LINK in {libcrypto.so,libcrypto.so.10,libcrypto.so.1.0.0} ; do
if [[ ! -e bundle_build_dir/lib/${LINK} ]] ; then
ln -s ${CRYPTOLINKED} bundle_build_dir/lib/${LINK}
fi
done
for LNKS in {libssl.so,libssl.so.10,libssl.so.1.0.0} ; do
if [[ ! -e bundle_build_dir/lib/${LNKS} ]] ; then
ln -s ${CRYPTOLINKED} bundle_build_dir/lib/${LNKS}
fi
done
cp ../linux/applications/org.kde.falkon.desktop bundle_build_dir
cp ../linux/pixmaps/qupzilla.png bundle_build_dir
ln -s qupzilla.png bundle_build_dir/.DirIcon
pushd bundle_build_dir pushd bundle_build_dir
patchelf --set-rpath '$ORIGIN:$ORIGIN/lib' libQupZilla.so mv bin/falkon ./ && rm -fr bin
patchelf --set-rpath '$ORIGIN:$ORIGIN/lib' qupzilla chrpath --replace '$ORIGIN' lib/libFalkonPrivate.so.2
patchelf --set-rpath '$ORIGIN:$ORIGIN/lib' QtWebEngineProcess chrpath --replace '$ORIGIN/lib' falkon
chrpath --replace '$ORIGIN/lib' QtWebEngineProcess
cat <<EOQTCFG >qt.conf cat <<EOQTCFG >qt.conf
[Paths] [Paths]
@ -474,66 +300,64 @@ EOQTCFG
cat <<EOF >AppRun cat <<EOF >AppRun
#!/bin/sh #!/bin/sh
#
set -e set -e
QUPZILLA_MOUNT_PATH="\$(dirname "\$(readlink -f "\$0")")" FALKON_DIR="\$(dirname "\$(readlink -f "\$0")")"
QT_DIR=\${QUPZILLA_MOUNT_PATH} XDG_DATA_DIRS="\${FALKON_DIR}/share:\${XDG_DATA_DIRS}"
export QT_DIR export XDG_DATA_DIRS
QT_QPA_PLATFORM_PLUGIN_PATH="\${QT_DIR}/plugins/platforms" cd "\${FALKON_DIR}/"
QT_PLUGIN_PATH="\${QT_DIR}/plugins" exec ./falkon "\$@"
QML2_IMPORT_PATH="\${QT_DIR}/qml"
QTWEBENGINEPROCESS_PATH="\${QT_DIR}/QtWebEngineProcess"
export QT_QPA_PLATFORM_PLUGIN_PATH QT_PLUGIN_PATH QML2_IMPORT_PATH QTWEBENGINEPROCESS_PATH
cd "\${QUPZILLA_MOUNT_PATH}/"
exec ./qupzilla "\$@"
EOF EOF
chmod +x AppRun chmod +x AppRun
popd popd
printf "Generating app image\n" printf "Generating app image\n"
mksquashfs bundle_build_dir qupzilla.squashfs -root-owned -noappend mksquashfs bundle_build_dir falkon.squashfs -root-owned -noappend
cat "${RUNTIME_BINARY}" >bin/QupZilla.AppImage cat "${RUNTIME_BINARY}" >bin/Falkon.AppImage
cat qupzilla.squashfs >>bin/QupZilla.AppImage cat falkon.squashfs >>bin/Falkon.AppImage
chmod a+x bin/QupZilla.AppImage chmod a+x bin/Falkon.AppImage
} }
varAssign $* varAssign $*
if [[ ! -x ${QMAKE} ]] ;then if [[ ! -x ${QMAKE} ]] ;then
printf "${RDFG}ERROR${DFFG}: ${BLD1}qmake${BLD0} was not found! Please install it or use ${BLD1}--qmake=${BLD0} option to specify the path where it is located!\n" printf "${RDFG}ERROR${DFFG}: ${BLD1}qmake${BLD0} was not found! Please use ${BLD1}--qmake=${BLD0} option to specify the path where it is located!\n"
exit 1
fi
if [[ ! -z "${USE_SYS_QTSA}" ]] && [[ ${QMAKE} != ${SYSTEM_QMAKE} ]] ;then
printf "${RDFG}ERROR${DFFG}: You must use system qmake in order to build Qupzilla with system QtsingleApplication libraries!\n"
exit 1 exit 1
fi fi
if [[ ! -d "${SOURCE_DIR}/src" ]]; then if [[ ! -d "${SOURCE_DIR}/src" ]]; then
printf "Please install ${UDR1}$0${UDR0} in „${BLD1}scripts${BLD0}${ITL1}(a sub folder in QupZilla source directory)${ITL0}, printf "Please install ${UDR1}$0${UDR0} in „${BLD1}scripts${BLD0}${ITL1}(a sub folder in Falkon source directory)${ITL0},
or specify the source path with ${BLD1}--sourcedir=${BLD0} parameter!\n" or specify the source path with ${BLD1}--sourcedir=${BLD0}full/path!\n"
exit 1 exit 1
fi fi
if [[ ${TEST} != "yes" ]] ; then
if [[ ${BUILD_AI} == "true" ]] && [[ ${TEST} == "yes" ]] && [[ ${QMAKE} != ${SYSTEM_QMAKE} ]] && [[ ! -z ${RUNTIME_BINARY} ]] ; then printf "${RDFG}You must have the following tools installed:${DFFG}
nowBldImg ${ITL1}mmksquashfs, chrpath${ITL0}!\n"
else exit 1
nowBuild
fi fi
if [[ $? == 0 ]] && [[ -x ${SOURCE_DIR}/bin/qupzilla ]]; then if [[ "${QMAKE}" == "${SYSTEM_QMAKE}" ]] ; then
printf "${RDFG}You should use precompiled Qt package${DFFG}
downloaded from ${UDR1}${ITL1}http://download.qt.io/official_releases/qt/${ALL0}\n"
exit 1
elif
[[ -z ${RUNTIME_BINARY} ]] ; then
printf "\n${RDFG}Required precompiled „${BLD1}runtime${BLD0}“ binary!${DFFG}
It's a part of ${ITL1}AppImageKit${ITL0}
${UDR1}https://github.com/probonopd/AppImageKit${UDR0}\n"
exit 1
fi
nowBldImg
if [[ $? == 0 ]] && [[ -x bin/Falkon.AppImage ]]; then
printf "\\033c" printf "\\033c"
printf "Done!\nThe compiled files are in "${PWD}"/bin\n" printf "Done!\nThe compiled files are in "${PWD}"/bin\n"
if [[ -z "${BUILD_AI}" ]]; then
printf "Now you can type „${ITL1}make install${ITL}“ to install them\n"
fi
fi fi
exit 0 exit 0