app-image.diff (13,727 bytes)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c12e24904ef5f291b7f8c72e840bee99f70db5ea
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,28 @@
+# Dependencies are managed in the Dockerfile in the scribus-ci-docker
+# Git repository. Change them there, wait a bit, and then we'll use
+# the new ones here in these builds.
+image: registry.gitlab.com/scribus/scribus-ci-docker/master
+
+variables:
+ GIT_DEPTH: "10"
+ GIT_SUBMODULE_STRATEGY: recursive
+
+appimage:linux:
+ stage: build
+ except:
+ - schedules
+ cache:
+ key: "cache-appimage"
+ paths:
+ - ccache/
+ before_script:
+ # CCache Config
+ - mkdir -p ccache
+ - export CCACHE_BASEDIR=${PWD}
+ - export CCACHE_DIR=${PWD}/ccache
+ script:
+ - bash -ex AppImage-package/bundle.sh
+ artifacts:
+ expire_in: 14 days
+ paths:
+ - ./Scribus*.AppImage*
\ No newline at end of file
diff --git a/AUTHORS b/AUTHORS
index 7212347b07913355478aa6936553c61900b52b07..e08607bf294b20a1d81e54a0029a4e16e82e0eb9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -72,6 +72,11 @@ Haiku Port:
Giovanni Mugnai musical777@gmail.com
+AppImage for Linux:
+
+Simon Peter
+
+
Refactoring text layout code, the new boxes model & CTL text layout, Oman House of Open Source Technology team:
Anood Almuharbi anood.almuharbi@gmail.com
diff --git a/AppImage-package/AppRun b/AppImage-package/AppRun
new file mode 100644
index 0000000000000000000000000000000000000000..3bfcc01e5d7bd0769c51f6bf90986506123d96f1
--- /dev/null
+++ b/AppImage-package/AppRun
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+HERE="$(dirname "$(readlink -f "${0}")")"
+
+############################################################################################
+# Allow AppRun or the AppImage to be symlinked to, e.g.,
+# /usr/local/bin/scribus
+# or to be called with ./Scribus*.AppImage scribus
+############################################################################################
+
+if [ ! -z $APPIMAGE ] ; then
+ BINARY_NAME=$(basename "$ARGV0")
+else
+ BINARY_NAME=$(basename "$0")
+fi
+if [ ! -z "$1" ] && [ -e "$HERE/bin/$1" ] ; then
+ MAIN="$HERE/bin/$1" ; shift
+elif [ ! -z "$1" ] && [ -e "$HERE/usr/bin/$1" ] ; then
+ MAIN="$HERE/usr/bin/$1" ; shift
+elif [ -e "$HERE/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/bin/$BINARY_NAME"
+elif [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/usr/bin/$BINARY_NAME"
+else
+ MAIN="$HERE/usr/bin/scribus"
+fi
+
+############################################################################################
+# Use bundled paths
+############################################################################################
+
+export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
+export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
+
+############################################################################################
+# Change into bundled usr/ directory
+############################################################################################
+
+cd "${HERE}"/usr # Because Scribus has some hardcoded paths that we patch away; FIXME
+
+############################################################################################
+# Use bundled Python
+############################################################################################
+
+export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}"
+export PYTHONHOME="${HERE}"/usr/
+
+############################################################################################
+# Use bundled Tcl/Tk
+############################################################################################
+
+export TCL_LIBRARY="${HERE}"/usr/share/tcltk/tcl8.6:$TCL_LIBRARY:$TK_LIBRARY
+export TK_LIBRARY="${HERE}"/usr/share/tcltk/tk8.6:$TK_LIBRARY:$TCL_LIBRARY
+
+############################################################################################
+# Make it look more native on Gtk+ based systems
+############################################################################################
+
+export QT_QPA_PLATFORMTHEME=gtk2
+
+############################################################################################
+# Run experimental bundle that bundles everything if a private ld-linux-x86-64.so.2 is there
+# This allows the bundle to run even on older systems than the one it was built on
+############################################################################################
+
+if [ -e "$HERE/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" ] ; then
+ echo "Run experimental bundle that bundles everything"
+ export GCONV_PATH="$HERE/usr/lib/x86_64-linux-gnu/gconv"
+ export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf"
+ export LIBRARY_PATH="$HERE/usr/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export LIBRARY_PATH=$GDK_PIXBUF_MODULEDIR:$LIBRARY_PATH # Otherwise getting "Unable to load image-loading module"
+ exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@"
+else
+ exec "${MAIN}" "$@"
+fi
diff --git a/AppImage-package/bundle.sh b/AppImage-package/bundle.sh
index ec33b21b0c47554567d82cfa7b749bd081e03044..da372e889cba996b01e2613753a85f4228d1695f 100644
--- a/AppImage-package/bundle.sh
+++ b/AppImage-package/bundle.sh
@@ -1,113 +1,115 @@
#!/bin/bash
-########################################################################
-# Package the binaries built on Travis-CI as an AppImage
-# By Simon Peter 2016
-# For more information, see http://appimage.org/
-########################################################################
-
-export ARCH=$(arch)
-
-APP=Scribus
-LOWERAPP=${APP,,}
+cat /proc/1/cgroup # Check if we run in Docker; https://github.com/AppImage/AppImageKit/issues/912
-GIT_REV=$(git rev-parse --short HEAD)
-echo $GIT_REV
-make install DESTDIR=/home/travis/$APP/$APP.AppDir
-
-cd $HOME/$APP/
-
-wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
-. ./functions.sh
-
-cd $APP.AppDir
+. /opt/qt*/bin/qt*-env.sh || true
########################################################################
-# Copy desktop and icon file to AppDir for AppRun to pick them up
+# Build Plaform Theme for Gtk+
########################################################################
-get_apprun
-
-find . -name *desktop -exec cp {} $LOWERAPP.desktop \;
-
-cp ./usr/share/scribus/icons/1_5_1/scribus.png .
-rm -rf usr/share/icons/hicolor/48x48/
+find /opt/qt*/| grep platform
+#apt-get update
+#apt-get -y install libgtk-3-dev libnotify-dev qt5113d
+#git clone https://github.com/CrimsonAS/gtkplatform
+#cd gtkplatform
+#qmake
+#make -j$(nproc)
+#sudo make install
+#cd -
########################################################################
-# Copy in the dependencies that cannot be assumed to be available
-# on all target systems
+# https://askubuntu.com/a/910143
+# https://askubuntu.com/a/748186
+# Deploy with linuxdeployqt using
+# -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so
+# At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself)
########################################################################
-# FIXME: How to find out which subset of plugins is really needed?
-mkdir -p ./usr/lib/qt5/plugins/
-PLUGINS=/opt/qt58/plugins/
-cp -r $PLUGINS/* ./usr/lib/qt5/plugins/
-
-# Tcl/Tk, Tkinter (for Calendar script)
-cp /usr/li*/python2.7/lib-dynload/_tkinter.so usr/ # It is indeed picked up here because we cd there at runtime
-ldd usr/_tkinter.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
-cp -r /usr/lib/tcltk usr/lib/
-cp -r /usr/share/tcltk usr/share/
+git clone http://code.qt.io/qt/qtstyleplugins.git
+cd qtstyleplugins
+qmake
+make -j$(nproc)
+make install
+cd -
-export LD_LIBRARY_PATH=/opt/qt58/lib/:LD_LIBRARY_PATH
-copy_deps
+########################################################################
+# Build Scribus and install to appdir/
+########################################################################
-# Move the libraries to usr/bin
-move_lib
-mv ./opt/qt58/lib/* usr/lib ; rm -rf ./opt
-( cd usr/lib/qt5/plugins/platforms/../../ ; ln -s ../../lib/ . )
-mv usr/lib/x86_64-linux-gnu/* usr/lib/
+cmake . -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=/usr -DWANT_HUNSPELL=1 -DWITH_PODOFO=1 -DWANT_GRAPHICSMAGICK=1 -DWANT_DEBUG=0 -DWANT_SVNVERSION=0 -DWANT_GUI_LANG=en_US
+make -j$(nproc)
+make DESTDIR=appdir -j$(nproc) install ; find appdir/
+cp AppImage-package/AppRun appdir/ ; chmod +x appdir/AppRun
+cp ./appdir/usr/share/icons/hicolor/256x256/apps/scribus.png ./appdir/
+sed -i -e 's|^Icon=.*|Icon=scribus|g' ./appdir/usr/share/applications/scribus.desktop # Needed?
########################################################################
-# Delete stuff that should not go into the AppImage
+# Bundle everyhting
+# to allow the AppImage to run on older systems as well
########################################################################
-# Delete dangerous libraries; see
-# https://github.com/probonopd/AppImages/blob/master/excludelist
-delete_blacklisted
+cd appdir/
-# We don't bundle the developer stuff
-rm -rf usr/include || true
-rm -rf usr/lib/cmake || true
-rm -rf usr/lib/pkgconfig || true
-find . -name '*.la' | xargs -i rm {}
-strip usr/bin/* usr/lib/* || true
+# Bundle all of glibc; this should eventually be done by linuxdeployqt
+apt-get update -q
+apt-get download libc6
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
-########################################################################
-# desktopintegration asks the user on first run to install a menu item
-########################################################################
+# Make absolutely sure it will not load stuff from /lib or /usr
+sed -i -e 's|/usr|/xxx|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
+sed -i -e 's|/usr/lib|/ooo/ooo|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
-get_desktopintegration $LOWERAPP
+# Bundle fontconfig settings
+mkdir -p etc/fonts/
+cp /etc/fonts/fonts.conf etc/fonts/
+
+# Bundle Python
+apt-get download libpython2.7-stdlib python2.7 python2.7-minimal libpython2.7-minimal
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
+cd -
########################################################################
-# Determine the version of the app; also include needed glibc version
+# Patch away absolute paths
+# FIXME: It would be nice if they were relative
########################################################################
-GLIBC_NEEDED=$(glibc_needed)
-VERSION=git$GIT_REV-glibc$GLIBC_NEEDED
+sed -i -e 's|/usr/share/scribus|././/share/scribus|g' appdir/usr/bin/scribus
+sed -i -e 's|/usr/lib/scribus|././/lib/scribus|g' appdir/usr/bin/scribus
+sed -i -e 's|/usr/share/doc/scribus/|././/share/doc/scribus/|g' appdir/usr/bin/scribus
########################################################################
-# Patch away absolute paths; it would be nice if they were relative
+# Also bundle Tcl/Tk, Tkinter (for Calendar script)
########################################################################
-sed -i -e 's|/usr/share/scribus|././/share/scribus|g' usr/bin/scribus
-sed -i -e 's|/usr/lib/scribus|././/lib/scribus|g' usr/bin/scribus
-sed -i -e 's|/usr/share/doc/scribus/|././/share/doc/scribus/|g' usr/bin/scribus
-# Possibly need to patch additional hardcoded paths away, replace
-# "/usr" with "././" which means "usr/ in the AppDir"
+mkdir -p appdir/usr/lib appdir/usr/share
+cp /usr/li*/python2.7/lib-dynload/_tkinter.so appdir/usr/ # It is indeed picked up here because we cd there at runtime
+cp -r /usr/lib/tcltk appdir/usr/lib/
+cp -r /usr/share/tcltk appdir/usr/share/
########################################################################
-# AppDir complete
-# Now packaging it as an AppImage
+# Create extra qt.conf in a strange location; FIXME: why is this needed?
########################################################################
-cd .. # Go out of AppImage
-
-mkdir -p ../out/
-generate_appimage
+mkdir -p appdir/lib/x86_64-linux-gnu/
+cat > appdir/lib/x86_64-linux-gnu/qt.conf <<\EOF
+# Why is this needed here? Bug?
+[Paths]
+Prefix = ../../usr
+Plugins = plugins
+Imports = qml
+Qml2Imports = qml
+EOF
########################################################################
-# Upload the AppDir
+# Generate AppImage
########################################################################
-transfer ../out/*
+# Finalize AppDir but do not turn into AppImage just yet
+wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
+chmod a+x linuxdeployqt-continuous-x86_64.AppImage
+ARCH=x86_64 ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/scribus.desktop \
+-appimage -unsupported-bundle-everything \
+-executable=appdir/usr/bin/python2.7 -executable=appdir/usr/_tkinter.so -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so
\ No newline at end of file