Changeset View
Changeset View
Standalone View
Standalone View
portage/win32libs/icu/icu.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- | ||
---|---|---|---|---|---|
2 | import os | 2 | import os | ||
3 | 3 | | |||
4 | import utils | 4 | import utils | ||
5 | import info | 5 | import info | ||
6 | import compiler | 6 | from compiler import craftCompiler | ||
7 | 7 | | |||
8 | 8 | | |||
9 | class subinfo(info.infoclass): | 9 | class subinfo(info.infoclass): | ||
10 | def setTargets( self ): | 10 | def setTargets( self ): | ||
11 | self.svnTargets["svnHEAD"] = "http://source.icu-project.org/repos/icu/icu/trunk" | 11 | self.svnTargets["svnHEAD"] = "http://source.icu-project.org/repos/icu/icu/trunk" | ||
12 | self.targetInstSrc["svnHEAD"] = "source" | 12 | self.targetInstSrc["svnHEAD"] = "source" | ||
13 | for ver in ["53.1", "55.1", "58.2"]: | 13 | for ver in ["53.1", "55.1", "58.2"]: | ||
14 | ver2 = ver.replace(".", "_") | 14 | ver2 = ver.replace(".", "_") | ||
15 | self.targets[ver] = f"http://download.icu-project.org/files/icu4c/{ver}/icu4c-{ver2}-src.tgz" | 15 | self.targets[ver] = f"http://download.icu-project.org/files/icu4c/{ver}/icu4c-{ver2}-src.tgz" | ||
16 | self.targetDigestUrls[ver] = ([f"https://ssl.icu-project.org/files/icu4c/{ver}/icu4c-src-{ver2}.md5"], CraftHash.HashAlgorithm.MD5) | 16 | self.targetDigestUrls[ver] = ([f"https://ssl.icu-project.org/files/icu4c/{ver}/icu4c-src-{ver2}.md5"], CraftHash.HashAlgorithm.MD5) | ||
17 | self.targetInstSrc[ver] = os.path.join("icu", "source") | 17 | self.targetInstSrc[ver] = os.path.join("icu", "source") | ||
18 | if compiler.isMSVC2015() or compiler.isMinGW(): | 18 | if craftCompiler.isMSVC2015() or craftCompiler.isMinGW(): | ||
19 | self.patchToApply["55.1"] = ("icu-20150414.diff", 2) | 19 | self.patchToApply["55.1"] = ("icu-20150414.diff", 2) | ||
20 | if compiler.isMinGW(): | 20 | if craftCompiler.isMinGW(): | ||
21 | self.patchToApply["55.1"] = [("icu-20150414.diff", 2),("icu-msys.diff", 2)] | 21 | self.patchToApply["55.1"] = [("icu-20150414.diff", 2),("icu-msys.diff", 2)] | ||
22 | self.patchToApply["58.2"] = ("0020-workaround-missing-locale.patch", 2)#https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-icu/0020-workaround-missing-locale.patch | 22 | self.patchToApply["58.2"] = ("0020-workaround-missing-locale.patch", 2)#https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-icu/0020-workaround-missing-locale.patch | ||
23 | 23 | | |||
24 | 24 | | |||
25 | self.defaultTarget = "58.2" | 25 | self.defaultTarget = "58.2" | ||
26 | 26 | | |||
27 | def setDependencies( self ): | 27 | def setDependencies( self ): | ||
28 | self.buildDependencies["virtual/base"] = "default" | 28 | self.buildDependencies["virtual/base"] = "default" | ||
29 | if compiler.isMinGW(): | 29 | if craftCompiler.isMinGW(): | ||
30 | self.buildDependencies["dev-util/msys"] = "default" | 30 | self.buildDependencies["dev-util/msys"] = "default" | ||
31 | 31 | | |||
32 | from Package.MSBuildPackageBase import * | 32 | from Package.MSBuildPackageBase import * | ||
33 | 33 | | |||
34 | class PackageCMake(MSBuildPackageBase): | 34 | class PackageCMake(MSBuildPackageBase): | ||
35 | def __init__( self, **args ): | 35 | def __init__( self, **args ): | ||
36 | MSBuildPackageBase.__init__( self ) | 36 | MSBuildPackageBase.__init__( self ) | ||
37 | self.subinfo.options.configure.projectFile = os.path.join(self.sourceDir(), "allinone", "allinone.sln") | 37 | self.subinfo.options.configure.projectFile = os.path.join(self.sourceDir(), "allinone", "allinone.sln") | ||
38 | 38 | | |||
39 | def install(self): | 39 | def install(self): | ||
40 | self.cleanImage() | 40 | self.cleanImage() | ||
41 | if not MSBuildPackageBase.install(self, installHeaders=False, buildDirs=[os.path.join(self.sourceDir(), "..", dir) for dir in ["bin", "bin64", "lib", "lib64"]]): | 41 | if not MSBuildPackageBase.install(self, installHeaders=False, buildDirs=[os.path.join(self.sourceDir(), "..", dir) for dir in ["bin", "bin64", "lib", "lib64"]]): | ||
42 | return False | 42 | return False | ||
43 | utils.copyDir(os.path.join(self.sourceDir(), "..", "include"), os.path.join(self.imageDir(), "include")) | 43 | utils.copyDir(os.path.join(self.sourceDir(), "..", "include"), os.path.join(self.imageDir(), "include")) | ||
44 | 44 | | |||
45 | if compiler.isMSVC() and self.buildType() == "Debug": | 45 | if craftCompiler.isMSVC() and self.buildType() == "Debug": | ||
46 | imagedir = os.path.join( self.installDir(), "lib" ) | 46 | imagedir = os.path.join( self.installDir(), "lib" ) | ||
47 | filelist = os.listdir( imagedir ) | 47 | filelist = os.listdir( imagedir ) | ||
48 | for f in filelist: | 48 | for f in filelist: | ||
49 | if f.endswith( "d.lib" ): | 49 | if f.endswith( "d.lib" ): | ||
50 | utils.copyFile( os.path.join( imagedir, f ), os.path.join( imagedir, f.replace( "d.lib", ".lib" ) ) ) | 50 | utils.copyFile( os.path.join( imagedir, f ), os.path.join( imagedir, f.replace( "d.lib", ".lib" ) ) ) | ||
51 | 51 | | |||
52 | return True | 52 | return True | ||
53 | 53 | | |||
Show All 18 Lines | 71 | def install(self): | |||
72 | if not AutoToolsPackageBase.install(self): | 72 | if not AutoToolsPackageBase.install(self): | ||
73 | return False | 73 | return False | ||
74 | files = os.listdir(os.path.join( self.installDir() , "lib" )) | 74 | files = os.listdir(os.path.join( self.installDir() , "lib" )) | ||
75 | for dll in files: | 75 | for dll in files: | ||
76 | if dll.endswith(".dll"): | 76 | if dll.endswith(".dll"): | ||
77 | utils.copyFile( os.path.join( self.installDir() , "lib" ,dll) , os.path.join( self.installDir(), "bin" ,dll) ) | 77 | utils.copyFile( os.path.join( self.installDir() , "lib" ,dll) , os.path.join( self.installDir(), "bin" ,dll) ) | ||
78 | return True | 78 | return True | ||
79 | 79 | | |||
80 | if compiler.isMinGW(): | 80 | if craftCompiler.isMinGW(): | ||
81 | class Package(PackageMSys): pass | 81 | class Package(PackageMSys): pass | ||
82 | else: | 82 | else: | ||
83 | class Package(PackageCMake): pass | 83 | class Package(PackageCMake): pass | ||
84 | 84 | |