diff --git a/autotools/aqbanking/aqbanking.py b/autotools/aqbanking/aqbanking.py index 4dc1d95a..b852c395 100644 --- a/autotools/aqbanking/aqbanking.py +++ b/autotools/aqbanking/aqbanking.py @@ -1,29 +1,50 @@ # -*- coding: utf-8 -*- # Copyright (C) 2018 Łukasz Wojniłowicz import info from Package.AutoToolsPackageBase import * +from CraftOS.osutils import OsUtils class subinfo(info.infoclass): def setTargets(self): - self.targets["5.7.6"] = "https://www.aquamaniac.de/sites/download/download.php?package=03&release=215&file=01&dummy=aqbanking-5.7.6beta.tar.gz" - self.targetDigests["5.7.6"] = (['f9420d8b34c2eee703a7d26dd71a849700fdb2d7372b7649a3488b5a69f55565'], CraftHash.HashAlgorithm.SHA256) - self.archiveNames["5.7.6"] = "aqbanking-5.7.6beta.tar.gz" - self.targetInstSrc["5.7.6"] = "aqbanking-5.7.6beta" + self.targets["5.7.8"] = "https://www.aquamaniac.de/sites/download/download.php?package=03&release=217&file=02&dummy=aqbanking-5.7.8.tar.gz" + self.targetDigests["5.7.8"] = (['16f86e4cc49a9eaaa8dfe3206607e627873208bce45a70030c3caea9b5afc768'], CraftHash.HashAlgorithm.SHA256) + self.archiveNames["5.7.8"] = "aqbanking-5.7.8.tar.gz" + self.targetInstSrc["5.7.8"] = "aqbanking-5.7.8" - self.defaultTarget = "5.7.6" + self.defaultTarget = "5.7.8" def setDependencies(self): self.runtimeDependencies["virtual/base"] = "default" self.runtimeDependencies["autotools/ktoblzcheck"] = "default" self.runtimeDependencies["autotools/gwenhywfar"] = "default" if CraftCore.compiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" class Package(AutoToolsPackageBase): def __init__(self, **args): AutoToolsPackageBase.__init__(self) self.subinfo.options.configure.args += " --disable-static --enable-shared " # this prevents "cannot find the library libaqhbci.la or unhandled argument libaqhbci.la" self.subinfo.options.make.supportsMultijob = False + + def install(self): + if OsUtils.isWin(): + cmakes = [ os.path.join(self.buildDir(), "aqbanking-config.cmake") ] + for cmake in cmakes: + f = open(cmake, "r+") + cmakeFileContents = f.readlines() + for i in range(len(cmakeFileContents)): + m = re.search('set_and_check\(prefix "(?P[^"]*)"\)', cmakeFileContents[i]) + if m is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace(m.group('root'), CraftStandardDirs.craftRoot()[:-1]) + + m2 = re.search("libaqbanking.so", cmakeFileContents[i]) + if m2 is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace("lib/libaqbanking.so", "bin/libaqbanking-35.dll") + + f.seek(0) + f.write(''.join(cmakeFileContents)) + f.close() + return AutoToolsPackageBase.install(self) diff --git a/autotools/gwenhywfar/gwenhywfar-4.19.0-20180218.diff b/autotools/gwenhywfar/gwenhywfar-4.19.0-20180218.diff new file mode 100644 index 00000000..de581b5f --- /dev/null +++ b/autotools/gwenhywfar/gwenhywfar-4.19.0-20180218.diff @@ -0,0 +1,11 @@ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x'*\.o' gwenhywfar-4.19.0.orig/configure gwenhywfar-4.19.0/configure +--- gwenhywfar-4.19.0.orig/configure 2017-07-30 15:20:32.000000000 +0100 ++++ gwenhywfar-4.19.0/configure 2018-02-18 11:55:48.614397600 +0100 +@@ -22480,6 +22480,7 @@ + + # Get Qt version from qmake + QT_DIR=`$QT_QMAKE --version | grep -o -E /.+` ++ QT_LIBS="-L`$QT_QMAKE --version | grep -o -E .:.+` -lQt5Widgets -lQt5Gui -lQt5Core" + + # All variables are defined, report the result + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt: \ No newline at end of file diff --git a/autotools/gwenhywfar/gwenhywfar-qt-detection.diff b/autotools/gwenhywfar/gwenhywfar-qt-detection.diff deleted file mode 100644 index 4e99f333..00000000 --- a/autotools/gwenhywfar/gwenhywfar-qt-detection.diff +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nru gwenhywfar-4.18.0-unpatched/configure gwenhywfar-4.18.0/configure ---- gwenhywfar-4.18.0-unpatched/configure 2017-07-30 16:20:32.000000000 +0200 -+++ gwenhywfar-4.18.0/configure 2018-02-07 18:58:10.345398600 +0100 -@@ -22450,9 +22450,15 @@ - QMAKE_EXTRA_TARGETS += percent - EOF - $QT_QMAKE $am_have_qt_pro -o $am_have_qt_makefile -- QT_CXXFLAGS=`make -s -f $am_have_qt_makefile CXXFLAGS INCPATH` -- QT_LIBS=`make -s -f $am_have_qt_makefile LIBS` -- rm $am_have_qt_pro $am_have_qt_makefile -+ # Check whether --enable-debug was given. -+ if test "${enable_debug+set}" = set; then : -+ QT_CXXFLAGS=`make -s -f $am_have_qt_makefile.Debug CXXFLAGS INCPATH` -+ QT_LIBS=`make -s -f $am_have_qt_makefile.Debug LIBS` -+ else -+ QT_CXXFLAGS=`make -s -f $am_have_qt_makefile.Release CXXFLAGS INCPATH` -+ QT_LIBS=`make -s -f $am_have_qt_makefile.Release LIBS` -+ fi -+ rm $am_have_qt_pro $am_have_qt_makefile.Release $am_have_qt_makefile.Debug - - # Look for specific tools in $PATH - diff --git a/autotools/gwenhywfar/gwenhywfar.py b/autotools/gwenhywfar/gwenhywfar.py index 12783415..6639e7c6 100644 --- a/autotools/gwenhywfar/gwenhywfar.py +++ b/autotools/gwenhywfar/gwenhywfar.py @@ -1,43 +1,74 @@ # -*- coding: utf-8 -*- # Copyright (C) 2018 Łukasz Wojniłowicz +import re import info from Package.AutoToolsPackageBase import * +from CraftOS.osutils import OsUtils class subinfo(info.infoclass): def setTargets(self): - self.targets["4.18"] = "https://www.aquamaniac.de/sites/download/download.php?package=01&release=206&file=01&dummy=gwenhywfar-4.18.0.tar.gz" - self.targetDigests["4.18"] = (['6915bba42d8b7f0213cee186a944296e5e5e97cdbde5b539a924261af03086ca'], CraftHash.HashAlgorithm.SHA256) - self.archiveNames["4.18"] = "gwenhywfar-4.18.0.tar.gz" - self.targetInstSrc["4.18"] = "gwenhywfar-4.18.0" - self.patchToApply["4.18"] = [("gwenhywfar-qt-detection.diff", 1)] - self.defaultTarget = "4.18" + self.targets["4.19"] = "https://www.aquamaniac.de/sites/download/download.php?package=01&release=207&file=01&dummy=gwenhywfar-4.19.0.tar.gz" + self.targetDigests["4.19"] = (['c54a9a162dc63ab69e4d3fc946aae92b929383ca60a2690b539adcdc58de9495'], CraftHash.HashAlgorithm.SHA256) + self.archiveNames["4.19"] = "gwenhywfar-4.19.0.tar.gz" + self.targetInstSrc["4.19"] = "gwenhywfar-4.19.0" + self.patchToApply["4.19"] = [("gwenhywfar-4.19.0-20180218.diff", 1)] + # self.patchToApply["4.19"] = [("gwenhywfar-qt-detection.diff", 1)] + self.defaultTarget = "4.19" def setDependencies(self): self.runtimeDependencies["virtual/base"] = "default" self.runtimeDependencies["win32libs/xmlsec1"] = "default" self.runtimeDependencies["win32libs/gnutls"] = "default" self.runtimeDependencies["win32libs/gcrypt"] = "default" self.runtimeDependencies["libs/qt5/qtbase"] = "default" if CraftCore.compiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" # 2018-02-11: compilation is successful if xmlmerge.exe gives any output in the console. For it to happen gnutls must be compiled with --enable-nls --enable-openssl-compatibility class Package(AutoToolsPackageBase): def __init__(self, **args): AutoToolsPackageBase.__init__(self) - self.subinfo.options.configure.args = " --disable-static --enable-shared --disable-binreloc --with-guis=cpp qt5 " + self.subinfo.options.configure.args += " --disable-static --enable-shared --disable-binreloc --with-guis='qt5 cpp'" def configure(self): _, includedir = CraftCore.cache.getCommandOutput("qmake", "-query QT_INSTALL_HEADERS") includedir = self.shell.toNativePath(includedir.strip()) widgetsdir = self.shell.toNativePath(os.path.join(includedir , "QtWidgets")) guidir = self.shell.toNativePath(os.path.join(includedir , "QtGui")) coredir = self.shell.toNativePath(os.path.join(includedir , "QtCore")) - self.subinfo.options.configure.ldflags += '-lQt5Widgets -lQt5Gui -lQt5Core ' self.subinfo.options.configure.cxxflags += f"-I{widgetsdir} -I{guidir} -I{coredir} -I{includedir} " return super().configure() + def install(self): + if OsUtils.isWin(): + cmakes = [ os.path.join(self.buildDir(), "gui", "cpp", "gwengui-cpp-config.cmake"), + os.path.join(self.buildDir(), "gui", "qt5", "gwengui-qt5-config.cmake"), + os.path.join(self.buildDir(), "gwenhywfar-config.cmake") + ] + for cmake in cmakes: + f = open(cmake, "r+") + cmakeFileContents = f.readlines() + for i in range(len(cmakeFileContents)): + m = re.search('set_and_check\(prefix "(?P[^"]*)"\)', cmakeFileContents[i]) + if m is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace(m.group('root'), CraftStandardDirs.craftRoot()[:-1]) + m2 = re.search("libgwenhywfar.so.(?P[\d]*)", cmakeFileContents[i]) + if m2 is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace("lib/" + m2.group(0), "bin/libgwenhywfar-" + m2.group('number') +".dll") + + m3 = re.search("libgwengui-cpp.so", cmakeFileContents[i]) + if m3 is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace("lib/libgwengui-cpp.so", "bin/libgwengui-cpp-0.dll") + + m4 = re.search("libgwengui-qt5.so", cmakeFileContents[i]) + if m4 is not None: + cmakeFileContents[i] = cmakeFileContents[i].replace("lib/libgwengui-qt5.so", "lib/libgwengui-qt5.a") + + f.seek(0) + f.write(''.join(cmakeFileContents)) + f.close() + return AutoToolsPackageBase.install(self)