diff --git a/packaging/linux/appimage/build-deps.sh b/packaging/linux/appimage/build-deps.sh index 44f8914b31..001ccb03f8 100755 --- a/packaging/linux/appimage/build-deps.sh +++ b/packaging/linux/appimage/build-deps.sh @@ -1,83 +1,84 @@ #!/bin/bash # # Build all Krita's dependencies on Ubuntu 14.04. # # Prerequisites: cmake git build-essential libxcb-keysyms1-dev plus all deps for Qt5 # # Halt on errors and be verbose about what we are doing set -e set -x # Read in our parameters export BUILD_PREFIX=$1 export KRITA_SOURCES=$2 # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. # That's not always the case, so make sure it is export LC_ALL=en_US.UTF-8 export LANG=en_us.UTF-8 # We want to use $prefix/deps/usr/ for all our dependencies export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/deps/usr/ export DOWNLOADS_DIR=$BUILD_PREFIX/downloads/ # Setup variables needed to help everything find what we build export LD_LIBRARY_PATH=$DEPS_INSTALL_PREFIX/lib:$LD_LIBRARY_PATH export PATH=$DEPS_INSTALL_PREFIX/bin:$PATH export PKG_CONFIG_PATH=$DEPS_INSTALL_PREFIX/share/pkgconfig:$DEPS_INSTALL_PREFIX/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH export CMAKE_PREFIX_PATH=$DEPS_INSTALL_PREFIX:$CMAKE_PREFIX_PATH # A krita build layout looks like this: # krita/ -- the source directory # downloads/ -- downloads of the dependencies from files.kde.org # deps-build/ -- build directory for the dependencies # deps/ -- the location for the built dependencies # build/ -- build directory for krita itself # krita.appdir/ -- install directory for krita and the dependencies # Make sure our downloads directory exists if [ ! -d $DOWNLOADS_DIR ] ; then mkdir -p $DOWNLOADS_DIR fi # Make sure our build directory exists if [ ! -d $BUILD_PREFIX/deps-build/ ] ; then mkdir -p $BUILD_PREFIX/deps-build/ fi # The 3rdparty dependency handling in Krita also requires the install directory to be pre-created if [ ! -d $DEPS_INSTALL_PREFIX ] ; then mkdir -p $DEPS_INSTALL_PREFIX fi # Switch to our build directory as we're basically ready to start building... cd $BUILD_PREFIX/deps-build/ # Configure the dependencies for building cmake $KRITA_SOURCES/3rdparty -DCMAKE_INSTALL_PREFIX=$DEPS_INSTALL_PREFIX -DINSTALL_ROOT=$DEPS_INSTALL_PREFIX -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOADS_DIR # Now start building everything we need, in the appropriate order #cmake --build . --config RelWithDebInfo --target ext_png #cmake --build . --config RelWithDebInfo --target ext_tiff #cmake --build . --config RelWithDebInfo --target ext_jpeg cmake --build . --config RelWithDebInfo --target ext_boost cmake --build . --config RelWithDebInfo --target ext_eigen3 cmake --build . --config RelWithDebInfo --target ext_exiv2 cmake --build . --config RelWithDebInfo --target ext_fftw3 cmake --build . --config RelWithDebInfo --target ext_lcms2 cmake --build . --config RelWithDebInfo --target ext_ocio cmake --build . --config RelWithDebInfo --target ext_openexr cmake --build . --config RelWithDebInfo --target ext_vc cmake --build . --config RelWithDebInfo --target ext_libraw cmake --build . --config RelWithDebInfo --target ext_giflib #cmake --build . --config RelWithDebInfo --target ext_gsl cmake --build . --config RelWithDebInfo --target ext_python #cmake --build . --config RelWithDebInfo --target ext_freetype #cmake --build . --config RelWithDebInfo --target ext_fontconfig cmake --build . --config RelWithDebInfo --target ext_qt cmake --build . --config RelWithDebInfo --target ext_poppler cmake --build . --config RelWithDebInfo --target ext_kcrash cmake --build . --config RelWithDebInfo --target ext_gmic cmake --build . --config RelWithDebInfo --target ext_sip cmake --build . --config RelWithDebInfo --target ext_pyqt +cmake --build . --config RelWithDebInfo --target ext_quazip diff --git a/packaging/linux/appimage/build-gmic-qt.sh b/packaging/linux/appimage/build-gmic-qt.sh index 64719a7117..70b8c61957 100755 --- a/packaging/linux/appimage/build-gmic-qt.sh +++ b/packaging/linux/appimage/build-gmic-qt.sh @@ -1,46 +1,47 @@ #!/bin/bash # Halt on errors and be verbose about what we are doing set -e set -x # Read in our parameters export BUILD_PREFIX=$1 +export VERSION=2.4.2 # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. # That's not always the case, so make sure it is export LC_ALL=en_US.UTF-8 export LANG=en_us.UTF-8 # We want to use $prefix/deps/usr/ for all our dependencies export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/deps/usr/ export DOWNLOADS_DIR=$BUILD_PREFIX/downloads/ # Setup variables needed to help everything find what we build export LD_LIBRARY_PATH=$DEPS_INSTALL_PREFIX/lib:$LD_LIBRARY_PATH export PATH=$DEPS_INSTALL_PREFIX/bin:$PATH export PKG_CONFIG_PATH=$DEPS_INSTALL_PREFIX/share/pkgconfig:$DEPS_INSTALL_PREFIX/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH export CMAKE_PREFIX_PATH=$DEPS_INSTALL_PREFIX:$CMAKE_PREFIX_PATH # Switch to the build prefix cd $BUILD_PREFIX # G'Mic is built in build-deps.sh # Therefore we just need to copy over the installation artifacts from that process # First, make sure we have a clean slate to work from and setup the directory structure rm -rf $BUILD_PREFIX/gmic_qt_krita.appdir/ mkdir -p $BUILD_PREFIX/gmic_qt_krita.appdir/usr/bin mkdir -p $BUILD_PREFIX/gmic_qt_krita.appdir/usr/lib mkdir -p $BUILD_PREFIX/gmic_qt_krita.appdir/usr/share # Copy over the artifacts... cp $DEPS_INSTALL_PREFIX/bin/gmic_krita_qt* $BUILD_PREFIX/gmic_qt_krita.appdir/usr/bin cp $BUILD_PREFIX/deps-build/ext_gmic/gmic-qt/resources/gmic_hat.png $BUILD_PREFIX/gmic_qt_krita.appdir/gmic_krita_qt.png # Now generate the Appimage for it linuxdeployqt $BUILD_PREFIX/gmic_qt_krita.appdir/usr/bin/gmic_krita_qt.desktop -verbose=2 -bundle-non-qt-libs -appimage # Make sure it has a consistent name too -mv gmic_krita_qt-x86_64.AppImage gmic_krita_qt-x86_64.appimage +mv gmic_krita_qt*x86_64.AppImage gmic_krita_qt-x86_64.appimage diff --git a/packaging/linux/appimage/build-image.sh b/packaging/linux/appimage/build-image.sh index 1dffe2f19d..7922e6f377 100755 --- a/packaging/linux/appimage/build-image.sh +++ b/packaging/linux/appimage/build-image.sh @@ -1,102 +1,106 @@ #!/bin/bash # Halt on errors and be verbose about what we are doing -set -e +#set -e set -x # Read in our parameters export BUILD_PREFIX=$1 export KRITA_SOURCES=$2 # Save some frequently referenced locations in variables for ease of use / updating export APPDIR=$BUILD_PREFIX/krita.appdir export PLUGINS=$APPDIR/usr/lib/kritaplugins/ # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. # That's not always the case, so make sure it is export LC_ALL=en_US.UTF-8 export LANG=en_us.UTF-8 # We want to use $prefix/deps/usr/ for all our dependencies export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/deps/usr/ export DOWNLOADS_DIR=$BUILD_PREFIX/downloads/ # Setup variables needed to help everything find what we built export LD_LIBRARY_PATH=$DEPS_INSTALL_PREFIX/lib/:$DEPS_INSTALL_PREFIX/lib/x86_64-linux-gnu/:$APPDIR/usr/lib/:$LD_LIBRARY_PATH export PATH=$DEPS_INSTALL_PREFIX/bin/:$PATH export PKG_CONFIG_PATH=$DEPS_INSTALL_PREFIX/share/pkgconfig/:$DEPS_INSTALL_PREFIX/lib/pkgconfig/:/usr/lib/pkgconfig/:$PKG_CONFIG_PATH export CMAKE_PREFIX_PATH=$DEPS_INSTALL_PREFIX:$CMAKE_PREFIX_PATH export PYTHONPATH=$DEPS_INSTALL_PREFIX/sip/:$DEPS_INSTALL_PREFIX/lib/python3.5/site-packages/:$DEPS_INSTALL_PREFIX/lib/python3.5/ export PYTHONHOME=$DEPS_INSTALL_PREFIX # Switch over to our build prefix cd $BUILD_PREFIX # # Now we can get the process started! # # Step 0: place the translations where ki18n and Qt look for them if [ -d $APPDIR/usr/share/locale ] ; then mv $APPDIR/usr/share/locale $APPDIR/usr/share/krita fi # Step 1: Copy over all the resources provided by dependencies that we need cp -r $DEPS_INSTALL_PREFIX/share/locale $APPDIR/usr/share/krita cp -r $DEPS_INSTALL_PREFIX/share/kf5 $APPDIR/usr/share cp -r $DEPS_INSTALL_PREFIX/share/mime $APPDIR/usr/share cp -r $DEPS_INSTALL_PREFIX/lib/python3.5 $APPDIR/usr/lib cp -r $DEPS_INSTALL_PREFIX/sip $APPDIR/usr/lib/ cp -r $DEPS_INSTALL_PREFIX/translations $APPDIR/usr/ # Step 2: Relocate x64 binaries from the architecture specific directory as required for Appimages mv $APPDIR/usr/lib/x86_64-linux-gnu/* $APPDIR/usr/lib rm -rf $APPDIR/usr/lib/x86_64-linux-gnu/ # Step 3: Update the rpath in the various plugins we have to make sure they'll be loadable in an Appimage context for lib in $PLUGINS/*.so*; do patchelf --set-rpath '$ORIGIN/..' $lib; done for lib in $APPDIR/usr/lib/python3.5/site-packages/PyQt5/*.so*; do patchelf --set-rpath '$ORIGIN/../..' $lib; done for lib in $APPDIR/usr/lib/python3.5/lib-dynload/*.so*; do patchelf --set-rpath '$ORIGIN/../..' $lib; done patchelf --set-rpath '$ORIGIN/../../../..' $APPDIR/usr/lib/qml/org/krita/draganddrop/libdraganddropplugin.so patchelf --set-rpath '$ORIGIN/../../../..' $APPDIR/usr/lib/qml/org/krita/sketch/libkritasketchplugin.so patchelf --set-rpath '$ORIGIN/../..' $APPDIR/usr/lib/krita-python-libs/PyKrita/krita.so patchelf --set-rpath '$ORIGIN/../..' $APPDIR/usr/lib/sip/sip.so -# Step 4: Build the image!!! -linuxdeployqt $APPDIR/usr/share/applications/org.kde.krita.desktop \ - -executable=$APPDIR/usr/bin/krita \ - -qmldir=$DEPS_INSTALL_PREFIX/qml \ - -verbose=2 \ - -bundle-non-qt-libs \ - -extra-plugins=$PLUGINS,$APPDIR/usr/lib/krita-python-libs/PyKrita/krita.so,$APPDIR/usr/lib//qml/org/krita/sketch/libkritasketchplugin.so,$APPDIR/usr/lib/qml/org/krita/draganddrop/libdraganddropplugin.so \ - -appimage - # Step 5: Find out what version of Krita we built and give the Appimage a proper name cd $BUILD_PREFIX/krita-build + KRITA_VERSION=$(grep "#define KRITA_VERSION_STRING" libs/version/kritaversion.h | cut -d '"' -f 2) # Also find out the revision of Git we built # Then use that to generate a combined name we'll distribute cd $KRITA_SOURCES if [[ -d .git ]]; then GIT_REVISION=$(git rev-parse --short HEAD) VERSION=$KRITA_VERSION-$GIT_REVISION else VERSION=$KRITA_VERSION fi # Return to our build root cd $BUILD_PREFIX + +# Step 4: Build the image!!! +linuxdeployqt $APPDIR/usr/share/applications/org.kde.krita.desktop \ + -executable=$APPDIR/usr/bin/krita \ + -qmldir=$DEPS_INSTALL_PREFIX/qml \ + -verbose=2 \ + -bundle-non-qt-libs \ + -extra-plugins=$PLUGINS,$APPDIR/usr/lib/krita-python-libs/PyKrita/krita.so,$APPDIR/usr/lib//qml/org/krita/sketch/libkritasketchplugin.so,$APPDIR/usr/lib/qml/org/krita/draganddrop/libdraganddropplugin.so \ + -appimage + # Generate a new name for the Appimage file and rename it accordingly APPIMAGE=krita-"$VERSION"-x86_64.appimage -mv Krita*AppImage $APPIMAGE + +mv Krita*x86_64.AppImage $APPIMAGE +