├── README.md ├── deploy.rb ├── gatherdeps.rb ├── generate_recipe.rb ├── cmake-dependencies.py ├── Recipe.erb ├── Recipe └── Recipe.orig /README.md: -------------------------------------------------------------------------------- 1 | # ark 2 | Initial appimage recipe for ark 3 | 4 | Initial automation scripts to spin container and build. 5 | 6 | Experimental dependency tools. 7 | 8 | Unfinished WIP, still working through deps manually.. 9 | -------------------------------------------------------------------------------- /deploy.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | # 4 | # Copyright (C) 2016 Scarlett Clark 5 | # Copyright (C) 2015-2016 Harald Sitter 6 | # 7 | # This library is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 2.1 of the License, or (at your option) version 3, or any 11 | # later version accepted by the membership of KDE e.V. (or its 12 | # successor approved by the membership of KDE e.V.), which shall 13 | # act as a proxy defined in Section 6 of version 3 of the license. 14 | # 15 | # This library is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | # Lesser General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU Lesser General Public 21 | # License along with this library. If not, see . 22 | 23 | require_relative 'generate_recipe.rb' 24 | require_relative 'builddocker.rb' 25 | require 'fileutils' 26 | 27 | if File.exist?('out/Ark-git-x86_64.AppImage') 28 | FileUtils.rm('out/Ark-git-x86_64.AppImage') 29 | end 30 | builder = CI.new 31 | builder.run = [CI::Build.new()] 32 | builder.cmd = %w[bash -ex /in/Recipe] 33 | builder.create_container 34 | system( 'chown jenkins.jenkins out/Ark-git-x86_64.AppImage' ) 35 | -------------------------------------------------------------------------------- /gatherdeps.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | # 4 | # Copyright (C) 2016 Scarlett Clark 5 | # Copyright (C) 2015-2016 Harald Sitter 6 | # 7 | # This library is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 2.1 of the License, or (at your option) version 3, or any 11 | # later version accepted by the membership of KDE e.V. (or its 12 | # successor approved by the membership of KDE e.V.), which shall 13 | # act as a proxy defined in Section 6 of version 3 of the license. 14 | # 15 | # This library is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | # Lesser General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU Lesser General Public 21 | # License along with this library. If not, see . 22 | 23 | #attempt to get deps. NOTE: This is for ubuntu/debian based distro 24 | require 'fileutils' 25 | require_relative 'generate_recipe.rb' 26 | 27 | appimage = Recipe.new 28 | appimage.name = "ark" 29 | cmake_deps = '' 30 | appimage.dependencies = [] 31 | if not File.exists?("#{appimage.name}") 32 | system("git clone http://anongit.kde.org/#{appimage.name} 33 | #{appimage.name}") 34 | Dir.chdir("#{appimage.name}") do 35 | system("git submodule init") 36 | system("git submodule update") 37 | end 38 | FileUtils.cp('cmake-dependencies.py', "#{appimage.name}") 39 | Dir.chdir("#{appimage.name}") do 40 | system("cmake \ 41 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 42 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 43 | -DPACKAGERS_BUILD=1 \ 44 | -DBUILD_TESTING=FALSE" 45 | ) 46 | system("make -j8") 47 | cmake_deps = `python3 cmake-dependencies.py | grep '\"project\": '`.sub('\\', '').split(',') 48 | end 49 | 50 | cmake_deps.each do |dep| 51 | parts = dep.sub('{', '').sub('}', '').split(',') 52 | 53 | parts.each do |project| 54 | a = project.split.each_slice(3).map{ |x| x.join(' ')}.to_s 55 | if a.to_s.include? "project" 56 | name = a.gsub((/[^0-9a-z ]/i), '') 57 | name.slice! "project " 58 | appimage.dependencies.push name 59 | end 60 | end 61 | end 62 | 63 | puts appimage.dependencies 64 | -------------------------------------------------------------------------------- /generate_recipe.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | # 4 | # Copyright (C) 2016 Scarlett Clark 5 | # Copyright (C) 2015-2016 Harald Sitter 6 | # 7 | # This library is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 2.1 of the License, or (at your option) version 3, or any 11 | # later version accepted by the membership of KDE e.V. (or its 12 | # successor approved by the membership of KDE e.V.), which shall 13 | # act as a proxy defined in Section 6 of version 3 of the license. 14 | # 15 | # This library is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | # Lesser General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU Lesser General Public 21 | # License along with this library. If not, see . 22 | require 'erb' 23 | 24 | class Recipe 25 | class App 26 | def initialize(name) 27 | @name = name 28 | end 29 | end 30 | 31 | attr_accessor :name 32 | attr_accessor :proper_name 33 | attr_accessor :depends 34 | attr_accessor :dependencies 35 | attr_accessor :version 36 | attr_accessor :summary 37 | attr_accessor :description 38 | attr_accessor :frameworks 39 | attr_accessor :external 40 | attr_accessor :apps 41 | 42 | def render 43 | ERB.new(File.read('Recipe.erb')).result(binding) 44 | end 45 | end 46 | 47 | appimage = Recipe.new 48 | appimage.name = "ark" 49 | appimage.proper_name = appimage.name.capitalize 50 | appimage.version = '16.04.1' 51 | #TO_DO do some LD magic here? kdev-tools cmake parser? 52 | appimage.depends = 'bzip2-devel liblzma-devel xz-devel media-player-info.noarch' 53 | #Needed to add ability to pull in external builds that are simply to old 54 | #in Centos. 55 | appimage.external = 'libarchive,https://github.com/libarchive/libarchive,true,""' 56 | appimage.frameworks = 'karchive kconfig kwidgetsaddons kcompletion kcoreaddons kauth kcodecs kdoctools kguiaddons ki18n kconfigwidgets kwindowsystem kcrash kdbusaddons kitemviews kiconthemes kjobwidgets kservice solid sonnet ktextwidgets attica kglobalaccel kxmlgui kbookmarks kio knotifications kparts kpty' 57 | appimage.apps = [Recipe::App.new("#{appimage.name}")] 58 | File.write('Recipe', appimage.render) 59 | -------------------------------------------------------------------------------- /cmake-dependencies.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Outputs dependencies information from a build directory 4 | # 5 | # Copyright (c) 2014 Aleix Pol Gonzalez 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 11 | # 1. Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # 2. Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | # cmake . --trace |& grep ^/ | grep -v CMakeLists.txt | cut -d '(' -f 1 | sort -u 29 | 30 | import subprocess 31 | import os 32 | import re 33 | import json 34 | import argparse 35 | import sys 36 | 37 | def readCache(varName): 38 | f = open("CMakeCache.txt", "r") 39 | for line in f: 40 | m = re.match('(.*?)=(.*)', line) 41 | if m is not None and m.group(1)==varName: 42 | return m.group(2) 43 | 44 | def checkPackageVersion(frameworkName): 45 | value = readCache("FIND_PACKAGE_MESSAGE_DETAILS_%s:INTERNAL" % frameworkName) 46 | if value is None: 47 | return None 48 | m = re.match('.*\\]\\[v(.*?)\\((.*?)\\)\\]', value) 49 | if m: 50 | return { 'used': m.group(1), 'requested': m.group(2) } 51 | else: 52 | return None 53 | 54 | if __name__ == "__main__": 55 | parser = argparse.ArgumentParser(description='Figures out the dependencies of the build directory in the cwd.') 56 | 57 | try: 58 | projectDir = readCache("CMAKE_HOME_DIRECTORY:INTERNAL") 59 | except: 60 | print("Run in a build directory.") 61 | parser.print_help() 62 | sys.exit(1) 63 | 64 | proc = subprocess.Popen(['cmake', '.', '--trace'], stdout=open(os.devnull, "w"), stderr=subprocess.PIPE) 65 | processedFiles = {} 66 | lookedUpPackages = {} 67 | 68 | lastFile = "" 69 | callingFile = "" 70 | for line in proc.stderr: 71 | theLine = line.decode("utf-8") 72 | 73 | m = re.match('.*?:\s*find_package\((.*?) (.*?)\).*', theLine) 74 | if m is not None: 75 | if "$" not in m.group(2): 76 | lookedUpPackages[m.group(1)] = m.group(2) 77 | 78 | # match file names 79 | # e.g./usr/share/cmake-3.0/Modules/FindPackageMessage.cmake(46): set(... 80 | m = re.match("(^/.*?)\\(.*", theLine) 81 | if m is not None: 82 | currentFile = m.group(1) 83 | if lastFile != currentFile: 84 | callingFile = lastFile 85 | lastFile = currentFile 86 | filePath, fileName = os.path.split(currentFile) 87 | 88 | if fileName == "CMakeLists.txt": 89 | continue 90 | 91 | m = re.match("(.*)Config(Version)?.cmake", fileName) 92 | m2 = re.match("Find(.*).cmake", fileName) 93 | if m2: 94 | moduleName = m2.group(1) 95 | elif m: 96 | moduleName = m.group(1) 97 | else: 98 | continue 99 | 100 | if not moduleName in processedFiles: 101 | processedFiles[moduleName] = { 'files': set(), 'explicit': False } 102 | 103 | if not 'version' in processedFiles[moduleName]: 104 | processedFiles[moduleName]['version'] = checkPackageVersion(moduleName) 105 | 106 | processedFiles[moduleName]['files'].add(currentFile) 107 | processedFiles[moduleName]['explicit'] |= (callingFile.endswith("CMakeLists.txt") or callingFile.endswith("Qt5/Qt5Config.cmake") or callingFile.endswith("FindKF5.cmake")) 108 | 109 | print("[") 110 | first = True 111 | for v, value in processedFiles.items(): 112 | if not first: 113 | print(',\n', end='') 114 | first = False 115 | 116 | value['files'] = list(value['files']) 117 | value['project'] = v 118 | if v in lookedUpPackages: 119 | if value['version'] is None: 120 | line = lookedUpPackages[v] 121 | isVersion = line[:line.find(' ')] 122 | 123 | if len(isVersion)>0 and isVersion[0].isdigit(): 124 | value['version'] = { 'used': None, 'requested': isVersion } 125 | 126 | del lookedUpPackages[v] 127 | 128 | print("\t%s" % (json.dumps(value)), end='') 129 | 130 | # display missing packages 131 | for v in lookedUpPackages: 132 | if not first: 133 | print(',\n', end='') 134 | 135 | print("\t{ \"project\": \"%s\", \"missing\": true, \"files\": [], \"arguments\": \"%s\", \"explicit\": true }" % (v, lookedUpPackages[v])) 136 | 137 | 138 | print("\n]\n") 139 | proc.wait() 140 | -------------------------------------------------------------------------------- /Recipe.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Based on http://files.svenbrauch.de/kdevelop-linux/kdevelop-recipe-centos6.sh 4 | 5 | # On Amazon AWS start an Amazon Linux instance (I used c4.2xlarge) and run: 6 | # sudo yum -y install docker 7 | # sudo service docker start 8 | # sudo docker run -i -t scummos/centos6.8-qt5.7 9 | # wget -c https://github.com/appimage-packages/kcalc/Recipe 10 | # bash -ex Recipe 11 | 12 | # Halt on errors 13 | set -e 14 | 15 | # Be verbose 16 | set -x 17 | 18 | # Now we are inside CentOS 6 19 | grep -r "CentOS release 6" /etc/redhat-release || exit 1 20 | 21 | # Get helper functions 22 | wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh 23 | . ./functions.sh 24 | rm -f functions.sh 25 | 26 | yum -y install gettext perl-URI.noarch <%= depends %> 27 | 28 | QTVERSION=5.7.0 29 | QVERSION_SHORT=5.7 30 | QTDIR=/usr/local/Qt-${QTVERSION}/ 31 | 32 | # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. That's 33 | # not always set correctly in CentOS 6.7 34 | export LC_ALL=en_US.UTF-8 35 | export LANG=en_us.UTF-8 36 | 37 | # Determine which architecture should be built 38 | if [[ "$(arch)" = "i686" || "$(arch)" = "x86_64" ]] ; then 39 | ARCH=$(arch) 40 | else 41 | echo "Architecture could not be determined" 42 | exit 1 43 | fi 44 | 45 | # Make sure we build from the /, parts of this script depends on that. We also need to run as root... 46 | cd / 47 | 48 | # Use the new compiler 49 | . /opt/rh/devtoolset-4/enable 50 | 51 | # TO-DO ask about this. 52 | export CMAKE_PREFIX_PATH=$QTDIR:/app/share/llvm/ 53 | 54 | # if the library path doesn't point to our usr/lib, linking will be broken and we won't find all deps either 55 | export LD_LIBRARY_PATH=/usr/lib64/:/usr/lib:/app/usr/lib:$QTDIR/lib/:/opt/python3.5/lib/:$LD_LIBRARY_PATH 56 | 57 | # Workaround for: On CentOS 6, .pc files in /usr/lib/pkgconfig are not recognized 58 | # However, this is where .pc files get installed when bulding libraries... (FIXME) 59 | # I found this by comparing the output of librevenge's "make install" command 60 | # between Ubuntu and CentOS 6 61 | ln -sf /usr/share/pkgconfig /usr/lib/pkgconfig 62 | 63 | # Get project 64 | if [ ! -d /<%= name %> ] ; then 65 | git clone --depth 1 http://anongit.kde.org/<%= name %>.git /<%= name %> 66 | fi 67 | cd /<%= name %>/ 68 | git_pull_rebase_helper 69 | 70 | # Prepare the install location 71 | rm -rf /app/ || true 72 | mkdir -p /app/usr 73 | 74 | # export LLVM_ROOT=/opt/llvm/ 75 | 76 | # make sure lib and lib64 are the same thing 77 | mkdir -p /app/usr/lib 78 | cd /app/usr 79 | ln -s lib lib64 80 | 81 | # start building the deps 82 | 83 | function build_external 84 | { ( 85 | # errors fatal 86 | echo "Compiler version:" $(g++ --version) 87 | set -e 88 | 89 | SRC=/external 90 | BUILD=/external/build 91 | PREFIX=/app/usr/ 92 | 93 | # framework 94 | EXTERNAL=$1 95 | 96 | # clone if not there 97 | mkdir -p $SRC 98 | cd $SRC 99 | if ( test -d $EXTERNAL ) 100 | then 101 | echo "$EXTERNAL already cloned" 102 | cd $EXTERNAL 103 | git reset --hard 104 | git pull --rebase 105 | cd .. 106 | else 107 | git clone $EXTERNAL_ADDRESS 108 | fi 109 | 110 | # create build dir 111 | mkdir -p $BUILD/$EXTERNAL 112 | 113 | # go there 114 | cd $BUILD/$EXTERNAL 115 | 116 | # cmake it 117 | if ( $EXTERNAL_CMAKE ) 118 | then 119 | cmake $SRC/$EXTERNAL -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 120 | else 121 | $EXTERNAL_CONFIGURE 122 | fi 123 | # make 124 | make -j8 125 | 126 | # install 127 | make install 128 | ) } 129 | 130 | IN=<%= external %> 131 | IFS=',' read -a external_options <<< $IN 132 | EXTERNAL="${external_options[0]}" 133 | EXTERNAL_ADDRESS="${external_options[1]}" 134 | EXTERNAL_CMAKE="${external_options[2]}" 135 | EXTERNAL_CONFIGURE="${external_options[3]}" 136 | build_external $EXTERNAL 137 | 138 | function build_framework 139 | { ( 140 | # errors fatal 141 | echo "Compiler version:" $(g++ --version) 142 | set -e 143 | 144 | SRC=/kf5 145 | BUILD=/kf5/build 146 | PREFIX=/app/usr/ 147 | 148 | # framework 149 | FRAMEWORK=$1 150 | 151 | # clone if not there 152 | mkdir -p $SRC 153 | cd $SRC 154 | if ( test -d $FRAMEWORK ) 155 | then 156 | echo "$FRAMEWORK already cloned" 157 | cd $FRAMEWORK 158 | git reset --hard 159 | git pull --rebase 160 | cd .. 161 | else 162 | git clone git://anongit.kde.org/$FRAMEWORK 163 | fi 164 | 165 | if [ "$FRAMEWORK" = "knotifications" ]; then 166 | cd $FRAMEWORK 167 | echo "patching knotifications" 168 | git reset --hard 169 | cat > no_phonon.patch << EOF 170 | diff --git a/CMakeLists.txt b/CMakeLists.txt 171 | index b97425f..8f15f08 100644 172 | --- a/CMakeLists.txt 173 | +++ b/CMakeLists.txt 174 | @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) 175 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) 176 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) 177 | 178 | -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) 179 | +find_package(Phonon4Qt5 4.6.60 NO_MODULE) 180 | set_package_properties(Phonon4Qt5 PROPERTIES 181 | DESCRIPTION "Qt-based audio library" 182 | - TYPE REQUIRED 183 | + TYPE OPTIONAL 184 | PURPOSE "Required to build audio notification support") 185 | if (Phonon4Qt5_FOUND) 186 | add_definitions(-DHAVE_PHONON4QT5) 187 | EOF 188 | cat no_phonon.patch |patch -p1 189 | cd .. 190 | fi 191 | 192 | # create build dir 193 | mkdir -p $BUILD/$FRAMEWORK 194 | 195 | # go there 196 | cd $BUILD/$FRAMEWORK 197 | 198 | # cmake it 199 | cmake $SRC/$FRAMEWORK -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 200 | 201 | # make 202 | make -j8 203 | 204 | # install 205 | make install 206 | ) } 207 | 208 | #TO-DO script these extras 209 | build_framework extra-cmake-modules 210 | #Cmake is too old on centos6.... so does this mean no sound for KDE apps? blech. 211 | #build_framework phonon -DPHONON_BUILD_PHONON4QT5=ON 212 | 213 | for FRAMEWORK in <%= frameworks %>; do 214 | build_framework $FRAMEWORK 215 | done 216 | build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 217 | 218 | 219 | 220 | cd .. 221 | 222 | # Build <%= name %> 223 | mkdir -p /<%= name %>_build 224 | cd /<%= name %>_build 225 | cmake ../<%= name %> \ 226 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 227 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 228 | -DPACKAGERS_BUILD=1 \ 229 | -DBUILD_TESTING=FALSE 230 | make -j8 install 231 | 232 | ############################################################### 233 | # Build complete, AppImage bundling begins here 234 | ############################################################### 235 | 236 | cd /app 237 | 238 | # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary 239 | mkdir -p ./usr/lib/qt5/plugins/ 240 | 241 | PLUGINS=$(dirname $QTDIR/plugins/bearer) 242 | 243 | cp -r $PLUGINS/{bearer,generic,imageformats,platforms,iconengines,platforminputcontexts,xcbglintegrations} ./usr/lib/qt5/plugins/ 244 | # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ 245 | 246 | cp -ru /usr/share/mime/* /app/usr/share/mime 247 | update-mime-database /app/usr/share/mime/ 248 | 249 | mv ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ 250 | 251 | copy_deps 252 | mv usr/local/Qt-*/lib/* usr/lib 253 | rm -rf usr/local/ 254 | mv lib64/* usr/lib/ 255 | rm -rf lib64/ 256 | # mv ./opt/python3.5/lib/* usr/lib 257 | # mv ./opt/llvm/lib/* usr/lib 258 | rm -rf ./opt/ 259 | rm -rf app/ 260 | 261 | delete_blacklisted 262 | 263 | # We don't bundle the developer stuff 264 | rm -rf usr/include || true 265 | rm -rf usr/lib/cmake || true 266 | rm -rf usr/lib/pkgconfig || true 267 | rm -rf usr/share/ECM/ || true 268 | rm -rf usr/share/gettext || true 269 | rm -rf usr/share/pkgconfig || true 270 | rm -rf rm -rf ./usr/mkspecs/ || true 271 | find . -name '*.a' -exec rm {} \; 272 | 273 | strip -g $(find usr) || true 274 | 275 | mv usr/lib/libexec/kf5/* /app/usr/bin/ 276 | 277 | cd / 278 | if [ ! -d appimage-exec-wrapper ]; then 279 | git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper 280 | fi; 281 | cd /appimage-exec-wrapper/ 282 | make clean 283 | make 284 | 285 | cd /app 286 | cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so 287 | 288 | cat > AppRun << EOF 289 | #!/bin/bash 290 | 291 | DIR="\`dirname \"\$0\"\`" 292 | DIR="\`( cd \"\$DIR\" && pwd )\`" 293 | export APPDIR=\$DIR 294 | 295 | export LD_PRELOAD=\$DIR/exec_wrapper.so 296 | 297 | export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 298 | export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 299 | export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 300 | export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS 301 | export APPIMAGE_ORIGINAL_PATH=\$PATH 302 | 303 | export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH 304 | export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH 305 | export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ 306 | export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS 307 | export PATH=\$DIR/usr/bin:\$PATH 308 | export KDE_FORK_SLAVES=1 309 | 310 | export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 311 | export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 312 | export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 313 | export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS 314 | export APPIMAGE_STARTUP_PATH=\$PATH 315 | 316 | <%= name %> \$@ 317 | EOF 318 | chmod +x AppRun 319 | 320 | cp usr/share/applications/org.kde.<%= name %>.desktop <%= name %>.desktop 321 | cp usr/share/icons/hicolor/128x128/apps/<%= name %>.png . 322 | 323 | #TO-DO this will need some text manipulation in ruby to get this var. 324 | APP=<%= proper_name %> 325 | LOWERAPP=<%= name %> 326 | 327 | get_desktopintegration <%= name %> 328 | 329 | cd / 330 | 331 | # Build AppImageKit 332 | if [ ! -d AppImageKit ] ; then 333 | git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit 334 | fi 335 | 336 | cd /AppImageKit/ 337 | git_pull_rebase_helper 338 | ./build.sh 339 | 340 | cd / 341 | 342 | mkdir -p /$APP/$APP.AppDir 343 | cd /$APP/ 344 | 345 | mv ../app/* $APP.AppDir/ 346 | 347 | VERSION="git" 348 | ARCH=$(arch) 349 | 350 | #TO-DO this will need some text manipulation in ruby to get this var. 351 | /AppImageKit/AppImageAssistant.AppDir/package <%= proper_name %>.AppDir/ /out/$APP-$VERSION-$ARCH.AppImage 352 | 353 | #Skip this. Cannot get it to work and I would rather the file local for now. 354 | #curl --progress-bar --upload-file - https://transfer.sh/$APP-$VERSION-$ARCH.AppImage /out/$APP-$VERSION-$ARCH.AppImage # Upload to transfer.io for testing 355 | -------------------------------------------------------------------------------- /Recipe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Based on http://files.svenbrauch.de/kdevelop-linux/kdevelop-recipe-centos6.sh 4 | 5 | # On Amazon AWS start an Amazon Linux instance (I used c4.2xlarge) and run: 6 | # sudo yum -y install docker 7 | # sudo service docker start 8 | # sudo docker run -i -t scummos/centos6.8-qt5.7 9 | # wget -c https://github.com/appimage-packages/kcalc/Recipe 10 | # bash -ex Recipe 11 | 12 | # Halt on errors 13 | set -e 14 | 15 | # Be verbose 16 | set -x 17 | 18 | # Now we are inside CentOS 6 19 | grep -r "CentOS release 6" /etc/redhat-release || exit 1 20 | 21 | # Get helper functions 22 | wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh 23 | . ./functions.sh 24 | rm -f functions.sh 25 | 26 | yum -y install gettext perl-URI.noarch bzip2-devel liblzma-devel xz-devel media-player-info.noarch 27 | 28 | QTVERSION=5.7.0 29 | QVERSION_SHORT=5.7 30 | QTDIR=/usr/local/Qt-${QTVERSION}/ 31 | 32 | # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. That's 33 | # not always set correctly in CentOS 6.7 34 | export LC_ALL=en_US.UTF-8 35 | export LANG=en_us.UTF-8 36 | 37 | # Determine which architecture should be built 38 | if [[ "$(arch)" = "i686" || "$(arch)" = "x86_64" ]] ; then 39 | ARCH=$(arch) 40 | else 41 | echo "Architecture could not be determined" 42 | exit 1 43 | fi 44 | 45 | # Make sure we build from the /, parts of this script depends on that. We also need to run as root... 46 | cd / 47 | 48 | # Use the new compiler 49 | . /opt/rh/devtoolset-4/enable 50 | 51 | # TO-DO ask about this. 52 | export CMAKE_PREFIX_PATH=$QTDIR:/app/share/llvm/ 53 | 54 | # if the library path doesn't point to our usr/lib, linking will be broken and we won't find all deps either 55 | export LD_LIBRARY_PATH=/usr/lib64/:/usr/lib:/app/usr/lib:$QTDIR/lib/:/opt/python3.5/lib/:$LD_LIBRARY_PATH 56 | 57 | # Workaround for: On CentOS 6, .pc files in /usr/lib/pkgconfig are not recognized 58 | # However, this is where .pc files get installed when bulding libraries... (FIXME) 59 | # I found this by comparing the output of librevenge's "make install" command 60 | # between Ubuntu and CentOS 6 61 | ln -sf /usr/share/pkgconfig /usr/lib/pkgconfig 62 | 63 | # Get project 64 | if [ ! -d /ark ] ; then 65 | git clone --depth 1 http://anongit.kde.org/ark.git /ark 66 | fi 67 | cd /ark/ 68 | git_pull_rebase_helper 69 | 70 | # Prepare the install location 71 | rm -rf /app/ || true 72 | mkdir -p /app/usr 73 | 74 | # export LLVM_ROOT=/opt/llvm/ 75 | 76 | # make sure lib and lib64 are the same thing 77 | mkdir -p /app/usr/lib 78 | cd /app/usr 79 | ln -s lib lib64 80 | 81 | # start building the deps 82 | 83 | function build_external 84 | { ( 85 | # errors fatal 86 | echo "Compiler version:" $(g++ --version) 87 | set -e 88 | 89 | SRC=/external 90 | BUILD=/external/build 91 | PREFIX=/app/usr/ 92 | 93 | # framework 94 | EXTERNAL=$1 95 | 96 | # clone if not there 97 | mkdir -p $SRC 98 | cd $SRC 99 | if ( test -d $EXTERNAL ) 100 | then 101 | echo "$EXTERNAL already cloned" 102 | cd $EXTERNAL 103 | git reset --hard 104 | git pull --rebase 105 | cd .. 106 | else 107 | git clone $EXTERNAL_ADDRESS 108 | fi 109 | 110 | # create build dir 111 | mkdir -p $BUILD/$EXTERNAL 112 | 113 | # go there 114 | cd $BUILD/$EXTERNAL 115 | 116 | # cmake it 117 | if ( $EXTERNAL_CMAKE ) 118 | then 119 | cmake $SRC/$EXTERNAL -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 120 | else 121 | $EXTERNAL_CONFIGURE 122 | fi 123 | # make 124 | make -j8 125 | 126 | # install 127 | make install 128 | ) } 129 | 130 | IN=libarchive,https://github.com/libarchive/libarchive,true,"" 131 | IFS=',' read -a external_options <<< $IN 132 | EXTERNAL="${external_options[0]}" 133 | EXTERNAL_ADDRESS="${external_options[1]}" 134 | EXTERNAL_CMAKE="${external_options[2]}" 135 | EXTERNAL_CONFIGURE="${external_options[3]}" 136 | build_external $EXTERNAL 137 | 138 | function build_framework 139 | { ( 140 | # errors fatal 141 | echo "Compiler version:" $(g++ --version) 142 | set -e 143 | 144 | SRC=/kf5 145 | BUILD=/kf5/build 146 | PREFIX=/app/usr/ 147 | 148 | # framework 149 | FRAMEWORK=$1 150 | 151 | # clone if not there 152 | mkdir -p $SRC 153 | cd $SRC 154 | if ( test -d $FRAMEWORK ) 155 | then 156 | echo "$FRAMEWORK already cloned" 157 | cd $FRAMEWORK 158 | git reset --hard 159 | git pull --rebase 160 | cd .. 161 | else 162 | git clone git://anongit.kde.org/$FRAMEWORK 163 | fi 164 | 165 | if [ "$FRAMEWORK" = "knotifications" ]; then 166 | cd $FRAMEWORK 167 | echo "patching knotifications" 168 | git reset --hard 169 | cat > no_phonon.patch << EOF 170 | diff --git a/CMakeLists.txt b/CMakeLists.txt 171 | index b97425f..8f15f08 100644 172 | --- a/CMakeLists.txt 173 | +++ b/CMakeLists.txt 174 | @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) 175 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) 176 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) 177 | 178 | -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) 179 | +find_package(Phonon4Qt5 4.6.60 NO_MODULE) 180 | set_package_properties(Phonon4Qt5 PROPERTIES 181 | DESCRIPTION "Qt-based audio library" 182 | - TYPE REQUIRED 183 | + TYPE OPTIONAL 184 | PURPOSE "Required to build audio notification support") 185 | if (Phonon4Qt5_FOUND) 186 | add_definitions(-DHAVE_PHONON4QT5) 187 | EOF 188 | cat no_phonon.patch |patch -p1 189 | cd .. 190 | fi 191 | 192 | # create build dir 193 | mkdir -p $BUILD/$FRAMEWORK 194 | 195 | # go there 196 | cd $BUILD/$FRAMEWORK 197 | 198 | # cmake it 199 | cmake $SRC/$FRAMEWORK -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 200 | 201 | # make 202 | make -j8 203 | 204 | # install 205 | make install 206 | ) } 207 | 208 | #TO-DO script these extras 209 | build_framework extra-cmake-modules 210 | #Cmake is too old on centos6.... so does this mean no sound for KDE apps? blech. 211 | #build_framework phonon -DPHONON_BUILD_PHONON4QT5=ON 212 | 213 | for FRAMEWORK in karchive kconfig kwidgetsaddons kcompletion kcoreaddons kauth kcodecs kdoctools kguiaddons ki18n kconfigwidgets kwindowsystem kcrash kdbusaddons kitemviews kiconthemes kjobwidgets kservice solid sonnet ktextwidgets attica kglobalaccel kxmlgui kbookmarks kio knotifications kparts kpty; do 214 | build_framework $FRAMEWORK 215 | done 216 | build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 217 | 218 | 219 | 220 | cd .. 221 | 222 | # Build ark 223 | mkdir -p /ark_build 224 | cd /ark_build 225 | cmake ../ark \ 226 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 227 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 228 | -DPACKAGERS_BUILD=1 \ 229 | -DBUILD_TESTING=FALSE 230 | make -j8 install 231 | 232 | ############################################################### 233 | # Build complete, AppImage bundling begins here 234 | ############################################################### 235 | 236 | cd /app 237 | 238 | # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary 239 | mkdir -p ./usr/lib/qt5/plugins/ 240 | 241 | PLUGINS=$(dirname $QTDIR/plugins/bearer) 242 | 243 | cp -r $PLUGINS/{bearer,generic,imageformats,platforms,iconengines,platforminputcontexts,xcbglintegrations} ./usr/lib/qt5/plugins/ 244 | # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ 245 | 246 | cp -ru /usr/share/mime/* /app/usr/share/mime 247 | update-mime-database /app/usr/share/mime/ 248 | 249 | mv ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ 250 | 251 | copy_deps 252 | mv usr/local/Qt-*/lib/* usr/lib 253 | rm -rf usr/local/ 254 | mv lib64/* usr/lib/ 255 | rm -rf lib64/ 256 | # mv ./opt/python3.5/lib/* usr/lib 257 | # mv ./opt/llvm/lib/* usr/lib 258 | rm -rf ./opt/ 259 | rm -rf app/ 260 | 261 | delete_blacklisted 262 | 263 | # We don't bundle the developer stuff 264 | rm -rf usr/include || true 265 | rm -rf usr/lib/cmake || true 266 | rm -rf usr/lib/pkgconfig || true 267 | rm -rf usr/share/ECM/ || true 268 | rm -rf usr/share/gettext || true 269 | rm -rf usr/share/pkgconfig || true 270 | rm -rf rm -rf ./usr/mkspecs/ || true 271 | find . -name '*.a' -exec rm {} \; 272 | 273 | strip -g $(find usr) || true 274 | 275 | mv usr/lib/libexec/kf5/* /app/usr/bin/ 276 | 277 | cd / 278 | if [ ! -d appimage-exec-wrapper ]; then 279 | git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper 280 | fi; 281 | cd /appimage-exec-wrapper/ 282 | make clean 283 | make 284 | 285 | cd /app 286 | cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so 287 | 288 | cat > AppRun << EOF 289 | #!/bin/bash 290 | 291 | DIR="\`dirname \"\$0\"\`" 292 | DIR="\`( cd \"\$DIR\" && pwd )\`" 293 | export APPDIR=\$DIR 294 | 295 | export LD_PRELOAD=\$DIR/exec_wrapper.so 296 | 297 | export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 298 | export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 299 | export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 300 | export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS 301 | export APPIMAGE_ORIGINAL_PATH=\$PATH 302 | 303 | export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH 304 | export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH 305 | export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ 306 | export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS 307 | export PATH=\$DIR/usr/bin:\$PATH 308 | export KDE_FORK_SLAVES=1 309 | 310 | export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 311 | export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 312 | export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 313 | export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS 314 | export APPIMAGE_STARTUP_PATH=\$PATH 315 | 316 | ark \$@ 317 | EOF 318 | chmod +x AppRun 319 | 320 | cp usr/share/applications/org.kde.ark.desktop ark.desktop 321 | cp usr/share/icons/hicolor/128x128/apps/ark.png . 322 | 323 | #TO-DO this will need some text manipulation in ruby to get this var. 324 | APP=Ark 325 | LOWERAPP=ark 326 | 327 | get_desktopintegration ark 328 | 329 | cd / 330 | 331 | # Build AppImageKit 332 | if [ ! -d AppImageKit ] ; then 333 | git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit 334 | fi 335 | 336 | cd /AppImageKit/ 337 | git_pull_rebase_helper 338 | ./build.sh 339 | 340 | cd / 341 | 342 | mkdir -p /$APP/$APP.AppDir 343 | cd /$APP/ 344 | 345 | mv ../app/* $APP.AppDir/ 346 | 347 | VERSION="git" 348 | ARCH=$(arch) 349 | 350 | mkdir -p /out 351 | rm -rf /out/* 352 | #TO-DO this will need some text manipulation in ruby to get this var. 353 | /AppImageKit/AppImageAssistant.AppDir/package Ark.AppDir/ /out/$APP-$VERSION-$ARCH.AppImage 354 | 355 | #Skip this. Cannot get it to work and I would rather the file local for now. 356 | #curl --progress-bar --upload-file - https://transfer.sh/$APP-$VERSION-$ARCH.AppImage /out/$APP-$VERSION-$ARCH.AppImage # Upload to transfer.io for testing 357 | -------------------------------------------------------------------------------- /Recipe.orig: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Based on http://files.svenbrauch.de/kdevelop-linux/kdevelop-recipe-centos6.sh 4 | 5 | # On Amazon AWS start an Amazon Linux instance (I used c4.2xlarge) and run: 6 | # sudo yum -y install docker 7 | # sudo service docker start 8 | # sudo docker run -i -t scummos/centos6.8-qt5.7 9 | # wget -c https://github.com/appimage-packages/kcalc/Recipe 10 | # bash -ex Recipe 11 | 12 | # Halt on errors 13 | set -e 14 | 15 | # Be verbose 16 | set -x 17 | 18 | # Now we are inside CentOS 6 19 | grep -r "CentOS release 6" /etc/redhat-release || exit 1 20 | 21 | # Get helper functions 22 | wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh 23 | . ./functions.sh 24 | rm -f functions.sh 25 | 26 | git_pull_rebase_helper() 27 | { 28 | git reset --hard 29 | git pull --rebase 30 | } 31 | 32 | yum -y install gettext perl-URI.noarch bzip2-devel lzma-devel 33 | 34 | QTVERSION=5.7.0 35 | QVERSION_SHORT=5.7 36 | QTDIR=/usr/local/Qt-${QTVERSION}/ 37 | 38 | # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. That's 39 | # not always set correctly in CentOS 6.7 40 | export LC_ALL=en_US.UTF-8 41 | export LANG=en_us.UTF-8 42 | 43 | # Determine which architecture should be built 44 | if [[ "$(arch)" = "i686" || "$(arch)" = "x86_64" ]] ; then 45 | ARCH=$(arch) 46 | else 47 | echo "Architecture could not be determined" 48 | exit 1 49 | fi 50 | 51 | export PATH=/opt/rh/python27/root/usr/bin/:$PATH 52 | export LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64:$LD_LIBRARY_PATH 53 | 54 | # Make sure we build from the /, parts of this script depends on that. We also need to run as root... 55 | cd / 56 | 57 | # Use the new compiler 58 | . /opt/rh/devtoolset-4/enable 59 | 60 | export CMAKE_PREFIX_PATH=$QTDIR:/app/share/llvm/ 61 | 62 | # if the library path doesn't point to our usr/lib, linking will be broken and we won't find all deps either 63 | export LD_LIBRARY_PATH=/usr/lib64/:/usr/lib:/app/usr/lib:$QTDIR/lib/:/opt/python3.5/lib/:$LD_LIBRARY_PATH 64 | 65 | # Workaround for: On CentOS 6, .pc files in /usr/lib/pkgconfig are not recognized 66 | # However, this is where .pc files get installed when bulding libraries... (FIXME) 67 | # I found this by comparing the output of librevenge's "make install" command 68 | # between Ubuntu and CentOS 6 69 | ln -sf /usr/share/pkgconfig /usr/lib/pkgconfig 70 | 71 | # Get ark 72 | if [ ! -d /ark ] ; then 73 | git clone --depth 1 http://anongit.kde.org/ark.git /ark 74 | fi 75 | cd /ark/ 76 | git_pull_rebase_helper 77 | 78 | # Prepare the install location 79 | rm -rf /app/ || true 80 | mkdir -p /app/usr 81 | 82 | # export LLVM_ROOT=/opt/llvm/ 83 | 84 | # make sure lib and lib64 are the same thing 85 | mkdir -p /app/usr/lib 86 | cd /app/usr 87 | ln -s lib lib64 88 | 89 | # start building the deps 90 | 91 | function build_framework 92 | { ( 93 | # errors fatal 94 | echo "Compiler version:" $(g++ --version) 95 | set -e 96 | 97 | SRC=/kf5 98 | BUILD=/kf5/build 99 | PREFIX=/app/usr/ 100 | 101 | # framework 102 | FRAMEWORK=$1 103 | 104 | # clone if not there 105 | mkdir -p $SRC 106 | cd $SRC 107 | if ( test -d $FRAMEWORK ) 108 | then 109 | echo "$FRAMEWORK already cloned" 110 | cd $FRAMEWORK 111 | git reset --hard 112 | git pull --rebase 113 | cd .. 114 | else 115 | git clone git://anongit.kde.org/$FRAMEWORK 116 | fi 117 | 118 | 119 | if [ "$FRAMEWORK" = "knotifications" ]; then 120 | cd $FRAMEWORK 121 | echo "patching knotifications" 122 | git reset --hard 123 | cat > no_phonon.patch << EOF 124 | diff --git a/CMakeLists.txt b/CMakeLists.txt 125 | index b97425f..8f15f08 100644 126 | --- a/CMakeLists.txt 127 | +++ b/CMakeLists.txt 128 | @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) 129 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) 130 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) 131 | 132 | -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) 133 | +find_package(Phonon4Qt5 4.6.60 NO_MODULE) 134 | set_package_properties(Phonon4Qt5 PROPERTIES 135 | DESCRIPTION "Qt-based audio library" 136 | - TYPE REQUIRED 137 | + TYPE OPTIONAL 138 | PURPOSE "Required to build audio notification support") 139 | if (Phonon4Qt5_FOUND) 140 | add_definitions(-DHAVE_PHONON4QT5) 141 | EOF 142 | cat no_phonon.patch |patch -p1 143 | cd .. 144 | fi 145 | 146 | # create build dir 147 | mkdir -p $BUILD/$FRAMEWORK 148 | 149 | # go there 150 | cd $BUILD/$FRAMEWORK 151 | 152 | # cmake it 153 | cmake $SRC/$FRAMEWORK -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 154 | 155 | # make 156 | make -j8 157 | 158 | # install 159 | make install 160 | ) } 161 | 162 | build_framework breeze-icons -DPHONON_BUILD_PHONON4QT5=ON 163 | for FRAMEWORK in extra-cmake-modules karchive kconfig kwidgetsaddons kcompletion kcoreaddons kauth kcodecs kdoctools kguiaddons ki18n kconfigwidgets kwindowsystem kcrash kdbusaddons kitemviews kiconthemes kjobwidgets kservice solid sonnet ktextwidgets attica kglobalaccel kxmlgui kbookmarks kio knotifications kparts kpty kwayland; do 164 | build_framework $FRAMEWORK 165 | done 166 | build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 167 | 168 | 169 | 170 | cd .. 171 | 172 | # Build ark 173 | mkdir -p /ark_build 174 | cd /ark_build 175 | cmake ../ark \ 176 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 177 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 178 | -DPACKAGERS_BUILD=1 \ 179 | -DBUILD_TESTING=FALSE 180 | make -j8 install 181 | 182 | ############################################################### 183 | # Build complete, AppImage bundling begins here 184 | ############################################################### 185 | 186 | cd /app 187 | 188 | # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary 189 | mkdir -p ./usr/lib/qt5/plugins/ 190 | 191 | PLUGINS=$(dirname $QTDIR/plugins/bearer) 192 | 193 | cp -r $PLUGINS/{bearer,generic,imageformats,platforms,iconengines,platforminputcontexts,xcbglintegrations} ./usr/lib/qt5/plugins/ 194 | # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ 195 | 196 | cp -ru /usr/share/mime/* /app/usr/share/mime 197 | update-mime-database /app/usr/share/mime/ 198 | 199 | mv ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ 200 | 201 | copy_deps 202 | mv usr/local/Qt-*/lib/* usr/lib 203 | rm -rf usr/local/ 204 | mv lib64/* usr/lib/ 205 | rm -rf lib64/ 206 | # mv ./opt/python3.5/lib/* usr/lib 207 | # mv ./opt/llvm/lib/* usr/lib 208 | rm -rf ./opt/ 209 | rm -rf app/ 210 | 211 | delete_blacklisted 212 | 213 | # We don't bundle the developer stuff 214 | rm -rf usr/include || true 215 | rm -rf usr/lib/cmake || true 216 | rm -rf usr/lib/pkgconfig || true 217 | rm -rf usr/share/ECM/ || true 218 | rm -rf usr/share/gettext || true 219 | rm -rf usr/share/pkgconfig || true 220 | rm -rf rm -rf ./usr/mkspecs/ || true 221 | find . -name '*.a' -exec rm {} \; 222 | 223 | strip -g $(find usr) || true 224 | 225 | mv usr/lib/libexec/kf5/* /app/usr/bin/ 226 | 227 | cd / 228 | if [ ! -d appimage-exec-wrapper ]; then 229 | git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper 230 | fi; 231 | cd /appimage-exec-wrapper/ 232 | make clean 233 | make 234 | 235 | cd /app 236 | cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so 237 | 238 | cat > AppRun << EOF 239 | #!/bin/bash 240 | 241 | DIR="\`dirname \"\$0\"\`" 242 | DIR="\`( cd \"\$DIR\" && pwd )\`" 243 | export APPDIR=\$DIR 244 | 245 | export LD_PRELOAD=\$DIR/exec_wrapper.so 246 | 247 | export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 248 | export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 249 | export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 250 | export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS 251 | export APPIMAGE_ORIGINAL_PATH=\$PATH 252 | 253 | export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH 254 | export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH 255 | export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ 256 | export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS 257 | export PATH=\$DIR/usr/bin:\$PATH 258 | export KDE_FORK_SLAVES=1 259 | 260 | export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 261 | export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 262 | export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 263 | export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS 264 | export APPIMAGE_STARTUP_PATH=\$PATH 265 | 266 | ark \$@ 267 | EOF 268 | chmod +x AppRun 269 | 270 | cp ./usr/share/applications/org.kde.ark.desktop ark.desktop 271 | cp usr/share/icons/hicolor/256x256/apps/ark.png . 272 | 273 | # What is this and why wasn't it installed automatically? 274 | # mkdir -p usr/share/kdevelop/ 275 | # cp /kf5/build/breeze-icons/icons/breeze-icons.rcc usr/share/kdevelop/icontheme.rcc 276 | 277 | # rm -Rf usr/share/icons # not needed because of the rcc 278 | # rm -f /appusr/bin/llvm* 279 | # rm -f usr/bin/clang* 280 | # rm -f usr/bin/opt 281 | # rm -f usr/bin/lli 282 | # rm -f usr/bin/sancov 283 | # rm -f usr/bin/cmake 284 | # rm -f usr/bin/python 285 | # rm -Rf usr/lib/pkgconfig 286 | # rm -Rf usr/share/man 287 | # rm -Rf usr/lib/python3.5/test 288 | # rm -Rf usr/lib/python3.5/__pycache__ 289 | # rm -Rf usr/lib/libLTO.so 290 | # rm -f /app/usr/bin/llc 291 | # rm -f /app/usr/bin/bugpoint 292 | 293 | # rm -Rf usr/lib/libxcb* # Don't do this, because then it will no longer run on Arch 294 | 295 | # add that back in 296 | # cp /usr/lib64/libxcb-keysyms.so.1 usr/lib/ 297 | 298 | # TODO: Can we be sure about that? If yes, inform probono in order to add to the global blacklist 299 | # rm -Rf /app/usr/lib/{libX11.so.6,libXau.so.6,libXext.so.6,libXi.so.6,libXxf86vm.so.1,libX11-xcb.so.1,libXdamage.so.1,libXfixes.so.3,libXrender.so.1} 300 | 301 | APP=Ark 302 | LOWERAPP=ark 303 | 304 | get_desktopintegration ark 305 | 306 | cd / 307 | 308 | # Build AppImageKit 309 | if [ ! -d AppImageKit ] ; then 310 | git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit 311 | fi 312 | 313 | cd /AppImageKit/ 314 | git_pull_rebase_helper 315 | ./build.sh 316 | 317 | cd / 318 | 319 | mkdir -p /$APP/$APP.AppDir 320 | cd /$APP/ 321 | 322 | mv ../app/* $APP.AppDir/ 323 | 324 | VERSION="git" 325 | ARCH=$(arch) 326 | 327 | mkdir -p /out 328 | rm -rf /out/* 329 | /AppImageKit/AppImageAssistant.AppDir/package KDevelop.AppDir/ /out/$APP-$VERSION-$ARCH.AppImage 330 | 331 | curl --progress-bar --upload-file - https://transfer.sh/$APP-$VERSION-$ARCH.AppImage /out/$APP-$VERSION-$ARCH.AppImage # Upload to transfer.io for testing 332 | 333 | # Try to power down Amazon AWS (no guarantees; need to check for yourself!) 334 | #grep -r compute.internal /etc/resolv.conf && halt 335 | 336 | # Test the resulting AppImage on my local system 337 | # sudo /tmp/*/union/AppImageKit/AppImageAssistant.AppDir/testappimage /isodevice/boot/iso/Fedora-Live-Workstation-x86_64-22-3.iso /tmp/*/union/Scribus.AppDir/ 338 | 339 | # Could not load plugin "KDevCMakeDocumentation" , it reported the error: "cmake is not installed" Disabling the plugin now. 340 | # QSqlDatabase: QSQLITE driver not loaded 341 | # QSqlDatabase: available drivers: 342 | # Couldn't setup QtHelp Collection file 343 | # qrc:/qml/main.qml:21:1: module "QtQuick" is not installed 344 | # welcomepage errors: (qrc:/qml/main.qml:21:1: module "QtQuick" is not installed) 345 | # trying to load "/tmp/.mount_YPZnl1/usr/lib/qt5/plugins/kf5/kio/file.so" from "/tmp/.mount_YPZnl1/usr/lib/qt5/plugins/kf5/kio/file.so" 346 | # called 347 | # updating problem highlight 348 | --------------------------------------------------------------------------------