diff --git a/appimage-template/docker/qt59/kf5/Dockerfile b/appimage-template/docker/qt59/kf5/Dockerfile index 0aea5d8..173102c 100644 --- a/appimage-template/docker/qt59/kf5/Dockerfile +++ b/appimage-template/docker/qt59/kf5/Dockerfile @@ -1,17 +1,17 @@ FROM sgclark/trusty-qt59 # KF5 USER jenkins RUN sudo apt-get update && sudo apt-get -y install liblzma-dev libhttp-parser-dev libssh2-1-dev libcurl4-openssl-dev libfam-dev libopenexr-dev libaspell-dev \ hspell libhunspell-dev libvoikko-dev libqrencode-dev libdmtx-dev libutempter-dev media-player-info libgssapi3-heimdal libacl1-dev libepoxy-dev \ libgif-dev libpolkit-agent-1-dev libpolkit-gobject-1-dev libgpgme11-dev RUN cd $SOURCES && wget http://archive.ubuntu.com/ubuntu/pool/main/libd/libdbusmenu-qt/libdbusmenu-qt_0.9.3+16.04.20160218.orig.tar.gz \ && tar -zxvf libdbusmenu-qt_0.9.3+16.04.20160218.orig.tar.gz && cd libdbusmenu-qt-0.9.3+16.04.20160218/ && \ mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr -DCMAKE_INSTALL_LIBDIR=/opt/usr/lib \ -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF -DUSE_QT5=ON -DCMAKE_INCLUDE_CURRENT_DIR=ON -Wno-dev .. && make \ && sudo make install && rm -rfv /libdbusmenu-qt -ADD kf5.sh / -RUN /bin/bash -x kf5.sh -RUN rm kf5.sh +ADD kf5.sh /app/src/ +RUN /bin/bash -x /app/src/kf5.sh + USER root EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"] diff --git a/appimage-template/docker/qt59/kf5/kf5.sh b/appimage-template/docker/qt59/kf5/kf5.sh index c972374..47a0eb1 100755 --- a/appimage-template/docker/qt59/kf5/kf5.sh +++ b/appimage-template/docker/qt59/kf5/kf5.sh @@ -1,68 +1,85 @@ #!/bin/bash +set -e +set -x + +function error_exit +{ + echo "$1" 1>&2 + exit 1 +} + +cd /app/src/ git clone https://github.com/libgit2/libgit2 cd libgit2 && mkdir build && cd build && \ -cmake .. -DCMAKE_INSTALL_PREFIX=/opt/usr -cmake --build . --target install +if cmake .. -DCMAKE_INSTALL_PREFIX=/opt/usr; then + if make && sudo make install; then + echo 'Success' + else + error_exit "$LINENO: An error has occurred.. Aborting." + fi +else + error_exit "$LINENO: An error has occurred.. Aborting." +fi -for package in extra-cmake-modules attica kconfig kwidgetsaddons karchive kcompletion kcoreaddons kcodecs polkit-qt-1 polkit-kde-agent-1 kauth kwindowsystem kcrash \ +for package in extra-cmake-modules attica kconfig kwidgetsaddons karchive kcompletion kcoreaddons kcodecs polkit-qt-1 kauth kwindowsystem kcrash \ ki18n kdoctools kdbusaddons kglobalaccel kguiaddons kidletime kimageformats kitemmodels kjs kplotting syntax-highlighting \ kconfigwidgets kitemviews kiconthemes sonnet kwayland prison threadweaver kcrash kdnssd kpty \ -kservice ktextwidgets kxmlgui kbookmarks solid kjobwidgets phonon phonon-gstreamer knotifications gpgmepp kwallet kio kinit kded kparts \ +kservice ktextwidgets kxmlgui kbookmarks solid kjobwidgets phonon phonon-gstreamer knotifications gpgmepp kwallet kio kinit kded kparts polkit-kde-agent-1 \ kactivities kdewebkit kdesignerplugin kunitconversion kpackage kdeclarative kcmutils kdesu kdewebkit kemoticons kjsembed kmediaplayer \ kdelib4support knewstuff knotifications knotifyconfig kross ktexteditor framework-integration kapidox \ khtml plasma-framework kdecoration krunner do git clone http://anongit.kde.org/$package cd $package case $package in 'breeze' ) if mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE -DBINARY_ICONS_RESOURCE=ON ../; then make -j8 - make install + sudo make install else error_exit "$LINENO: An error has occurred.. Aborting." fi ;; 'breeze-icons' ) if mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE -DBINARY_ICONS_RESOURCE=ON \ -DWITH_DECORATIONS=OFF ../; then make -j8 - make install + sudo make install else error_exit "$LINENO: An error has occurred.. Aborting." fi ;; 'phonon-gstreamer' ) if mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE -DPHONON_LIBRARY_PATH=/opt/usr/plugins \ -DBUILD_TESTING=OFF -DPHONON_BUILD_PHONON4QT5=ON \ -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE ../; then make -j8 - make install + sudo make install else error_exit "$LINENO: An error has occurred.. Aborting." fi ;; 'phonon' ) if mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE -DPHONON_LIBRARY_PATH=/opt/usr/plugins \ -DBUILD_TESTING=OFF -DPHONON_BUILD_PHONON4QT5=ON \ -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE ../; then make -j8 - make install + sudo make install else error_exit "$LINENO: An error has occurred.. Aborting." fi ;; * ) if mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE ../; then make -j8 - make install + sudo make install else error_exit "$LINENO: An error has occurred.. Aborting." fi ;; esac cd ../.. rm -rf $package done find . -type f -executable -exec strip {} \; || true diff --git a/appimage-template/libs/recipe.rb b/appimage-template/libs/recipe.rb index bcbf686..a03f3b9 100644 --- a/appimage-template/libs/recipe.rb +++ b/appimage-template/libs/recipe.rb @@ -1,78 +1,78 @@ #!/usr/bin/env ruby # frozen_string_literal: true # # Copyright (C) 2016 Scarlett Clark # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) version 3, or any # later version accepted by the membership of KDE e.V. (or its # successor approved by the membership of KDE e.V.), which shall # act as a proxy defined in Section 6 of version 3 of the license. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see . require 'erb' require 'fileutils' require 'yaml' class Recipe attr_accessor :name attr_accessor :arch attr_accessor :desktop attr_accessor :icon attr_accessor :iconpath attr_accessor :install_path attr_accessor :packages attr_accessor :dep_path attr_accessor :repo attr_accessor :type attr_accessor :archives attr_accessor :md5sum attr_accessor :version attr_accessor :app_dir attr_accessor :configure_options attr_accessor :binary def initialize(args = {}) Dir.chdir('/') self.name = args[:name] self.binary = args[:binary] self.arch = `arch` self.install_path = '/app/usr' end def clean_workspace(args = {}) self.name = args[:name] - return if Dir['/app/'].empty? - FileUtils.rm_rf("/app/.", secure: true) + return if Dir['/app/src'].empty? + FileUtils.rm_rf("/app/src/.", secure: true) return if Dir['/appimage/'].empty? FileUtils.rm_rf("/appimage/.", secure: true) - return if Dir["/in/#{name}"].empty? - FileUtils.rm_rf("/in/#{name}/#{name}-builddir", secure: true) + return if Dir["/app/src//#{name}"].empty? + FileUtils.rm_rf("/app/src//#{name}/#{name}-builddir", secure: true) end def install_packages(args = {}) self.packages = args[:packages].to_s.gsub(/\,|\[|\]/, '') system('sudo apt-get update && sudo apt-get -y upgrade') system("DEBIAN_FRONTEND=noninteractive sudo apt-get -y install git wget #{packages}") $?.exitstatus end def render ERB.new(File.read(ENV["WORKSPACE"] + '/appimage-packaging/' + ENV["PROJECT"] + '/' + 'Recipe.erb')).result(binding) end def generate_appimage(args = {}) system("/bin/bash -xe" + ENV["WORKSPACE"] + '/appimage-packaging/' + ENV["PROJECT"] + '/' + 'Recipe') $?.exitstatus end end