Changeset View
Changeset View
Standalone View
Standalone View
autotools/aqbanking/aqbanking.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | # Copyright (C) 2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | 3 | # Copyright (C) 2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||
4 | 4 | | |||
5 | import info | 5 | import info | ||
6 | from Package.AutoToolsPackageBase import * | 6 | from Package.AutoToolsPackageBase import * | ||
7 | from CraftOS.osutils import OsUtils | ||||
7 | 8 | | |||
8 | class subinfo(info.infoclass): | 9 | class subinfo(info.infoclass): | ||
9 | def setTargets(self): | 10 | def setTargets(self): | ||
10 | 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" | 11 | 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" | ||
11 | self.targetDigests["5.7.6"] = (['f9420d8b34c2eee703a7d26dd71a849700fdb2d7372b7649a3488b5a69f55565'], CraftHash.HashAlgorithm.SHA256) | 12 | self.targetDigests["5.7.8"] = (['16f86e4cc49a9eaaa8dfe3206607e627873208bce45a70030c3caea9b5afc768'], CraftHash.HashAlgorithm.SHA256) | ||
12 | self.archiveNames["5.7.6"] = "aqbanking-5.7.6beta.tar.gz" | 13 | self.archiveNames["5.7.8"] = "aqbanking-5.7.8.tar.gz" | ||
13 | self.targetInstSrc["5.7.6"] = "aqbanking-5.7.6beta" | 14 | self.targetInstSrc["5.7.8"] = "aqbanking-5.7.8" | ||
14 | 15 | | |||
15 | self.defaultTarget = "5.7.6" | 16 | self.defaultTarget = "5.7.8" | ||
16 | 17 | | |||
17 | def setDependencies(self): | 18 | def setDependencies(self): | ||
18 | self.runtimeDependencies["virtual/base"] = "default" | 19 | self.runtimeDependencies["virtual/base"] = "default" | ||
19 | self.runtimeDependencies["autotools/ktoblzcheck"] = "default" | 20 | self.runtimeDependencies["autotools/ktoblzcheck"] = "default" | ||
20 | self.runtimeDependencies["autotools/gwenhywfar"] = "default" | 21 | self.runtimeDependencies["autotools/gwenhywfar"] = "default" | ||
21 | if CraftCore.compiler.isMinGW(): | 22 | if CraftCore.compiler.isMinGW(): | ||
22 | self.buildDependencies["dev-util/msys"] = "default" | 23 | self.buildDependencies["dev-util/msys"] = "default" | ||
23 | 24 | | |||
24 | class Package(AutoToolsPackageBase): | 25 | class Package(AutoToolsPackageBase): | ||
25 | def __init__(self, **args): | 26 | def __init__(self, **args): | ||
26 | AutoToolsPackageBase.__init__(self) | 27 | AutoToolsPackageBase.__init__(self) | ||
27 | self.subinfo.options.configure.args += " --disable-static --enable-shared " | 28 | self.subinfo.options.configure.args += " --disable-static --enable-shared " | ||
28 | # this prevents "cannot find the library libaqhbci.la or unhandled argument libaqhbci.la" | 29 | # this prevents "cannot find the library libaqhbci.la or unhandled argument libaqhbci.la" | ||
29 | self.subinfo.options.make.supportsMultijob = False | 30 | self.subinfo.options.make.supportsMultijob = False | ||
31 | | ||||
32 | def install(self): | ||||
33 | if OsUtils.isWin(): | ||||
34 | cmakes = [ os.path.join(self.buildDir(), "aqbanking-config.cmake") ] | ||||
35 | for cmake in cmakes: | ||||
36 | f = open(cmake, "r+") | ||||
37 | cmakeFileContents = f.readlines() | ||||
38 | for i in range(len(cmakeFileContents)): | ||||
39 | m = re.search('set_and_check\(prefix "(?P<root>[^"]*)"\)', cmakeFileContents[i]) | ||||
40 | if m is not None: | ||||
41 | cmakeFileContents[i] = cmakeFileContents[i].replace(m.group('root'), CraftStandardDirs.craftRoot()[:-1]) | ||||
42 | | ||||
43 | m2 = re.search("libaqbanking.so", cmakeFileContents[i]) | ||||
44 | if m2 is not None: | ||||
45 | cmakeFileContents[i] = cmakeFileContents[i].replace("lib/libaqbanking.so", "bin/libaqbanking-35.dll") | ||||
46 | | ||||
47 | f.seek(0) | ||||
48 | f.write(''.join(cmakeFileContents)) | ||||
49 | f.close() | ||||
50 | return AutoToolsPackageBase.install(self) |