├── README.md ├── dependencies.erb ├── Functions.erb ├── functions.rb ├── deploy.rb ├── generate_recipe.rb ├── cmake-dependencies.py ├── gatherdeps.rb ├── frameworks.yaml ├── Recipe.erb └── Recipe /README.md: -------------------------------------------------------------------------------- 1 | # blinken 2 | appimage for blinken 3 | -------------------------------------------------------------------------------- /dependencies.erb: -------------------------------------------------------------------------------- 1 | external_build: 2 | <% external.each do |external| %> 3 | <%= external.to_yaml.sub('---', '-').gsub("\n", '').sub("...", '').gsub("\n", '')%> 4 | <% end %> 5 | distro_packages: 6 | <% distro_packages.each do |distro_packages| %> 7 | <%= distro_packages.to_yaml.sub('---', '-').gsub("\n", '').sub("...", '').gsub("\n", '')%> 8 | <% end %> 9 | kf5_deps: 10 | <% kf5_deps.each do |kf5_deps| %> 11 | <%= kf5_deps.to_yaml.sub('---', '-').gsub("\n", '').sub("...", '').gsub("\n", '')%> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /Functions.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | function build_cmake 5 | { ( 6 | # errors fatal 7 | echo "Compiler version:" $(g++ --version) 8 | set -e 9 | 10 | SRC=/cmake 11 | PREFIX=/app/usr/ 12 | 13 | # framework 14 | CMAKE=$1 15 | 16 | # clone if not there 17 | mkdir -p $SRC 18 | cd $SRC 19 | if ( test -d $CMAKE ) 20 | then 21 | echo "$CMAKE already cloned" 22 | cd $CMAKE 23 | git reset --hard 24 | git pull --rebase 25 | cd .. 26 | else 27 | git clone https://github.com/Kitware/CMake 28 | fi 29 | 30 | 31 | cd CMake 32 | 33 | ./bootstrap 34 | 35 | # make 36 | make -j8 37 | 38 | # install 39 | make install 40 | 41 | ) } 42 | if ( <%= cmake %> == true ) 43 | then 44 | build_cmake cmake 45 | fi 46 | -------------------------------------------------------------------------------- /functions.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | # 4 | # Copyright (C) 2016 Scarlett Clark 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) version 3, or any 10 | # later version accepted by the membership of KDE e.V. (or its 11 | # successor approved by the membership of KDE e.V.), which shall 12 | # act as a proxy defined in Section 6 of version 3 of the license. 13 | # 14 | # This library is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # Lesser General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU Lesser General Public 20 | # License along with this library. If not, see . 21 | 22 | class Functions 23 | attr_accessor :cmake 24 | attr_accessor :wayland 25 | attr_accessor :boost 26 | end 27 | -------------------------------------------------------------------------------- /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 'builddocker.rb' 24 | 25 | builder = CI.new 26 | builder.run = [CI::Build.new('blinken')] 27 | builder.cmd = %w[/usr/bin/ruby /in/gatherdeps.rb] 28 | builder.create_neon_container 29 | # builder.cmd = %w[bash -ex /in/Recipe] 30 | # builder.create_centos_container 31 | -------------------------------------------------------------------------------- /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 | require 'yaml' 24 | 25 | class Recipe 26 | class App 27 | def initialize(name) 28 | @name = name 29 | end 30 | end 31 | attr_accessor :name 32 | attr_accessor :version 33 | attr_accessor :frameworks 34 | attr_accessor :packages 35 | attr_accessor :external 36 | attr_accessor :proper_name 37 | attr_accessor :version 38 | attr_accessor :summary 39 | attr_accessor :description 40 | attr_accessor :cmake 41 | attr_accessor :wayland 42 | attr_accessor :boost 43 | attr_accessor :app 44 | 45 | def render 46 | ERB.new(File.read('Recipe.erb')).result(binding) 47 | end 48 | 49 | 50 | end 51 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_relative 'generate_recipe.rb' 25 | require 'fileutils' 26 | require 'yaml' 27 | 28 | 29 | class Dependencies 30 | 31 | attr_accessor :packages 32 | attr_accessor :frameworks 33 | attr_accessor :external 34 | attr_accessor :review_deps 35 | 36 | class CMakeDeps 37 | def initialize(name) 38 | @name = name 39 | @base_dir = Dir.pwd() + '/' 40 | @kf5_map = YAML.load_file('frameworks.yaml') 41 | @cmake_deps = run_cmakedependencies 42 | @kf5 = [] 43 | @external = [] 44 | @packages = [] 45 | end 46 | 47 | def run_cmakedependencies 48 | all = [] 49 | # Get deps 50 | `apt-get -y build-dep #{@name}` 51 | #Run the cmake-dependencies.py tool from kde-dev-tools 52 | 53 | FileUtils.cp('cmake-dependencies.py', @base_dir + @name) 54 | Dir.chdir(@base_dir + @name) do 55 | `cmake -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=FALSE` 56 | system('pwd') 57 | system('ls -l') 58 | system("make -j8") 59 | all = `python3 cmake-dependencies.py | grep '\"project\": '`.sub('\\', '').split(',') 60 | end 61 | all 62 | end 63 | 64 | def parse_section(section, dep, a) 65 | h = @kf5_map[dep] 66 | unless h[section].nil? 67 | h[section] 68 | if ( section == "distro_packages" ) 69 | a |= h[section] 70 | else ( a.include? dep ) 71 | a.delete dep 72 | a |= h[section] 73 | a.push dep 74 | end 75 | end 76 | a 77 | end 78 | 79 | def get_kf5 80 | oddballs = [] 81 | kf5_base = [] 82 | all_deps = get_cmakedeps 83 | all_deps.each do |name| 84 | if ( name == "ecm" ) 85 | name = "extra-cmake-modules" 86 | kf5_base.push name 87 | end 88 | if ( name == "phonon4qt5experimental" || name == "phonon4qt5") 89 | name = "phonon" 90 | kf5_base.push name 91 | end 92 | if ( name =~ /kf5/) 93 | oddballs = ["ksolid","kthreadweaver","ksonnet","kattica"] 94 | name = name.sub("kf5", "k") 95 | oddballs.each do |oddball| 96 | if ( name == oddball) 97 | name = name.sub("k", '') 98 | end 99 | end 100 | kf5_base.push name 101 | end 102 | end 103 | kf5_base.delete 'k' 104 | kf5_base.sort! 105 | kf5_base.each do |dep| 106 | @kf5 |= parse_section("kf5_deps", dep, @kf5) 107 | end 108 | @kf5 109 | end 110 | 111 | def get_packages(kf5_deps) 112 | kf5_deps.each do |dep| 113 | @packages |= parse_section("distro_packages", dep, @packages) 114 | end 115 | @packages 116 | end 117 | 118 | def get_external(kf5_deps) 119 | kf5_deps.each do |dep| 120 | @external |= parse_section("external", dep, @external) 121 | end 122 | @external 123 | end 124 | 125 | def get_cmakedeps 126 | all_deps = [] 127 | @cmake_deps.each do |dep| 128 | parts = dep.sub('{', '').sub('}', '').split(',') 129 | parts.each do |project| 130 | a = project.split.each_slice(3).map{ |x| x.join(' ')}.to_s 131 | if a.to_s.include? "project" 132 | name = a.gsub((/[^0-9a-z ]/i), '').downcase 133 | name.slice! "project " 134 | all_deps.push name 135 | end 136 | end 137 | end 138 | all_deps 139 | end 140 | 141 | def get_deps_intervention_required 142 | non_kf5 = [] 143 | all_deps = get_cmakedeps 144 | all_deps.each do |name| 145 | non_kf5.push name 146 | if ( name =~ /qt5/ || name =~ /kf5/ || name =~ /ecm/ || name == 'packagehandlestandardargs' ) 147 | non_kf5.delete name 148 | end 149 | end 150 | puts non_kf5 151 | non_kf5 152 | end 153 | 154 | end 155 | end 156 | 157 | 158 | app_name = 'blinken' 159 | version = '' 160 | 161 | 162 | deps = Dependencies.new 163 | cmake_deps = Dependencies::CMakeDeps.new(app_name) 164 | 165 | #Retrieve all the framework dependencies with cmake-dependencies.py ( tool from kde-dev-tools) 166 | #Then it is searched in the frameworks.yaml for dependencies of dependencies. This list needs to be 167 | #maintained as dependencies change. TO-DO research a way to automate that? 168 | #Return as a string so it is usable in the Recipe.erb 169 | deps.frameworks = cmake_deps.get_kf5.join(' ').to_s 170 | # From the above frameworks list we now want to gete any package dependencies needed. 171 | deps.packages = cmake_deps.get_packages(cmake_deps.get_kf5).join(' ').to_s 172 | # Finally we need a list of dependencies that will need to be built from source ( aka centos package is too old. 173 | deps.external = cmake_deps.get_external(cmake_deps.get_kf5) 174 | # These deps are generated with the cmae tool but there is no sane way to get package names or determine automically 175 | # if they need to be source builds... So we can print them and then place them in the appropriate dependency group. 176 | deps.review_deps = cmake_deps.get_deps_intervention_required 177 | p '====== NEEDS REVIEW ======' 178 | puts deps.review_deps 179 | 180 | p '====== FRAMEWORKS DEPS ======' 181 | puts deps.frameworks 182 | p '====== DISTRIBUTION PACKAGES ======' 183 | #Add any packages from review then print 184 | deps.packages = deps.packages + ' gettext python33' 185 | puts deps.packages 186 | p '====== NEEDS SOURCE BUILDS ======' 187 | puts deps.external 188 | 189 | #Cleanup 190 | #FileUtils.remove_dir(app_name) 191 | 192 | #Generate the Recipe file 193 | recipe = Recipe.new 194 | recipe.name = app_name 195 | recipe.version = version 196 | recipe.proper_name = app_name.capitalize 197 | recipe.frameworks = deps.frameworks 198 | recipe.packages = deps.packages 199 | recipe.external = deps.external 200 | recipe.cmake = true 201 | recipe.wayland = false 202 | recipe.boost = false 203 | recipe.app = [Recipe::App.new(app_name)] 204 | File.write('Recipe', recipe.render) 205 | -------------------------------------------------------------------------------- /frameworks.yaml: -------------------------------------------------------------------------------- 1 | extra-cmake-modules: 2 | external: 3 | distro_packages: 4 | kf5_deps: 5 | kcoreaddons: 6 | external: 7 | distro_packages: 8 | - gamin-devel 9 | kf5_deps: 10 | - extra-cmake-modules 11 | attica: 12 | external: 13 | distro_packages: 14 | kf5_deps: 15 | - extra-cmake-modules 16 | dbusaddons: 17 | external: 18 | distro_packages: 19 | kf5_deps: 20 | - extra-cmake-modules 21 | kdnssd: 22 | external: 23 | distro_packages: 24 | - libavahi-common-devel 25 | kf5_deps: 26 | - extra-cmake-modules 27 | phonon: 28 | external: 29 | distro_packages: 30 | kf5_deps: 31 | - extra-cmake-modules 32 | karchive: 33 | external: 34 | - cmake 35 | - libarchive 36 | - "https://github.com/libarchive/libarchive" 37 | - true 38 | - "" 39 | distro_packages: 40 | - bzip2-devel 41 | - xz-devel 42 | - media-player-info.noarch 43 | kf5_deps: 44 | - extra-cmake-modules 45 | kconfig: 46 | external: 47 | distro_packages: 48 | kf5_deps: 49 | - extra-cmake-modules 50 | breeze-icons: 51 | external: 52 | distro_packages: 53 | kf5_deps: 54 | - extra-cmake-modules 55 | kcodecs: 56 | external: 57 | distro_packages: 58 | kf5_deps: 59 | - extra-cmake-modules 60 | kguiaddons: 61 | external: 62 | distro_packages: 63 | kf5_deps: 64 | - extra-cmake-modules 65 | ki18n: 66 | external: 67 | distro_packages: 68 | kf5_deps: 69 | - extra-cmake-modules 70 | kitemmodels: 71 | external: 72 | distro_packages: 73 | kf5_deps: 74 | - extra-cmake-modules 75 | kitemviews: 76 | external: 77 | distro_packages: 78 | kf5_deps: 79 | - extra-cmake-modules 80 | kwidgetsaddons: 81 | external: 82 | distro_packages: 83 | kf5_deps: 84 | - extra-cmake-modules 85 | oxygen-icons5: 86 | external: 87 | distro_packages: 88 | kf5_deps: 89 | - extra-cmake-modules 90 | sonnet: 91 | external: 92 | distro_packages: 93 | kf5_deps: 94 | - extra-cmake-modules 95 | solid: 96 | external: 97 | distro_packages: 98 | kf5_deps: 99 | - extra-cmake-modules 100 | threadweaver: 101 | external: 102 | distro_packages: 103 | kf5_deps: 104 | - extra-cmake-modules 105 | kactivities: 106 | external: 107 | distro_packages: 108 | kf5_deps: 109 | - extra-cmake-modules 110 | kauth: 111 | external: 112 | distro_packages: 113 | kf5_deps: 114 | - extra-cmake-modules 115 | - kcoreaddons 116 | kcompletion: 117 | external: 118 | distro_packages: 119 | kf5_deps: 120 | - extra-cmake-modules 121 | - kconfig 122 | - kwidgetsaddons 123 | kcrash: 124 | external: 125 | distro_packages: 126 | kf5_deps: 127 | - extra-cmake-modules 128 | - kwindowsystem 129 | kdoctools: 130 | external: 131 | distro_packages: 132 | kf5_deps: 133 | - extra-cmake-modules 134 | kjobwidgets: 135 | external: 136 | distro_packages: 137 | kf5_deps: 138 | - extra-cmake-modules 139 | knotifications: 140 | external: 141 | distro_packages: 142 | kf5_deps: 143 | - phonon 144 | - extra-cmake-modules 145 | kpty: 146 | external: 147 | distro_packages: 148 | - libutempter-devel 149 | kf5_deps: 150 | - extra-cmake-modules 151 | - kcoreaddons 152 | - ki18n 153 | kunitconversion: 154 | external: 155 | distro_packages: 156 | - libutempter-devel 157 | kf5_deps: 158 | - extra-cmake-modules 159 | - ki18n 160 | kded: 161 | external: 162 | distro_packages: 163 | kf5_deps: 164 | - extra-cmake-modules 165 | - kconfig 166 | - kcoreaddons 167 | - kcrash 168 | - kdbusaddons 169 | - kdoctools 170 | - kinit 171 | - kservice 172 | - ki18n 173 | kplotting: 174 | external: 175 | distro_packages: 176 | kf5_deps: 177 | - extra-cmake-modules 178 | kdbusaddons: 179 | external: 180 | distro_packages: 181 | kf5_deps: 182 | - extra-cmake-modules 183 | kdewebkit: 184 | external: 185 | distro_packages: 186 | kf5_deps: 187 | - extra-cmake-modules 188 | - kconfig 189 | - kcoreaddons 190 | - kio 191 | - kjobwidgets 192 | - kparts 193 | - kservice 194 | - kwallet 195 | kpackage: 196 | external: 197 | distro_packages: 198 | kf5_deps: 199 | - extra-cmake-modules 200 | - kdoctools 201 | - karchive 202 | - kconfig 203 | - kcoreaddons 204 | - ki18n 205 | kcmutils: 206 | external: 207 | distro_packages: 208 | kf5_deps: 209 | - extra-cmake-modules 210 | kbookmarks: 211 | external: 212 | distro_packages: 213 | kf5_deps: 214 | - extra-cmake-modules 215 | - kcodecs 216 | - kconfig 217 | - kcoreaddons 218 | - kconfigwidgets 219 | - kiconthemes 220 | - kwidgetsaddons 221 | - kxmlgui 222 | kconfigwidgets: 223 | external: 224 | distro_packages: 225 | kf5_deps: 226 | - extra-cmake-modules 227 | - kauth 228 | - kcoreaddons 229 | - kcodecs 230 | - kconfig 231 | - kdoctools 232 | - kguiaddons 233 | - ki18n 234 | - kwidgetsaddons 235 | kdeclarative: 236 | external: 237 | distro_packages: 238 | - libepoxy-devel 239 | kf5_deps: 240 | - extra-cmake-modules 241 | - kconfig 242 | - ki18n 243 | - kiconthemes 244 | - kio 245 | - kpackage 246 | kdesignerplugin: 247 | external: 248 | distro_packages: 249 | kf5_deps: 250 | - extra-cmake-modules 251 | - kcoreaddons 252 | - kconfig 253 | - kdewebkit 254 | - kdoctools 255 | - kcompletion 256 | - kconfigwidgets 257 | - kiconthemes 258 | - kio 259 | - kitemviews 260 | - ktextwidgets 261 | - kwidgetsaddons 262 | - kxmlgui 263 | - sonnet 264 | kglobalaccel: 265 | external: 266 | distro_packages: 267 | - libxcb1-devel 268 | - libxcb-keysyms1-devel 269 | - libxcb-xtest0-devel 270 | kf5_deps: 271 | - extra-cmake-modules 272 | - kconfig 273 | - kcoreaddons 274 | - kcrash 275 | - kdbusaddons 276 | - kwindowsystem 277 | kiconthemes: 278 | external: 279 | distro_packages: 280 | kf5_deps: 281 | - extra-cmake-modules 282 | - ki18n 283 | - kconfigwidgets 284 | - kwidgetsaddons 285 | - kitemviews 286 | kinit: 287 | external: 288 | distro_packages: 289 | - libx11-xcb-devel 290 | - libcap-devel 291 | kf5_deps: 292 | - extra-cmake-modules 293 | - kservice 294 | - kio 295 | - ki18n 296 | - kwindowsystem 297 | - kcrash 298 | - kconfig 299 | - kdoctools 300 | kio: 301 | external: 302 | distro_packages: 303 | - libacl1-devel 304 | - libkrb5-devel 305 | - libxml2-devel 306 | - libxslt1-devel 307 | - zlib1g-devel 308 | kf5_deps: 309 | - karchive 310 | - kbookmarks 311 | - kcompletion 312 | - kconfig 313 | - kconfigwidgets 314 | - kcoreaddons 315 | - kdbusaddons 316 | - kdoctools 317 | - ki18n 318 | - kiconthemes 319 | - kitemviews 320 | - kjobwidgets 321 | - kservice 322 | - solid 323 | - kwidgetsaddons 324 | - kwindowsystem 325 | knewstuff: 326 | external: 327 | distro_packages: 328 | kf5_deps: 329 | - extra-cmake-modules 330 | - attica 331 | - karchive 332 | - kcompletion 333 | - kconfig 334 | - kcoreaddons 335 | - ki18n 336 | - kiconthemes 337 | - kio 338 | - kitemviews 339 | - kservice 340 | - ktextwidgets 341 | - kwidgetsaddons 342 | - kxmlgui 343 | knotifyconfig: 344 | external: 345 | distro_packages: 346 | kf5_deps: 347 | - extra-cmake-modules 348 | - kcompletion 349 | - kconfig 350 | - ki18n 351 | - kio 352 | - phonon 353 | kparts: 354 | external: 355 | distro_packages: 356 | kf5_deps: 357 | - extra-cmake-modules 358 | - kconfig 359 | - kcoreaddons 360 | - ki18n 361 | - kiconthemes 362 | - kio 363 | - kjobwidgets 364 | - kservice 365 | - ktextwidgets 366 | - kwidgetsaddons 367 | - kxmlgui 368 | kservice: 369 | external: 370 | distro_packages: 371 | kf5_deps: 372 | - extra-cmake-modules 373 | - kconfig 374 | - kcoreaddons 375 | - kcrash 376 | - kdbusaddons 377 | - kdoctools 378 | - ki18n 379 | ktexteditor: 380 | external: 381 | distro_packages: 382 | - libgit2-devel 383 | kf5_deps: 384 | - extra-cmake-modules 385 | - karchive 386 | - kconfig 387 | - kguiaddons 388 | - ki18n 389 | - kiconthemes 390 | - kio 391 | - kparts 392 | - sonnet 393 | ktextwidgets: 394 | external: 395 | distro_packages: 396 | kf5_deps: 397 | - extra-cmake-modules 398 | - kcompletion 399 | - kconfig 400 | - kconfigwidgets 401 | - ki18n 402 | - kiconthemes 403 | - kservice 404 | - kwidgetsaddons 405 | - kwindowsystem 406 | - sonnet 407 | kwallet: 408 | external: 409 | distro_packages: 410 | kf5_deps: 411 | - extra-cmake-modules 412 | - kcoreaddons 413 | - kconfig 414 | - kwindowsystem 415 | - ki18n 416 | - kdoctools 417 | kxmlgui: 418 | external: 419 | distro_packages: 420 | kf5_deps: 421 | - attica 422 | - extra-cmake-modules 423 | - kcoreaddons 424 | - kconfig 425 | - kconfigwidgets 426 | - kglobalaccel 427 | - kitemviews 428 | - ki18n 429 | - kiconthemes 430 | - ktextwidgets 431 | - kwidgetsaddons 432 | - kwindowsystem 433 | kwindowsystem: 434 | external: 435 | distro_packages: 436 | - libxcb-keysyms1-devel 437 | kf5_deps: 438 | - extra-cmake-modules 439 | kdelibs4support: 440 | external: 441 | distro_packages: 442 | kf5_deps: 443 | - extra-cmake-modules 444 | - kcompletion 445 | - kconfig 446 | - kconfigwidgets 447 | - kcrash 448 | - kdbusaddons 449 | - kded 450 | - kdesignerplugin 451 | - kdoctools 452 | - kglobalaccel 453 | - kguiaddons 454 | - ki18n 455 | - kiconthemes 456 | - kio 457 | - knotifications 458 | - kparts 459 | - kservice 460 | - ktextwidgets 461 | - kunitconversion 462 | - kwidgetsaddons 463 | - kwindowsystem 464 | - kxmlgui 465 | kjs: 466 | external: 467 | distro_packages: 468 | - libperl-devel 469 | - libpcre3-devel 470 | kf5_deps: 471 | - extra-cmake-modules 472 | khtml: 473 | external: 474 | distro_packages: 475 | - libperl-devel 476 | - libjpeg-devel 477 | - libgif-devel 478 | - libpng12-devel 479 | kf5_deps: 480 | - extra-cmake-modules 481 | - karchive 482 | - kcodecs 483 | - kglobalaccel 484 | - ki18n 485 | - kiconthemes 486 | - kio 487 | - kjs 488 | - knotifications 489 | - kparts 490 | - ktextwidgets 491 | - kwallet 492 | - kwidgetsaddons 493 | - kwindowsystem 494 | - kxmlgui 495 | - sonnet 496 | -------------------------------------------------------------------------------- /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 <%= packages %> 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 | function build_cmake 83 | { ( 84 | # errors fatal 85 | echo "Compiler version:" $(g++ --version) 86 | set -e 87 | 88 | SRC=/cmake 89 | PREFIX=/app/usr/ 90 | 91 | # framework 92 | CMAKE=$1 93 | 94 | # clone if not there 95 | mkdir -p $SRC 96 | cd $SRC 97 | if ( test -d $CMAKE ) 98 | then 99 | echo "$CMAKE already cloned" 100 | cd $CMAKE 101 | git reset --hard 102 | git pull --rebase 103 | cd .. 104 | else 105 | git clone https://github.com/Kitware/CMake 106 | fi 107 | 108 | 109 | cd CMake 110 | 111 | ./bootstrap 112 | 113 | # make 114 | make -j8 115 | 116 | # install 117 | make install 118 | 119 | ) } 120 | if ( <%= cmake %> == true ) 121 | then 122 | build_cmake cmake 123 | fi 124 | 125 | 126 | function build_wayland 127 | { ( 128 | # errors fatal 129 | echo "Compiler version:" $(g++ --version) 130 | set -e 131 | 132 | SRC=/wayland 133 | 134 | WAYLAND=$1 135 | # clone if not there 136 | mkdir -p $SRC 137 | cd $SRC 138 | 139 | export WLD=/app/usr/ # change this to another location if you prefer 140 | export LD_LIBRARY_PATH=$WLD/lib 141 | export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/ 142 | export PATH=$WLD/bin:$PATH 143 | export ACLOCAL_PATH=$WLD/share/aclocal 144 | export ACLOCAL="aclocal -I $ACLOCAL_PATH" 145 | 146 | mkdir -p $WLD/share/aclocal # needed by autotools 147 | 148 | #autoconf is too old on centos6 149 | wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz 150 | tar xvfvz autoconf-2.69.tar.gz 151 | cd autoconf-2.69 152 | ./configure --prefix=$WLD 153 | make -j8 154 | make install 155 | #wayland 156 | git clone git://anongit.freedesktop.org/wayland/$WAYLAND 157 | cd $WAYLAND 158 | ./autogen.sh --prefix=$WLD 159 | make -j8 160 | make install 161 | cd .. 162 | ) } 163 | if ( <%= wayland %> == true ) 164 | then 165 | build_wayland wayland 166 | fi 167 | 168 | function build_boost 169 | { ( 170 | # errors fatal 171 | echo "Compiler version:" $(g++ --version) 172 | set -e 173 | 174 | SRC=/boost 175 | 176 | BOOST=$1 177 | # clone if not there 178 | mkdir -p $SRC 179 | cd $SRC 180 | 181 | wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2 182 | tar --bzip2 -xf boost_1_61_0.tar.bz2 183 | cd boost_1_61_0 184 | ./bootstrap.sh --prefix=/app/usr 185 | ./b2 install 186 | ) } 187 | if ( <%= boost %> == true ) 188 | then 189 | build_boost boost 190 | fi 191 | 192 | function build_external 193 | { ( 194 | # errors fatal 195 | echo "Compiler version:" $(g++ --version) 196 | set -e 197 | 198 | SRC=/external 199 | BUILD=/external/build 200 | PREFIX=/app/usr/ 201 | 202 | # framework 203 | EXTERNAL=$1 204 | 205 | # clone if not there 206 | mkdir -p $SRC 207 | cd $SRC 208 | if ( test -d $EXTERNAL ) 209 | then 210 | echo "$EXTERNAL already cloned" 211 | cd $EXTERNAL 212 | git reset --hard 213 | git pull --rebase 214 | cd .. 215 | else 216 | git clone $EXTERNAL_ADDRESS 217 | fi 218 | 219 | # create build dir 220 | mkdir -p $BUILD/$EXTERNAL 221 | 222 | # go there 223 | cd $BUILD/$EXTERNAL 224 | 225 | # cmake it 226 | if ( $EXTERNAL_CMAKE ) 227 | then 228 | cmake $SRC/$EXTERNAL -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 229 | else 230 | $EXTERNAL_CONFIGURE 231 | fi 232 | # make 233 | make -j8 234 | 235 | # install 236 | make install 237 | ) } 238 | 239 | IN=<%= external %> 240 | IFS=',' read -a external_options <<< $IN 241 | EXTERNAL="${external_options[0]}" 242 | EXTERNAL_ADDRESS="${external_options[1]}" 243 | EXTERNAL_CMAKE="${external_options[2]}" 244 | EXTERNAL_CONFIGURE="${external_options[3]}" 245 | build_external $EXTERNAL 246 | 247 | function build_framework 248 | { ( 249 | # errors fatal 250 | echo "Compiler version:" $(g++ --version) 251 | set -e 252 | 253 | SRC=/kf5 254 | BUILD=/kf5/build 255 | PREFIX=/app/usr/ 256 | 257 | # framework 258 | FRAMEWORK=$1 259 | 260 | # clone if not there 261 | mkdir -p $SRC 262 | cd $SRC 263 | if ( test -d $FRAMEWORK ) 264 | then 265 | echo "$FRAMEWORK already cloned" 266 | cd $FRAMEWORK 267 | git reset --hard 268 | git pull --rebase 269 | cd .. 270 | else 271 | git clone git://anongit.kde.org/$FRAMEWORK 272 | fi 273 | 274 | if [ "$FRAMEWORK" = "knotifications" ]; then 275 | cd $FRAMEWORK 276 | echo "patching knotifications" 277 | git reset --hard 278 | cat > no_phonon.patch << EOF 279 | diff --git a/CMakeLists.txt b/CMakeLists.txt 280 | index b97425f..8f15f08 100644 281 | --- a/CMakeLists.txt 282 | +++ b/CMakeLists.txt 283 | @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) 284 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) 285 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) 286 | 287 | -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) 288 | +find_package(Phonon4Qt5 4.6.60 NO_MODULE) 289 | set_package_properties(Phonon4Qt5 PROPERTIES 290 | DESCRIPTION "Qt-based audio library" 291 | - TYPE REQUIRED 292 | + TYPE OPTIONAL 293 | PURPOSE "Required to build audio notification support") 294 | if (Phonon4Qt5_FOUND) 295 | add_definitions(-DHAVE_PHONON4QT5) 296 | EOF 297 | cat no_phonon.patch |patch -p1 298 | cd .. 299 | fi 300 | 301 | # create build dir 302 | mkdir -p $BUILD/$FRAMEWORK 303 | 304 | # go there 305 | cd $BUILD/$FRAMEWORK 306 | 307 | # cmake it 308 | cmake $SRC/$FRAMEWORK -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 309 | 310 | # make 311 | make -j8 312 | 313 | # install 314 | make install 315 | ) } 316 | 317 | #TO-DO script these extras 318 | build_framework extra-cmake-modules 319 | #Cmake is too old on centos6.... so does this mean no sound for KDE apps? blech. 320 | #build_framework phonon -DPHONON_BUILD_PHONON4QT5=ON 321 | 322 | for FRAMEWORK in <%= frameworks %>; 323 | do 324 | build_framework $FRAMEWORK 325 | done 326 | build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 327 | 328 | 329 | 330 | cd .. 331 | 332 | # Build <%= name %> 333 | mkdir -p /<%= name %>_build 334 | cd /<%= name %>_build 335 | cmake ../<%= name %> \ 336 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 337 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 338 | -DPACKAGERS_BUILD=1 \ 339 | -DBUILD_TESTING=FALSE 340 | make -j8 install 341 | 342 | ############################################################### 343 | # Build complete, AppImage bundling begins here 344 | ############################################################### 345 | 346 | cd /app 347 | 348 | ldd usr/bin/#{@name} | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true 349 | 350 | # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary 351 | mkdir -p ./usr/lib/qt5/plugins/ 352 | 353 | PLUGINS=$(dirname $QTDIR/plugins/bearer) 354 | 355 | cp -r $PLUGINS/{bearer,generic,imageformats,platforms,iconengines,platforminputcontexts,xcbglintegrations} ./usr/lib/qt5/plugins/ 356 | # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ 357 | 358 | cp -ru /usr/share/mime/* /app/usr/share/mime 359 | update-mime-database /app/usr/share/mime/ 360 | 361 | mv ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ 362 | 363 | copy_deps 364 | mv usr/local/Qt-*/lib/* usr/lib 365 | rm -rf usr/local/ 366 | mv lib64/* usr/lib/ 367 | rm -rf lib64/ 368 | mv ./opt/python3.5/lib/* usr/lib 369 | # mv ./opt/llvm/lib/* usr/lib 370 | rm -rf ./opt/ 371 | rm -rf app/ 372 | 373 | delete_blacklisted 374 | 375 | # We don't bundle the developer stuff 376 | rm -rf usr/include || true 377 | rm -rf usr/lib/cmake || true 378 | rm -rf usr/lib/pkgconfig || true 379 | rm -rf usr/share/ECM/ || true 380 | rm -rf usr/share/gettext || true 381 | rm -rf usr/share/pkgconfig || true 382 | rm -rf rm -rf ./usr/mkspecs/ || true 383 | find . -name '*.a' -exec rm {} \; 384 | 385 | strip -g $(find usr) || true 386 | 387 | mv usr/lib/libexec/kf5/* /app/usr/bin/ 388 | 389 | cd / 390 | if [ ! -d appimage-exec-wrapper ]; then 391 | git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper 392 | fi; 393 | cd /appimage-exec-wrapper/ 394 | make clean 395 | make 396 | 397 | cd /app 398 | cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so 399 | 400 | cat > AppRun << EOF 401 | #!/bin/bash 402 | 403 | DIR="\`dirname \"\$0\"\`" 404 | DIR="\`( cd \"\$DIR\" && pwd )\`" 405 | export APPDIR=\$DIR 406 | 407 | export LD_PRELOAD=\$DIR/exec_wrapper.so 408 | 409 | export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 410 | export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 411 | export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 412 | export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS 413 | export APPIMAGE_ORIGINAL_PATH=\$PATH 414 | 415 | export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH 416 | export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH 417 | export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ 418 | export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS 419 | export PATH=\$DIR/usr/bin:\$PATH 420 | export KDE_FORK_SLAVES=1 421 | 422 | export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 423 | export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 424 | export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 425 | export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS 426 | export APPIMAGE_STARTUP_PATH=\$PATH 427 | 428 | <%= name %> \$@ 429 | EOF 430 | chmod +x AppRun 431 | 432 | cp usr/share/applications/org.kde.<%= name %>.desktop <%= name %>.desktop 433 | cp usr/share/icons/hicolor/128x128/apps/<%= name %>.png . 434 | 435 | #TO-DO this will need some text manipulation in ruby to get this var. 436 | APP=<%= proper_name %> 437 | LOWERAPP=<%= name %> 438 | 439 | get_desktopintegration <%= name %> 440 | 441 | delete_blacklisted 442 | 443 | cd / 444 | 445 | # Build AppImageKit 446 | if [ ! -d AppImageKit ] ; then 447 | git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit 448 | fi 449 | 450 | cd /AppImageKit/ 451 | git_pull_rebase_helper 452 | ./build.sh 453 | 454 | cd / 455 | 456 | mkdir -p /$APP/$APP.AppDir 457 | cd /$APP/ 458 | 459 | mv ../app/* $APP.AppDir/ 460 | 461 | VERSION=<%= version %> 462 | echo $VERSION 463 | 464 | if [[ "$ARCH" = "x86_64" ]] ; then 465 | APPIMAGE=$APP"-"$VERSION"-x86_64.AppImage" 466 | fi 467 | if [[ "$ARCH" = "i686" ]] ; then 468 | APPIMAGE=$APP"-"$VERSION"-i386.AppImage" 469 | fi 470 | 471 | /AppImageKit/AppImageAssistant.AppDir/package <%= proper_name %>.AppDir/ /out/$APP-$VERSION-$ARCH.AppImage 472 | 473 | chmod a+rwx ../out/$APPIMAGE # So that we can edit the AppImage outside of the Docker container 474 | ls -lh ../out/$APPIMAGE 475 | -------------------------------------------------------------------------------- /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 libxcb-keysyms1-devel libxcb1-devel libxcb-xtest0-devel gamin-devel gettext python33 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 /blinken ] ; then 65 | git clone --depth 1 http://anongit.kde.org/blinken.git /blinken 66 | fi 67 | cd /blinken/ 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 | function build_cmake 83 | { ( 84 | # errors fatal 85 | echo "Compiler version:" $(g++ --version) 86 | set -e 87 | 88 | SRC=/cmake 89 | PREFIX=/app/usr/ 90 | 91 | # framework 92 | CMAKE=$1 93 | 94 | # clone if not there 95 | mkdir -p $SRC 96 | cd $SRC 97 | if ( test -d $CMAKE ) 98 | then 99 | echo "$CMAKE already cloned" 100 | cd $CMAKE 101 | git reset --hard 102 | git pull --rebase 103 | cd .. 104 | else 105 | git clone https://github.com/Kitware/CMake 106 | fi 107 | 108 | 109 | cd CMake 110 | 111 | ./bootstrap 112 | 113 | # make 114 | make -j8 115 | 116 | # install 117 | make install 118 | 119 | ) } 120 | if ( true == true ) 121 | then 122 | build_cmake cmake 123 | fi 124 | 125 | 126 | function build_wayland 127 | { ( 128 | # errors fatal 129 | echo "Compiler version:" $(g++ --version) 130 | set -e 131 | 132 | SRC=/wayland 133 | 134 | WAYLAND=$1 135 | # clone if not there 136 | mkdir -p $SRC 137 | cd $SRC 138 | 139 | export WLD=/app/usr/ # change this to another location if you prefer 140 | export LD_LIBRARY_PATH=$WLD/lib 141 | export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/ 142 | export PATH=$WLD/bin:$PATH 143 | export ACLOCAL_PATH=$WLD/share/aclocal 144 | export ACLOCAL="aclocal -I $ACLOCAL_PATH" 145 | 146 | mkdir -p $WLD/share/aclocal # needed by autotools 147 | 148 | #autoconf is too old on centos6 149 | wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz 150 | tar xvfvz autoconf-2.69.tar.gz 151 | cd autoconf-2.69 152 | ./configure --prefix=$WLD 153 | make -j8 154 | make install 155 | #wayland 156 | git clone git://anongit.freedesktop.org/wayland/$WAYLAND 157 | cd $WAYLAND 158 | ./autogen.sh --prefix=$WLD 159 | make -j8 160 | make install 161 | cd .. 162 | ) } 163 | if ( false == true ) 164 | then 165 | build_wayland wayland 166 | fi 167 | 168 | function build_boost 169 | { ( 170 | # errors fatal 171 | echo "Compiler version:" $(g++ --version) 172 | set -e 173 | 174 | SRC=/boost 175 | 176 | BOOST=$1 177 | # clone if not there 178 | mkdir -p $SRC 179 | cd $SRC 180 | 181 | wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2 182 | tar --bzip2 -xf boost_1_61_0.tar.bz2 183 | cd boost_1_61_0 184 | ./bootstrap.sh --prefix=/app/usr 185 | ./b2 install 186 | ) } 187 | if ( false == true ) 188 | then 189 | build_boost boost 190 | fi 191 | 192 | function build_external 193 | { ( 194 | # errors fatal 195 | echo "Compiler version:" $(g++ --version) 196 | set -e 197 | 198 | SRC=/external 199 | BUILD=/external/build 200 | PREFIX=/app/usr/ 201 | 202 | # framework 203 | EXTERNAL=$1 204 | 205 | # clone if not there 206 | mkdir -p $SRC 207 | cd $SRC 208 | if ( test -d $EXTERNAL ) 209 | then 210 | echo "$EXTERNAL already cloned" 211 | cd $EXTERNAL 212 | git reset --hard 213 | git pull --rebase 214 | cd .. 215 | else 216 | git clone $EXTERNAL_ADDRESS 217 | fi 218 | 219 | # create build dir 220 | mkdir -p $BUILD/$EXTERNAL 221 | 222 | # go there 223 | cd $BUILD/$EXTERNAL 224 | 225 | # cmake it 226 | if ( $EXTERNAL_CMAKE ) 227 | then 228 | cmake $SRC/$EXTERNAL -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 229 | else 230 | $EXTERNAL_CONFIGURE 231 | fi 232 | # make 233 | make -j8 234 | 235 | # install 236 | make install 237 | ) } 238 | 239 | IN=[] 240 | IFS=',' read -a external_options <<< $IN 241 | EXTERNAL="${external_options[0]}" 242 | EXTERNAL_ADDRESS="${external_options[1]}" 243 | EXTERNAL_CMAKE="${external_options[2]}" 244 | EXTERNAL_CONFIGURE="${external_options[3]}" 245 | build_external $EXTERNAL 246 | 247 | function build_framework 248 | { ( 249 | # errors fatal 250 | echo "Compiler version:" $(g++ --version) 251 | set -e 252 | 253 | SRC=/kf5 254 | BUILD=/kf5/build 255 | PREFIX=/app/usr/ 256 | 257 | # framework 258 | FRAMEWORK=$1 259 | 260 | # clone if not there 261 | mkdir -p $SRC 262 | cd $SRC 263 | if ( test -d $FRAMEWORK ) 264 | then 265 | echo "$FRAMEWORK already cloned" 266 | cd $FRAMEWORK 267 | git reset --hard 268 | git pull --rebase 269 | cd .. 270 | else 271 | git clone git://anongit.kde.org/$FRAMEWORK 272 | fi 273 | 274 | if [ "$FRAMEWORK" = "knotifications" ]; then 275 | cd $FRAMEWORK 276 | echo "patching knotifications" 277 | git reset --hard 278 | cat > no_phonon.patch << EOF 279 | diff --git a/CMakeLists.txt b/CMakeLists.txt 280 | index b97425f..8f15f08 100644 281 | --- a/CMakeLists.txt 282 | +++ b/CMakeLists.txt 283 | @@ -59,10 +59,10 @@ find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) 284 | find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) 285 | find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) 286 | 287 | -find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) 288 | +find_package(Phonon4Qt5 4.6.60 NO_MODULE) 289 | set_package_properties(Phonon4Qt5 PROPERTIES 290 | DESCRIPTION "Qt-based audio library" 291 | - TYPE REQUIRED 292 | + TYPE OPTIONAL 293 | PURPOSE "Required to build audio notification support") 294 | if (Phonon4Qt5_FOUND) 295 | add_definitions(-DHAVE_PHONON4QT5) 296 | EOF 297 | cat no_phonon.patch |patch -p1 298 | cd .. 299 | fi 300 | 301 | # create build dir 302 | mkdir -p $BUILD/$FRAMEWORK 303 | 304 | # go there 305 | cd $BUILD/$FRAMEWORK 306 | 307 | # cmake it 308 | cmake $SRC/$FRAMEWORK -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX $2 309 | 310 | # make 311 | make -j8 312 | 313 | # install 314 | make install 315 | ) } 316 | 317 | #TO-DO script these extras 318 | build_framework extra-cmake-modules 319 | #Cmake is too old on centos6.... so does this mean no sound for KDE apps? blech. 320 | #build_framework phonon -DPHONON_BUILD_PHONON4QT5=ON 321 | 322 | for FRAMEWORK in extra-cmake-modules kauth kcodecs kconfig kconfigwidgets kcoreaddons kwindowsystem kcrash kdbusaddons kdoctools kguiaddons ki18n kwidgetsaddons attica kglobalaccel kitemviews kiconthemes ktextwidgets kxmlgui phonon; 323 | do 324 | build_framework $FRAMEWORK 325 | done 326 | build_framework breeze-icons -DBINARY_ICONS_RESOURCE=1 327 | 328 | 329 | 330 | cd .. 331 | 332 | # Build blinken 333 | mkdir -p /blinken_build 334 | cd /blinken_build 335 | cmake ../blinken \ 336 | -DCMAKE_INSTALL_PREFIX:PATH=/app/usr/ \ 337 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 338 | -DPACKAGERS_BUILD=1 \ 339 | -DBUILD_TESTING=FALSE 340 | make -j8 install 341 | 342 | ############################################################### 343 | # Build complete, AppImage bundling begins here 344 | ############################################################### 345 | 346 | cd /app 347 | 348 | ldd usr/bin/#{@name} | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true 349 | 350 | # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary 351 | mkdir -p ./usr/lib/qt5/plugins/ 352 | 353 | PLUGINS=$(dirname $QTDIR/plugins/bearer) 354 | 355 | cp -r $PLUGINS/{bearer,generic,imageformats,platforms,iconengines,platforminputcontexts,xcbglintegrations} ./usr/lib/qt5/plugins/ 356 | # cp -r $PLUGINS/platformthemes ./usr/lib/qt5/plugins/ 357 | 358 | cp -ru /usr/share/mime/* /app/usr/share/mime 359 | update-mime-database /app/usr/share/mime/ 360 | 361 | mv ./usr/lib/plugins/* ./usr/lib/qt5/plugins/ 362 | 363 | copy_deps 364 | mv usr/local/Qt-*/lib/* usr/lib 365 | rm -rf usr/local/ 366 | mv lib64/* usr/lib/ 367 | rm -rf lib64/ 368 | mv ./opt/python3.5/lib/* usr/lib 369 | # mv ./opt/llvm/lib/* usr/lib 370 | rm -rf ./opt/ 371 | rm -rf app/ 372 | 373 | delete_blacklisted 374 | 375 | # We don't bundle the developer stuff 376 | rm -rf usr/include || true 377 | rm -rf usr/lib/cmake || true 378 | rm -rf usr/lib/pkgconfig || true 379 | rm -rf usr/share/ECM/ || true 380 | rm -rf usr/share/gettext || true 381 | rm -rf usr/share/pkgconfig || true 382 | rm -rf rm -rf ./usr/mkspecs/ || true 383 | find . -name '*.a' -exec rm {} \; 384 | 385 | strip -g $(find usr) || true 386 | 387 | mv usr/lib/libexec/kf5/* /app/usr/bin/ 388 | 389 | cd / 390 | if [ ! -d appimage-exec-wrapper ]; then 391 | git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper 392 | fi; 393 | cd /appimage-exec-wrapper/ 394 | make clean 395 | make 396 | 397 | cd /app 398 | cp -v /appimage-exec-wrapper/exec.so exec_wrapper.so 399 | 400 | cat > AppRun << EOF 401 | #!/bin/bash 402 | 403 | DIR="\`dirname \"\$0\"\`" 404 | DIR="\`( cd \"\$DIR\" && pwd )\`" 405 | export APPDIR=\$DIR 406 | 407 | export LD_PRELOAD=\$DIR/exec_wrapper.so 408 | 409 | export APPIMAGE_ORIGINAL_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 410 | export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 411 | export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 412 | export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=\$XDG_DATA_DIRS 413 | export APPIMAGE_ORIGINAL_PATH=\$PATH 414 | 415 | export QML2_IMPORT_PATH=\$DIR/usr/lib/qml:\$QML2_IMPORT_PATH 416 | export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$LD_LIBRARY_PATH 417 | export QT_PLUGIN_PATH=\$DIR/usr/lib/qt5/plugins/ 418 | export XDG_DATA_DIRS=\$DIR/usr/share/:\$XDG_DATA_DIRS 419 | export PATH=\$DIR/usr/bin:\$PATH 420 | export KDE_FORK_SLAVES=1 421 | 422 | export APPIMAGE_STARTUP_QML2_IMPORT_PATH=\$QML2_IMPORT_PATH 423 | export APPIMAGE_STARTUP_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH 424 | export APPIMAGE_STARTUP_QT_PLUGIN_PATH=\$QT_PLUGIN_PATH 425 | export APPIMAGE_STARTUP_XDG_DATA_DIRS=\$XDG_DATA_DIRS 426 | export APPIMAGE_STARTUP_PATH=\$PATH 427 | 428 | blinken \$@ 429 | EOF 430 | chmod +x AppRun 431 | 432 | cp usr/share/applications/org.kde.blinken.desktop blinken.desktop 433 | cp usr/share/icons/hicolor/128x128/apps/blinken.png . 434 | 435 | #TO-DO this will need some text manipulation in ruby to get this var. 436 | APP=Blinken 437 | LOWERAPP=blinken 438 | 439 | get_desktopintegration blinken 440 | 441 | delete_blacklisted 442 | 443 | cd / 444 | 445 | # Build AppImageKit 446 | if [ ! -d AppImageKit ] ; then 447 | git clone --depth 1 https://github.com/probonopd/AppImageKit.git /AppImageKit 448 | fi 449 | 450 | cd /AppImageKit/ 451 | git_pull_rebase_helper 452 | ./build.sh 453 | 454 | cd / 455 | 456 | mkdir -p /$APP/$APP.AppDir 457 | cd /$APP/ 458 | 459 | mv ../app/* $APP.AppDir/ 460 | 461 | VERSION=16.04.3-2 462 | 463 | echo $VERSION 464 | 465 | if [[ "$ARCH" = "x86_64" ]] ; then 466 | APPIMAGE=$APP"-"$VERSION"-x86_64.AppImage" 467 | fi 468 | if [[ "$ARCH" = "i686" ]] ; then 469 | APPIMAGE=$APP"-"$VERSION"-i386.AppImage" 470 | fi 471 | 472 | /AppImageKit/AppImageAssistant.AppDir/package Blinken.AppDir/ /out/$APP-$VERSION-$ARCH.AppImage 473 | 474 | chmod a+rwx ../out/$APPIMAGE # So that we can edit the AppImage outside of the Docker container 475 | ls -lh ../out/$APPIMAGE 476 | --------------------------------------------------------------------------------