diff --git a/bin/Blueprints/CraftDependencyPackage.py b/bin/Blueprints/CraftDependencyPackage.py index d371e2c8d..2b2797d74 100644 --- a/bin/Blueprints/CraftDependencyPackage.py +++ b/bin/Blueprints/CraftDependencyPackage.py @@ -1,109 +1,109 @@ from collections import OrderedDict from enum import unique, Enum, IntFlag from Blueprints.CraftPackageObject import CraftPackageObject, BlueprintException from Blueprints.CraftVersion import CraftVersion from CraftCore import CraftCore @unique class DependencyType(IntFlag): Runtime = 0x1 << 0 Buildtime = 0x1 << 1 # TODO: rename as we now have more build types Both = Runtime | Buildtime Packaging = 0x1 << 3 All = ~0 class CraftDependencyPackage(CraftPackageObject): _packageCache = dict() @unique class State(Enum): Unvisited = 0 Visiting = 1 Visited = 2 def __init__(self, path): CraftPackageObject.__init__(self, path) self._depenendencyType = None self.dependencies = [] # tuple (name, required version) self.state = CraftDependencyPackage.State.Unvisited @property def depenendencyType(self): return self._depenendencyType @depenendencyType.setter def depenendencyType(self, depenendencyType): if self._depenendencyType != depenendencyType: self._depenendencyType = depenendencyType self.dependencies = [] self.__resolveDependencies() def __resolveDependencies(self): CraftCore.log.debug(f"resolving package {self}") if not self.isCategory(): subinfo = self.subinfo if self.depenendencyType & DependencyType.Runtime: self.dependencies.extend(self.__readDependenciesForChildren(subinfo.runtimeDependencies.items())) if self.depenendencyType & DependencyType.Buildtime: self.dependencies.extend(self.__readDependenciesForChildren(subinfo.buildDependencies.items())) if self.depenendencyType & DependencyType.Packaging: self.dependencies.extend(self.__readDependenciesForChildren(subinfo.packagingDependencies.items())) else: self.dependencies.extend(self.__readDependenciesForChildren([(x, None) for x in self.children.values()])) def __readDependenciesForChildren(self, deps : [(str, str)]) -> []: children = [] if deps: for packaheName, requiredVersion in deps: if (packaheName, self.depenendencyType) not in CraftDependencyPackage._packageCache: package = CraftPackageObject.get(packaheName) if not package: raise BlueprintException(f"Failed to resolve {packaheName} as a dependency of {self}", self) - if requiredVersion and requiredVersion != "default" and CraftVersion(package.version) < CraftVersion(requiredVersion): + if requiredVersion and requiredVersion != None and CraftVersion(package.version) < CraftVersion(requiredVersion): raise BlueprintException(f"{self} requries {package} version {requiredVersion!r} but {package.version!r} is installed", self) p = CraftDependencyPackage(package) CraftCore.log.debug(f"adding package {packaheName}") CraftDependencyPackage._packageCache[(packaheName, self.depenendencyType)] = p p.depenendencyType = self.depenendencyType else: p = CraftDependencyPackage._packageCache[(packaheName, self.depenendencyType)] children.append(p) return children def __getDependencies(self, depenendencyType, ignoredPackages): """ returns all dependencies """ if self.isIgnored(): return [] self.depenendencyType = depenendencyType depList = [] self.state = CraftDependencyPackage.State.Visiting for p in self.dependencies: if p.state != CraftDependencyPackage.State.Unvisited: continue if not p.isIgnored() \ and (not ignoredPackages or p.path not in ignoredPackages): depList.extend(p.__getDependencies(depenendencyType & ~DependencyType.Packaging, ignoredPackages)) if depenendencyType & DependencyType.Packaging: depList.extend(p.__getDependencies(depenendencyType, ignoredPackages)) if self.state != CraftDependencyPackage.State.Visited: self.state = CraftDependencyPackage.State.Visited if not self.isCategory(): depList.append(self) return list(OrderedDict.fromkeys(depList)) def getDependencies(self, depType=DependencyType.All, ignoredPackages=None): self.depenendencyType = depType for p in CraftDependencyPackage._packageCache.values(): #reset visited state p.state = CraftDependencyPackage.State.Unvisited return self.__getDependencies(depType, ignoredPackages) diff --git a/bin/Package/QMakePackageBase.py b/bin/Package/QMakePackageBase.py index 33f6a38e1..8e6c7c1d9 100644 --- a/bin/Package/QMakePackageBase.py +++ b/bin/Package/QMakePackageBase.py @@ -1,18 +1,24 @@ # # copyright (c) 2009 Ralf Habacker # from BuildSystem.QMakeBuildSystem import * from Package.PackageBase import * from Packager.TypePackager import * from Source.MultiSource import * class QMakePackageBase(PackageBase, MultiSource, QMakeBuildSystem, TypePackager): """provides a base class for qmake packages from any source""" def __init__(self): CraftCore.log.debug("QMakePackageBase.__init__ called") PackageBase.__init__(self) MultiSource.__init__(self) QMakeBuildSystem.__init__(self) TypePackager.__init__(self) + + def internalPostInstall(self): + if not super().internalPostInstall(): + return False + + return True diff --git a/blueprints/craft/craft-blueprints-kde/craft-blueprints-kde.py b/blueprints/craft/craft-blueprints-kde/craft-blueprints-kde.py index b1b2e4b62..e3d537e12 100644 --- a/blueprints/craft/craft-blueprints-kde/craft-blueprints-kde.py +++ b/blueprints/craft/craft-blueprints-kde/craft-blueprints-kde.py @@ -1,26 +1,26 @@ import info class subinfo(info.infoclass): def setTargets(self): for ver in ["master", "2018.03"]: self.svnTargets[ver] = f"[git]git://anongit.kde.org/craft-blueprints-kde|{ver}|" self.defaultTarget = "master" def setDependencies(self): - self.buildDependencies["craft/craft-core"] = "default" + self.buildDependencies["craft/craft-core"] = None from Package.BlueprintRepositoryPackageBase import * class Package(BlueprintRepositoryPackageBase): def __init__(self): BlueprintRepositoryPackageBase.__init__(self) def checkoutDir(self, index=0): # check for legacy dir checkoutDir = os.path.join(CraftStandardDirs.blueprintRoot(), "craft-kde") if not os.path.exists(checkoutDir): checkoutDir = super().checkoutDir() return checkoutDir diff --git a/blueprints/craft/craft-core/craft-core.py b/blueprints/craft/craft-core/craft-core.py index 2e59d5f8f..35b16c70c 100644 --- a/blueprints/craft/craft-core/craft-core.py +++ b/blueprints/craft/craft-core/craft-core.py @@ -1,42 +1,42 @@ import info class subinfo(info.infoclass): def setTargets(self): for ver in ["2017.12", "master"]: self.svnTargets[ver] = f"git://anongit.kde.org/craft|{ver}|" self.defaultTarget = "master" def setDependencies(self): - self.buildDependencies["virtual/base"] = "default" + self.buildDependencies["virtual/base"] = None from Package.SourceOnlyPackageBase import * class Package(SourceOnlyPackageBase): def __init__(self): SourceOnlyPackageBase.__init__(self) self.subinfo.options.package.disableBinaryCache = True self.subinfo.options.dailyUpdate = True def unpack(self): return True def install(self): return True def qmerge(self): if not SourceOnlyPackageBase.qmerge(self): return False CraftCore.cache.clear() return True def createPackage(self): return True def checkoutDir(self, index=0): return os.path.join(CraftStandardDirs.craftRoot(), "craft") def unittest(self): test = os.path.join(self.sourceDir(), "bin", "test", "runtests.py") return utils.system([sys.executable, test]) diff --git a/blueprints/dev-utils/_mac/create-dmg/create-dmg.py b/blueprints/dev-utils/_mac/create-dmg/create-dmg.py index b7036f8c9..41d63e341 100644 --- a/blueprints/dev-utils/_mac/create-dmg/create-dmg.py +++ b/blueprints/dev-utils/_mac/create-dmg/create-dmg.py @@ -1,27 +1,27 @@ import info from Package.MakeFilePackageBase import * class subinfo(info.infoclass): def setTargets(self): self.svnTargets["master"] = "https://github.com/andreyvit/create-dmg.git" self.targetInstallPath["master"] = "dev-utils/create-dmg" self.description = "A shell script to build fancy DMGs" self.webpage = "https://github.com/andreyvit/create-dmg" self.defaultTarget = 'master' def setDependencies(self): - self.runtimeDependencies["virtual/base"] = "default" + self.runtimeDependencies["virtual/base"] = None from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def unpack(self): return True def postInstall(self): return utils.createShim(os.path.join(self.imageDir(), "dev-utils", "bin", "create-dmg"), os.path.join(self.imageDir(), "dev-utils", "create-dmg", "create-dmg")) diff --git a/blueprints/dev-utils/_unix/autoconf/autoconf.py b/blueprints/dev-utils/_unix/autoconf/autoconf.py index c7b77ce40..3f00a8b14 100644 --- a/blueprints/dev-utils/_unix/autoconf/autoconf.py +++ b/blueprints/dev-utils/_unix/autoconf/autoconf.py @@ -1,41 +1,41 @@ import info class subinfo( info.infoclass ): def setTargets( self ): for ver in ["2.69"]: self.targets[ ver ] = f"https://ftp.gnu.org/gnu/autoconf/autoconf-{ver}.tar.xz" self.targetInstSrc[ ver ] = f"autoconf-{ver}" self.targetInstallPath[ver] = "dev-utils" self.targetDigests["2.69"] = (['64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684'], CraftHash.HashAlgorithm.SHA256) self.description = "Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages." self.defaultTarget = "2.69" def setDependencies( self ): - self.buildDependencies["dev-utils/m4"] = "default" + self.buildDependencies["dev-utils/m4"] = None from Package.AutoToolsPackageBase import * class Package( AutoToolsPackageBase ): def __init__( self ): AutoToolsPackageBase.__init__( self ) self.subinfo.options.configure.autoreconf = False self.subinfo.options.configure.args += " --disable-static --enable-shared " def postInstall(self): return self.patchInstallPrefix([os.path.join(self.imageDir(), x) for x in ["dev-utils/bin/autoconf", "dev-utils/bin/autoheader", "dev-utils/bin/autom4te", "dev-utils/bin/autoreconf", "dev-utils/bin/autoscan", "dev-utils/bin/autoupdate", "dev-utils/bin/ifnames", "dev-utils/share/autoconf/autoconf/autoconf.m4f", "dev-utils/share/autoconf/autom4te.cfg", "dev-utils/share/autoconf/autotest/autotest.m4f", "dev-utils/share/autoconf/m4sugar/m4sh.m4f", "dev-utils/share/autoconf/m4sugar/m4sugar.m4f" ]], self.subinfo.buildPrefix, CraftCore.standardDirs.craftRoot()) diff --git a/blueprints/dev-utils/_unix/automake/automake.py b/blueprints/dev-utils/_unix/automake/automake.py index 0b2ca2cfe..5fba5355c 100644 --- a/blueprints/dev-utils/_unix/automake/automake.py +++ b/blueprints/dev-utils/_unix/automake/automake.py @@ -1,34 +1,34 @@ import info class subinfo( info.infoclass ): def setTargets( self ): for ver in ["1.16.1"]: self.targets[ ver ] = f"https://ftp.gnu.org/gnu/automake/automake-{ver}.tar.xz" self.targetInstSrc[ ver ] = f"automake-{ver}" self.targetInstallPath[ver] = "dev-utils" self.targetDigests["1.16.1"] = (['5d05bb38a23fd3312b10aea93840feec685bdf4a41146e78882848165d3ae921'], CraftHash.HashAlgorithm.SHA256) self.description = "Automake is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards." self.defaultTarget = "1.16.1" def setDependencies( self ): - self.runtimeDependencies["virtual/base"] = "default" - self.buildDependencies["dev-utils/autoconf"] = "default" + self.runtimeDependencies["virtual/base"] = None + self.buildDependencies["dev-utils/autoconf"] = None from Package.AutoToolsPackageBase import * class Package( AutoToolsPackageBase ): def __init__( self ): AutoToolsPackageBase.__init__( self ) self.subinfo.options.configure.autoreconf = False self.subinfo.options.configure.args += " --disable-static --enable-shared " def postInstall(self): return self.patchInstallPrefix([os.path.join(self.installDir(), "bin", "aclocal"), os.path.join(self.installDir(), "bin", "aclocal-1.16"), os.path.join(self.installDir(), "bin", "automake"), os.path.join(self.installDir(), "bin", "automake-1.16")], self.subinfo.buildPrefix, CraftCore.standardDirs.craftRoot()) diff --git a/blueprints/dev-utils/_unix/help2man/help2man.py b/blueprints/dev-utils/_unix/help2man/help2man.py index a7662e9a7..f2db0c0b9 100644 --- a/blueprints/dev-utils/_unix/help2man/help2man.py +++ b/blueprints/dev-utils/_unix/help2man/help2man.py @@ -1,25 +1,25 @@ import info class subinfo( info.infoclass ): def setTargets( self ): for ver in ["1.47.6"]: self.targets[ ver ] = f"http://mirror.netcologne.de/gnu/help2man/help2man-{ver}.tar.xz" self.targetInstSrc[ ver ] = f"help2man-{ver}" self.targetInstallPath[ver] = "dev-utils" self.description = "help2man produces simple manual pages from the ‘--help’ and ‘--version’ output of other commands." self.defaultTarget = "1.47.6" def setDependencies( self ): - self.runtimeDependencies["virtual/base"] = "default" - self.buildDependencies["dev-utils/autoconf"] = "default" + self.runtimeDependencies["virtual/base"] = None + self.buildDependencies["dev-utils/autoconf"] = None from Package.AutoToolsPackageBase import * class Package( AutoToolsPackageBase ): def __init__( self ): AutoToolsPackageBase.__init__( self ) self.subinfo.options.configure.autoreconf = False self.subinfo.options.configure.args += " --disable-static --enable-shared " diff --git a/blueprints/dev-utils/_unix/libtool/libtool.py b/blueprints/dev-utils/_unix/libtool/libtool.py index b69eea681..4690d2704 100644 --- a/blueprints/dev-utils/_unix/libtool/libtool.py +++ b/blueprints/dev-utils/_unix/libtool/libtool.py @@ -1,32 +1,32 @@ import info class subinfo( info.infoclass ): def setTargets( self ): for ver in ["2.4.6"]: self.targets[ ver ] = f"https://ftp.gnu.org/gnu/libtool/libtool-{ver}.tar.xz" self.targetInstSrc[ ver ] = f"libtool-{ver}" self.targetInstallPath[ver] = "dev-utils" #self.targetDigests["2.4.6"] = (['5d05bb38a23fd3312b10aea93840feec685bdf4a41146e78882848165d3ae921'], CraftHash.HashAlgorithm.SHA256) self.description = "GNU libtool is a generic library support script." self.defaultTarget = "2.4.6" def setDependencies( self ): - self.buildDependencies["dev-utils/automake"] = "default" + self.buildDependencies["dev-utils/automake"] = None from Package.AutoToolsPackageBase import * class Package( AutoToolsPackageBase ): def __init__( self ): AutoToolsPackageBase.__init__( self ) self.subinfo.options.configure.autoreconf = False self.subinfo.options.configure.args += " --disable-static --enable-shared " def postInstall(self): return self.patchInstallPrefix([os.path.join(self.imageDir(), x) for x in ["dev-utils/bin/libtool", "dev-utils/bin/libtoolize"]], self.subinfo.buildPrefix, CraftCore.standardDirs.craftRoot()) diff --git a/blueprints/dev-utils/_windows/git/git.py b/blueprints/dev-utils/_windows/git/git.py index 90fb25017..9c8bf9678 100644 --- a/blueprints/dev-utils/_windows/git/git.py +++ b/blueprints/dev-utils/_windows/git/git.py @@ -1,64 +1,64 @@ # -*- coding: utf-8 -*- # Copyright Hannah von Reth # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import info from Package.MaybeVirtualPackageBase import * class subinfo(info.infoclass): def setTargets(self): ver = "2.19.0" build = "1" self.targets[ver] = f"https://github.com/git-for-windows/git/releases/download/v{ver}.windows.{build}/PortableGit-{ver}-64-bit.7z.exe" self.archiveNames[ver] = f"PortableGit-{ver}-64-bit.7z" self.targetInstallPath[ver] = os.path.join("dev-utils", "git") self.targetDigests[ver] = (["1b8761ae57f589890a83995d0da7891efbddfee14e9f0c3ffda91f6add5b9351"], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = ver def setDependencies(self): - self.buildDependencies["dev-utils/7zip"] = "default" - self.buildDependencies["dev-utils/wget"] = "default" - self.buildDependencies["dev-utils/shimgen"] = "default" + self.buildDependencies["dev-utils/7zip"] = None + self.buildDependencies["dev-utils/wget"] = None + self.buildDependencies["dev-utils/shimgen"] = None from Package.BinaryPackageBase import * class GitPackage(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def postInstall(self): return utils.createShim(os.path.join(self.imageDir(), "dev-utils", "bin", "git.exe"), os.path.join(self.imageDir(), "dev-utils", "git", "bin", "git.exe")) def postQmerge(self): gitDir = os.path.join(CraftStandardDirs.craftRoot(), self.subinfo.targetInstallPath[self.buildTarget]) utils.system([os.path.join(gitDir, "git-cmd.exe"), "--no-cd", "--command=post-install.bat"], cwd=gitDir) return True class Package(VirtualIfSufficientVersion): def __init__(self): VirtualIfSufficientVersion.__init__(self, app="git", version="2.13.0", classA=GitPackage) diff --git a/blueprints/dev-utils/_windows/jom/jom.py b/blueprints/dev-utils/_windows/jom/jom.py index 7ec77466a..23dbb28aa 100644 --- a/blueprints/dev-utils/_windows/jom/jom.py +++ b/blueprints/dev-utils/_windows/jom/jom.py @@ -1,24 +1,24 @@ # -*- coding: utf-8 -*- import info class subinfo(info.infoclass): def setDependencies(self): - self.runtimeDependencies["virtual/bin-base"] = "default" + self.runtimeDependencies["virtual/bin-base"] = None def setTargets(self): for ver in ['1_0_14', '1_0_15', '1_0_16', '1_1_2']: self.targets[ver] = 'http://download.qt.io/official_releases/jom/jom_' + ver + '.zip' self.targetDigestUrls[ver] = ( ["http://download.qt.io/official_releases/jom/md5sums.txt"], CraftHash.HashAlgorithm.MD5) self.targetInstallPath[ver] = os.path.join("dev-utils", "bin") self.defaultTarget = '1_1_2' from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) diff --git a/blueprints/dev-utils/_windows/mingw-w64/mingw-w64.py b/blueprints/dev-utils/_windows/mingw-w64/mingw-w64.py index 464ab23e3..02cda484f 100644 --- a/blueprints/dev-utils/_windows/mingw-w64/mingw-w64.py +++ b/blueprints/dev-utils/_windows/mingw-w64/mingw-w64.py @@ -1,49 +1,49 @@ import info class subinfo(info.infoclass): def setTargets(self): for ver, rev, rt in [("5.3.0", "0", "4"), ("5.4.0", "0", "5"), ("6.2.0", "0", "5"), ("7.1.0", "0", "5"), ("7.2.0", "1", "5"), ("7.3.0", "0", "5"), ]: arch = "i686" if CraftCore.compiler.isX86() else "x86_64" exceptionType = "sjlj" if CraftCore.compiler.isX86() else "seh" self.targets[ f"{ver}-{rev}"] = f"http://downloads.sourceforge.net/sourceforge/mingw-w64/{arch}-{ver}-release-posix-{exceptionType}-rt_v{rt}-rev{rev}.7z" self.targetDigestsX64["7.1.0-0"] = (['5391e8e733dcdab71e6ac71d6524e841be5ea980dc14f22a23af64e92af5dcd7'], CraftHash.HashAlgorithm.SHA256) self.targetDigestsX64["7.2.0-1"] = (['ef88d8691566b993778ed3ad651a3c75bd67896d1d8e220729fe24ec405ec21c'], CraftHash.HashAlgorithm.SHA256) self.targetDigestsX64["7.3.0-0"] = (['784d25b00e7cf27aa64abe2363b315400c27526bfce672fdee97137f71823d03'], CraftHash.HashAlgorithm.SHA256) self.targetDigests["7.3.0-0"] = (['c1f80f43dd0fb625ee925b4fd01974140871fe09bb771d0684b306ba58ed47f3'], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = "7.3.0-0" def setDependencies(self): - self.runtimeDependencies["dev-utils/7zip"] = "default" + self.runtimeDependencies["dev-utils/7zip"] = None from Package.BinaryPackageBase import * class PackageMinGW(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def install(self): if not BinaryPackageBase.install(self): return False if CraftCore.compiler.isX86(): return utils.moveDir(os.path.join(self.installDir(), "mingw32"), os.path.join(self.installDir(), "mingw")) return True from Package.Qt5CorePackageBase import * class Package(Qt5CoreSdkPackageBase): def __init__(self): Qt5CoreSdkPackageBase.__init__(self, condition=CraftCore.compiler.isMinGW(), classA=PackageMinGW) diff --git a/blueprints/dev-utils/_windows/patch/patch.py b/blueprints/dev-utils/_windows/patch/patch.py index f355754b8..5f3f26142 100644 --- a/blueprints/dev-utils/_windows/patch/patch.py +++ b/blueprints/dev-utils/_windows/patch/patch.py @@ -1,29 +1,29 @@ import info class subinfo(info.infoclass): def setTargets(self): self.targets['2.5.9'] = "http://downloads.sourceforge.net/sourceforge/gnuwin32/patch-2.5.9-7-bin.zip" self.targetInstallPath["2.5.9"] = "dev-utils" self.targetDigests['2.5.9'] = '7b2ec738881f4e962e54e0f330b67c42635266b7' self.defaultTarget = '2.5.9' def setDependencies(self): if CraftCore.compiler.isMinGW(): - self.runtimeDependencies["dev-utils/uactools"] = "default" - self.runtimeDependencies["virtual/bin-base"] = "default" + self.runtimeDependencies["dev-utils/uactools"] = None + self.runtimeDependencies["virtual/bin-base"] = None from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def install(self): if not BinaryPackageBase.install(self): return False manifest = os.path.join(self.packageDir(), "patch.exe.manifest") patch = os.path.join(self.installDir(), "bin", "patch.exe") return utils.embedManifest(patch, manifest) diff --git a/blueprints/dev-utils/_windows/qt-installer-framework/qt-installer-framework.py b/blueprints/dev-utils/_windows/qt-installer-framework/qt-installer-framework.py index 459e67d51..9a7d0123d 100644 --- a/blueprints/dev-utils/_windows/qt-installer-framework/qt-installer-framework.py +++ b/blueprints/dev-utils/_windows/qt-installer-framework/qt-installer-framework.py @@ -1,96 +1,96 @@ # -*- coding: utf-8 -*- # Copyright Hannah von Reth # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import info class subinfo(info.infoclass): def setTargets(self): for ver in ["3.0.2"]: self.targets[ver] = f"http://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_ifw/qt.tools.ifw.30/{ver}ifw-win-x86.7z" self.targetInstSrc[ver] = f"Tools/QtInstallerFramework/3.0" self.targetDigestUrls[ver] = "http://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_ifw/qt.tools.ifw.30/3.0.2ifw-win-x86.7z.sha1" self.targetInstallPath[ver] = "dev-utils" self.description = "The Qt Installer Framework provides a set of tools and utilities to create installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and Mac OS X." self.webpage = "https://wiki.qt.io/Qt-Installer-Framework" self.defaultTarget = "3.0.2" def setDependencies(self): - self.buildDependencies["virtual/bin-base"] = "default" + self.buildDependencies["virtual/bin-base"] = None def registerOptions(self): self.options.dynamic.registerOption("name", "Craft Installer") self.options.dynamic.registerOption("title", "Craft Installer") self.options.dynamic.registerOption("installerVersion", "0.1") self.options.dynamic.registerOption("publisher", "KDE Craft") self.options.dynamic.registerOption("targetDir", r"@RootDir@\Craft") self.options.dynamic.registerOption("startMenuDir", "Craft") self.options.dynamic.registerOption("offlineInstaller", False) self.options.dynamic.registerOption("installerName", "CraftInstaller") self.options.dynamic.registerOption("repositoryURL", "") self.options.dynamic.registerOption("repositoryName", "CraftRepository") from Package.BinaryPackageBase import * from Package.MaybeVirtualPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def createPackage(self): # TODO: don't run this in package but in a different ways.... qtifDir = os.path.join(self.packageDestinationDir(), "qtif" ) vars = {"NAME" : self.subinfo.options.dynamic.name, "VERSION" : self.subinfo.options.dynamic.installerVersion, "PUBLISHER" : self.subinfo.options.dynamic.publisher, "TARGET_DIR" : self.subinfo.options.dynamic.targetDir, "START_MENU_DIR" : self.subinfo.options.dynamic.startMenuDir, "TITLE" : self.subinfo.options.dynamic.title, "REPO_ENABLED" : "0" if self.subinfo.options.dynamic.offlineInstaller else "1", "REPO_URL" : self.subinfo.options.dynamic.repositoryURL if self.subinfo.options.dynamic.repositoryURL else f"file:///{OsUtils.toUnixPath(qtifDir)}/repo", "REPO_NAME" : self.subinfo.options.dynamic.repositoryName, } if not utils.configureFile(os.path.join(self.packageDir(), "config.xml"), os.path.join(qtifDir, "config.xml"), vars): return False if not utils.system(["binarycreator", "-n" if not self.subinfo.options.dynamic.offlineInstaller else "-f", "-c", os.path.join(qtifDir, "config.xml"), "-p", os.path.join(qtifDir, "image"), os.path.join(qtifDir, self.subinfo.options.dynamic.installerName + CraftCore.compiler.executableSuffix)]): return False if not self.subinfo.options.dynamic.offlineInstaller: repoDir = os.path.join(qtifDir, "repo") command = ["repogen", "--packages", os.path.join(qtifDir, "image")] if os.path.isdir(repoDir): command += ["--update"] command += [repoDir] return utils.system(command) return True diff --git a/blueprints/dev-utils/_windows/sed/sed.py b/blueprints/dev-utils/_windows/sed/sed.py index cf534f785..f8c266a66 100644 --- a/blueprints/dev-utils/_windows/sed/sed.py +++ b/blueprints/dev-utils/_windows/sed/sed.py @@ -1,25 +1,25 @@ import info class subinfo(info.infoclass): def setTargets(self): for ver in ['4.1.5', '4.2.1']: self.targets[ver] = ["http://downloads.sourceforge.net/sourceforge/gnuwin32/sed-%s-bin.zip" % ver, "http://downloads.sourceforge.net/sourceforge/gnuwin32/sed-%s-dep.zip" % ver] self.targetInstallPath[ver] = "dev-utils" self.targetDigests['4.1.5'] = ['abe52d0be25f1bb44b8a8e7a94e7afa9c15b3ae5', '736678616305fab80b4ec1a639d5ff0170183310'] self.targetDigests['4.2.1'] = ['dfd3d1dae27a24784d7ab40eb074196509fa48fe', 'f7edbd7152d8720c95d46dd128b87b8ba48a5d6f'] self.defaultTarget = '4.2.1' def setDependencies(self): - self.runtimeDependencies["virtual/bin-base"] = "default" + self.runtimeDependencies["virtual/bin-base"] = None from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) diff --git a/blueprints/dev-utils/_windows/uactools-pkg/uactools-pkg.py b/blueprints/dev-utils/_windows/uactools-pkg/uactools-pkg.py index c53dd67cc..8e68c4306 100644 --- a/blueprints/dev-utils/_windows/uactools-pkg/uactools-pkg.py +++ b/blueprints/dev-utils/_windows/uactools-pkg/uactools-pkg.py @@ -1,21 +1,21 @@ import info class subinfo(info.infoclass): def setDependencies(self): # This Package provides the binaries for uactools-bin but virtual/base can # not depend on it because it needs a compiler itself. - self.runtimeDependencies["virtual/base"] = "default" + self.runtimeDependencies["virtual/base"] = None def setTargets(self): self.svnTargets['svnHEAD'] = 'trunk/kdesupport/kdewin/tools/mt' self.defaultTarget = 'svnHEAD' from Package.CMakePackageBase import * class Package(CMakePackageBase): def __init__(self): CMakePackageBase.__init__(self) self.subinfo.options.configure.args = "-DCMAKE_EXE_LINKER_FLAGS=-static" diff --git a/blueprints/dev-utils/_windows/uactools/uactools.py b/blueprints/dev-utils/_windows/uactools/uactools.py index 93f554a7d..e982edd8e 100644 --- a/blueprints/dev-utils/_windows/uactools/uactools.py +++ b/blueprints/dev-utils/_windows/uactools/uactools.py @@ -1,29 +1,29 @@ # uactools : Binary package of the tools to handle UAC from kde-windows. # mt.exe can be used to embed manifest files to disable heuristic UAC raise # requests, setuac.exe can be used to enable raise the privileges of a program. # The according source package is uactools-pkg import info class subinfo(info.infoclass): def setTargets(self): latest = "20100711" self.targets[latest] = \ "http://downloads.sourceforge.net/kde-windows/uactools-mingw4-" + \ latest + "-bin.tar.bz2" self.targetDigests[latest] = 'b59ab7ac9190cbfe5b00acae05f909ea8f22bd3a' self.targetInstallPath[latest] = "dev-utils" self.defaultTarget = latest def setDependencies(self): - self.runtimeDependencies["virtual/bin-base"] = "default" + self.runtimeDependencies["virtual/bin-base"] = None from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) diff --git a/blueprints/dev-utils/_windows/wget/wget.py b/blueprints/dev-utils/_windows/wget/wget.py index 8868f7cc7..413b1e08e 100644 --- a/blueprints/dev-utils/_windows/wget/wget.py +++ b/blueprints/dev-utils/_windows/wget/wget.py @@ -1,37 +1,37 @@ import info class subinfo(info.infoclass): def setTargets(self): fileNames = {"1.19.4":"wget-1.19.4_curl-7.58_aria2-1.33.1_dwnl.7z", "1.19.2":"wget-1.19.2_curl-7.56.1_aria2-1.33_dwnl_rev2.7z", "1.18":"wget-1.18_curl-7.49.1_win32_win64.7z"} for ver in ["1.18", "1.19.2", "1.19.4"]: fName = fileNames[ver] self.targets[ver] = f"http://downloads.sourceforge.net/sourceforge/tumagcc/{fName}" self.targetInstallPath[ver] = "dev-utils" self.targetDigests['1.18'] = (['19d4ae30ae35f212e95edb6f18dddab19e1c97e119c36c4231b741e7293f9b3c'], CraftHash.HashAlgorithm.SHA256) self.targetDigests['1.19.2'] = (['0791cce5bf665edcc295cbdc58c4b30568f052a485f88672691abf92a7e80dac'], CraftHash.HashAlgorithm.SHA256) self.targetDigests['1.19.4'] = (['8f927eaba0011aca50b92327a24143b47278bdb724a662e999ddb171b84b2420'], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = "1.18" def setDependencies(self): - self.buildDependencies["dev-utils/7zip"] = "default" - self.buildDependencies["core/cacert"] = "default" + self.buildDependencies["dev-utils/7zip"] = None + self.buildDependencies["core/cacert"] = None from Package.BinaryPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def install(self): utils.copyFile(os.path.join(self.sourceDir(), "wget.exe"), os.path.join(self.installDir(), "bin", "wget.exe")) return True def postQmerge(self): CraftCore.cache.clear() return True diff --git a/blueprints/dev-utils/cmake/cmake.py b/blueprints/dev-utils/cmake/cmake.py index b4f2f9749..6e060a26a 100644 --- a/blueprints/dev-utils/cmake/cmake.py +++ b/blueprints/dev-utils/cmake/cmake.py @@ -1,66 +1,66 @@ import info class subinfo(info.infoclass): def setTargets(self): for ver in ["3.8.0", "3.8.1", "3.9.1", "3.10.2", "3.10.3", "3.11.0", "3.11.1", "3.11.3", "3.12.0", "3.12.2"]: majorMinorStr = '.'.join(ver.split('.')[0:2]) if CraftCore.compiler.isWindows: self.targets[ver] = f"https://www.cmake.org/files/v{majorMinorStr}/cmake-{ver}-win{CraftCore.compiler.bits}-{CraftCore.compiler.architecture}.zip" self.targetInstSrc[ver] = f"cmake-{ver}-win{CraftCore.compiler.bits}-{CraftCore.compiler.architecture}" elif CraftCore.compiler.isMacOS: self.targets[ver] = f"https://www.cmake.org/files/v{majorMinorStr}/cmake-{ver}-Darwin-{CraftCore.compiler.gnuArchitecture}.tar.gz" self.targetInstSrc[ver] = f"cmake-{ver}-Darwin-{CraftCore.compiler.gnuArchitecture}" elif CraftCore.compiler.isLinux: self.targets[ver] = f"https://cmake.org/files/v{majorMinorStr}/cmake-{ver}-Linux-x86_64.tar.gz" self.targetInstSrc[ver] = f"cmake-{ver}-Linux-x86_64" self.targetInstallPath[ver] = os.path.join("dev-utils", "cmake") self.targetDigestUrls[ver] = (f"https://cmake.org/files/v{majorMinorStr}/cmake-{ver}-SHA-256.txt", CraftHash.HashAlgorithm.SHA256) if CraftCore.compiler.isLinux and self.options.dynamic.checkForNightlies: suffix = 'zip' if CraftCore.compiler.isWindows else 'tar.gz' for ver in CraftCore.cache.getNightlyVersionsFromUrl("https://cmake.org/files/dev/?C=M;O=D;F=0", f"\d.\d.\d\d\d\d\d\d\d\d-[0-9A-Za-z]{5,8}{re.escape('-win32-x86' if OsUtils.isWin() else '-Darwin-x86_64')}"): self.targets[ver] = f"{nightlyUrl}/cmake-{ver}.{suffix}" self.targetInstSrc[ver] = f"cmake-{ver}" self.targetInstallPath[ver] = os.path.join("dev-utils", "cmake") self.description = "CMake, the cross-platform, open-source build system." self.webpage = "http://www.cmake.org/" self.defaultTarget = "3.12.2" def setDependencies(self): - self.buildDependencies["dev-utils/ninja"] = "default" + self.buildDependencies["dev-utils/ninja"] = None def registerOptions(self): self.options.dynamic.registerOption("checkForNightlies", False) from Package.BinaryPackageBase import * from Package.MaybeVirtualPackageBase import * class Package(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) def postInstall(self): binaryPath = os.path.join(self.imageDir(), "dev-utils", "cmake", "bin") if OsUtils.isMac(): binaryPath = os.path.join(self.imageDir(), "dev-utils", "cmake", "CMake.app", "Contents", "bin") for name in ["cmake", "cmake-gui", "cmcldeps", "cpack", "ctest"]: sourceBinary = os.path.join(binaryPath, f"{name}{CraftCore.compiler.executableSuffix}") targetBinary = os.path.join(self.imageDir(), "dev-utils", "bin", f"{name}{CraftCore.compiler.executableSuffix}") if os.path.exists(sourceBinary): if not utils.createShim(targetBinary, sourceBinary): return False return True def postQmerge(self): CraftCore.cache.clear() return True diff --git a/blueprints/dev-utils/ninja/ninja.py b/blueprints/dev-utils/ninja/ninja.py index 0359f38b0..298e7ef5b 100644 --- a/blueprints/dev-utils/ninja/ninja.py +++ b/blueprints/dev-utils/ninja/ninja.py @@ -1,47 +1,47 @@ # -*- coding: utf-8 -*- import sys import info from Package.CMakePackageBase import * class subinfo(info.infoclass): def setTargets(self): """ """ self.svnTargets['master'] = "https://github.com/martine/ninja.git" if CraftCore.settings.getboolean("General", "AllowAnsiColor", False): self.patchToApply["master"] = [("0001-Add-c-flag-to-force-color-output.patch", 1)] for ver in ["1.6.0", "1.7.1", "1.7.2", "1.8.2"]: self.targets[ver] = f"https://github.com/ninja-build/ninja/archive/v{ver}.tar.gz" self.archiveNames[ver] = f"ninja-{ver}.tar.gz" self.targetInstSrc[ver] = f"ninja-{ver}" self.targetInstallPath[ver] = "dev-utils" self.targetDigests['1.6.0'] = 'a6ff055691f6d355234298c21cc18961b4ca2ed9' self.targetDigests['1.7.2'] = (['2edda0a5421ace3cf428309211270772dd35a91af60c96f93f90df6bc41b16d9'], CraftHash.HashAlgorithm.SHA256) self.targetDigests['1.8.2'] = (['86b8700c3d0880c2b44c2ff67ce42774aaf8c28cbf57725cb881569288c1c6f4'], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = "1.8.2" def setDependencies(self): - self.buildDependencies["dev-utils/mingw-w64"] = "default" + self.buildDependencies["dev-utils/mingw-w64"] = None class Package(CMakePackageBase): def __init__(self, **args): CMakePackageBase.__init__(self) def configure(self): return True def make(self): self.enterSourceDir() command = [sys.executable, "configure.py", "--bootstrap"] if CraftCore.compiler.isMinGW(): command += ["--platform=mingw"] return utils.system(command) def install(self): utils.copyFile(os.path.join(self.sourceDir(), f"ninja{CraftCore.compiler.executableSuffix}"), os.path.join(self.installDir(), "bin", f"ninja{CraftCore.compiler.executableSuffix}")) return True diff --git a/blueprints/libs/runtime/runtime.py b/blueprints/libs/runtime/runtime.py index 0d2b47aec..75ca8116a 100644 --- a/blueprints/libs/runtime/runtime.py +++ b/blueprints/libs/runtime/runtime.py @@ -1,72 +1,72 @@ import info import glob class subinfo(info.infoclass): def registerOptions(self): self.parent.package.categoryInfo.platforms = CraftCore.compiler.Platforms.Windows def setTargets(self): # not used yet only for reference ver = str(CraftCore.compiler.getVersion()) self.patchLevel[ver] = 1 self.targets[ver] = "" self.description = "The compiler runtime package" self.defaultTarget = ver def setDependencies(self): - self.buildDependencies["virtual/base"] = "default" + self.buildDependencies["virtual/base"] = None if CraftCore.compiler.isMinGW(): - self.buildDependencies["dev-utils/mingw-w64"] = "default" + self.buildDependencies["dev-utils/mingw-w64"] = None from Package.BinaryPackageBase import * class PackageWin(BinaryPackageBase): def __init__(self): BinaryPackageBase.__init__(self) self.subinfo.options.package.disableBinaryCache = CraftCore.compiler.isMSVC() def fetch(self): return True def unpack(self): return True def install(self): destdir = os.path.join(self.installDir(), "bin") utils.createDir(destdir) files = [] if CraftCore.compiler.isMinGW(): files = ['libgomp-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll'] if CraftCore.compiler.isMinGW_W32(): files.append('libgcc_s_sjlj-1.dll') srcdir = os.path.join(self.rootdir, "mingw", "bin") elif CraftCore.compiler.isMinGW_W64(): files.append('libgcc_s_seh-1.dll') srcdir = os.path.join(self.rootdir, "mingw64", "bin") elif CraftCore.compiler.isMSVC(): if self.buildType() != "Debug": if CraftCore.compiler.isMSVC2017(): redistDir = os.environ["VCTOOLSREDISTDIR"] elif CraftCore.compiler.isMSVC2015(): redistDir = os.path.join(os.environ["VCINSTALLDIR"], "redist") if redistDir: files = glob.glob(os.path.join(redistDir, CraftCore.compiler.architecture, "**/*.dll"), recursive=True) else: CraftCore.log.error("Unsupported Compiler") return False for f in files: if not os.path.isabs(f): f = os.path.join(srcdir, f) utils.copyFile(f, os.path.join(destdir, os.path.basename(f)), linkOnly=False) return True from Package.Qt5CorePackageBase import * class Package(Qt5CoreSdkPackageBase): def __init__(self): Qt5CoreSdkPackageBase.__init__(self, condition=OsUtils.isWin(), classA=PackageWin) diff --git a/blueprints/virtual/bin-base/bin-base.py b/blueprints/virtual/bin-base/bin-base.py index 6a75e1a17..fe1644b47 100644 --- a/blueprints/virtual/bin-base/bin-base.py +++ b/blueprints/virtual/bin-base/bin-base.py @@ -1,18 +1,18 @@ import info class subinfo(info.infoclass): def setTargets(self): self.targets['0.2'] = "" self.defaultTarget = '0.2' self.description = "deprecated: use virtual/base instead" def setDependencies(self): - self.runtimeDependencies["virtual/base"] = "default" + self.runtimeDependencies["virtual/base"] = None from Package.VirtualPackageBase import * class Package(VirtualPackageBase): def __init__(self): VirtualPackageBase.__init__(self) diff --git a/internal_blueprints/add-bluprints-template/add-bluprints-template.py b/internal_blueprints/add-bluprints-template/add-bluprints-template.py index 9e36c95ff..acb9272ad 100644 --- a/internal_blueprints/add-bluprints-template/add-bluprints-template.py +++ b/internal_blueprints/add-bluprints-template/add-bluprints-template.py @@ -1,34 +1,34 @@ # This is a internal recipe import info from Blueprints.CraftPackageObject import * class subinfo(info.infoclass): def setTargets(self): self.versionInfo.setDefaultValuesFromFile( os.path.join(CraftCore.settings.get("InternalTemp", "add-bluprints-template.ini"))) def setDependencies(self): # make sure core is up to date first - self.buildDependencies["craft/craft-core"] = "default" + self.buildDependencies["craft/craft-core"] = None from Package.BlueprintRepositoryPackageBase import * class Package(BlueprintRepositoryPackageBase): NameRegex = re.compile(r".*[\/:](.+?(?=[\||\:|\.]))") def __init__(self): BlueprintRepositoryPackageBase.__init__(self) self.subinfo.options.package.disableBinaryCache = True if (("InternalTemp", "add-bluprints-template.ini") not in CraftCore.settings or not os.path.exists(CraftCore.settings.get("InternalTemp", "add-bluprints-template.ini"))): raise BlueprintException(self, "This recipe only works with 'craft --add-blueprint-repository") def checkoutDir(self, index=0): names = Package.NameRegex.findall(self.repositoryUrl()) if len(names) != 1: CraftCore.log.error(f"Failed to determine the blueprint install folder for {self.repositoryUrl()}") return False return os.path.join(CraftStandardDirs.blueprintRoot(), names[0])