Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it super simple to use on Travis CI #81

Open
1 of 6 tasks
probonopd opened this issue Feb 20, 2017 · 1 comment
Open
1 of 6 tasks

Make it super simple to use on Travis CI #81

probonopd opened this issue Feb 20, 2017 · 1 comment

Comments

@probonopd
Copy link
Owner

probonopd commented Feb 20, 2017

A common use case for linuxdeployqt is to use it on Travis CI after the make command.

Currently quite some hoops are necessary. We should make linuxdeployqt so intelligent as to be a one-line operation, ideally replacing most of the manual work of

language: cpp
compiler: gcc
sudo: require
dist: trusty

before_install:
    - sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
    - sudo apt-get update -qq
    
install: 
    - sudo apt-get -y install qt58base
    - source /opt/qt58/bin/qt58-env.sh

script:
  - qmake PREFIX=/usr
  - make -j4
  - sudo apt-get -y install checkinstall
  - sudo checkinstall --pkgname=app --pkgversion="1" --pkgrelease="1" --backup=no --fstrans=no --default --deldoc 
  - mkdir appdir ; cd appdir
  - dpkg -x ../app_1-1_amd64.deb . ; find .
  - cp ./usr/share/applications/*.desktop .
  - cp ./usr/share/icons/hicolor/48x48/apps/*.png .
  - cd .. 
  - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/3/linuxdeployqt-3-x86_64.AppImage" 
  - chmod a+x linuxdeployqt*.AppImage
  - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
  - ./linuxdeployqt*.AppImage ./appdir/usr/bin/* -bundle-non-qt-libs -qmldir=$(readlink -f /opt/qt5*/qml/)
  - ./linuxdeployqt*.AppImage ./appdir/usr/bin/* -appimage -qmldir=$(readlink -f /opt/qt5*/qml/)
  - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
  - curl --upload-file ./APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage 

We could, as part of linuxdeployqt and/or the underlying appimagetool,

  • Unset the offending Qt environment variables that prevent linuxdeployqt from running
  • Remove the need for -qmldir=$(readlink -f /opt/qt5*/qml/)
  • Check if there is exactly one desktop file in usr/share/applications and if so, use that. Otherwise have the user specify the desktop file rather than the executable and figure out the executable and icon from there, hence doing the copying automatically
  • Use checkinstall. This is because I could not figure out a reliable method of installing to a different location than /usr - seems not needed in most cases
  • Optionally, use the git and/or travis information to determine the version
  • Optionally, upload to transfer.sh

In the current continuous build, the following is implemented:

language: cpp
compiler: gcc
sudo: require
dist: trusty

before_install:
    - sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
    - sudo apt-get update -qq
    
install: 
    - sudo apt-get -y install qt58base
    - source /opt/qt58/bin/qt58-env.sh

script:
  - qmake PREFIX=/usr
  - make -j4
  - sudo make INSTALL_ROOT=appdir install ; sudo chown -R $USER appdir ; find appdir/

after_success:
  - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" 
  - chmod a+x linuxdeployqt*.AppImage
  - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
  - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
  - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage
  - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
  - curl --upload-file ./APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage

Note that if qmake does not allow for make install or does not install the desktop file and icon, then change it similar to https://github.com/probonopd/FeedTheMonkey/blob/master/FeedTheMonkey.pro.

@probonopd
Copy link
Owner Author

probonopd commented Feb 24, 2017

Similar build procedures used for

Attention: These might all suffer from #80 - to be fixed.

Once this is closed, should see if we can simplify their .travis.yml files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant