File qt4-appimage.yml of Package texmacs
app: texmacs
build:
packages:
- linuxdeployqt
- automake
- fdupes
- freetype2-devel
- gcc-c++
- ghostscript-devel
- libguile17
- guile1
- libguile1-devel
- lzma
- shared-mime-info
- update-desktop-files
- xorg-x11-devel
- libqt4-devel
- xdg-utils
- git
#svn:
# - svn://svn.savannah.gnu.org/texmacs/trunk/src
# ingredients:
# - guile1
script:
- cd $BUILD_SOURCE_DIR
- mkdir -p src
- if [ -f texmacs*.tar.gz ] ; then tar --touch -zxf texmacs*.tar.gz --directory src --strip-components=1 ; fi
- cd $BUILD_SOURCE_DIR/src
- ./configure --prefix=/usr
#- patch -i ../appimage_wrapper_script.patch -p2 #provide AppRun script instead
#- patch -i ../equation-editor-plugin.patch -p1
- git --work-tree=. apply ../my_current.patch
#- patch -i ../fix_bug_49655.patch -p1
- make -j4
- make install DESTDIR=$(readlink -f $BUILD_APPDIR) ; find $BUILD_APPDIR/
- echo "QT_PLUGIN_PATH=${QT_PLUGIN_PATH}"
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- mv $BUILD_APPDIR/usr/libexec/TeXmacs/bin/* $BUILD_APPDIR/usr/bin
- rm -rf $BUILD_APPDIR/usr/libexec
#copy /bin/bash into APPDIR, and soft link sh to bash (needed for TeXmacs plugins to run)
#no longer needed (was for use with exec.so, see below)
# - mkdir -p $BUILD_APPDIR/bin
# - cp /bin/bash $BUILD_APPDIR/bin
# - ln -srT $BUILD_APPDIR/bin/bash $BUILD_APPDIR/bin/sh
#manually deploying qt plugins for now, see https://github.com/probonopd/linuxdeployqt/issues/82
- mkdir -p $BUILD_APPDIR/usr/plugins
- cp -rf /usr/lib64/qt4/plugins/imageformats $BUILD_APPDIR/usr/plugins
- cp -rf /usr/lib64/qt4/plugins/accessible $BUILD_APPDIR/usr/plugins
#furthermore manually changing rpath for these plugins libs, see https://github.com/probonopd/linuxdeployqt/issues/80 (not completely fixed, apparently)
- find $BUILD_APPDIR/usr/plugins/ -type f -exec patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN' {} \;
- mkdir -p $BUILD_APPDIR/usr/share/guile/1.8
- cp -rf /usr/share/guile/1.8/ice-9 $BUILD_APPDIR/usr/share/TeXmacs/progs/
- mkdir -p $BUILD_APPDIR/usr/share/metainfo/
- cp ../texmacs.appdata.xml $BUILD_APPDIR/usr/share/metainfo/
- mkdir -p $BUILD_APPDIR/usr/share/applications/
- cp $BUILD_SOURCE_DIR/src/TeXmacs/misc/mime/texmacs.desktop $BUILD_APPDIR/usr/share/applications/texmacs.desktop
#fix intermittent bug https://github.com/probonopd/linuxdeployqt/issues/136#issuecomment-547797987
- cp $BUILD_APPDIR/usr/share/TeXmacs/misc/images/texmacs.svg $BUILD_APPDIR/texmacs.svg
- linuxdeployqt $BUILD_APPDIR/usr/share/applications/texmacs.desktop -bundle-non-qt-libs -verbose=3 -executable=$BUILD_APPDIR/usr/bin/texmacs.bin -no-strip
#fixing issue seen in https://github.com/AppImage/appimage.github.io/pull/1662
#see https://github.com/darealshinji/AppImageKit-checkrt/issues/1
#and https://github.com/probonopd/audacity/blob/AppImage/.travis.yml
#see https://github.com/slowphil/AppImageKit-checkrt
#cannot use wget here, the needed files are downloaded first while running _service
# - mkdir -p $BUILD_APPDIR/usr/optional/ ; cp $BUILD_SOURCE_DIR/exec-x86_64.so $BUILD_APPDIR/usr/optional/exec.so
#the above fix was a complicated solution! all we needed was to not set LD_LIBRARY_PATH to $BUILD_APPDIR/usr/lib (as the default binary AppRun does)
#we replace the default binary AppRun by our own script not setting LD_LIBRARY_PATH and replacing $BUILD_APPDIR/usr/bin/texmacs
- rm $BUILD_APPDIR/AppRun ; cp $BUILD_SOURCE_DIR/AppRun.sh $BUILD_APPDIR/AppRun ; chmod a+x $BUILD_APPDIR/AppRun
- linuxdeployqt $BUILD_APPDIR/usr/share/applications/texmacs.desktop -appimage -verbose=3 -executable=$BUILD_APPDIR/usr/bin/texmacs.bin -no-strip
- find $BUILD_APPDIR/