Changeset View
Changeset View
Standalone View
Standalone View
portage/win32libs/ghostscript/ghostscript.py
1 | import info | 1 | import info | ||
---|---|---|---|---|---|
2 | import compiler | 2 | from compiler import craftCompiler | ||
3 | import os | 3 | import os | ||
4 | import utils | 4 | import utils | ||
5 | 5 | | |||
6 | class subinfo(info.infoclass): | 6 | class subinfo(info.infoclass): | ||
7 | def setDependencies( self ): | 7 | def setDependencies( self ): | ||
8 | self.runtimeDependencies['virtual/base'] = 'default' | 8 | self.runtimeDependencies['virtual/base'] = 'default' | ||
9 | self.runtimeDependencies['win32libs/zlib'] = 'default' | 9 | self.runtimeDependencies['win32libs/zlib'] = 'default' | ||
10 | if compiler.isMinGW(): | 10 | if craftCompiler.isMinGW(): | ||
11 | self.buildDependencies['dev-util/msys'] = 'default' | 11 | self.buildDependencies['dev-util/msys'] = 'default' | ||
12 | self.runtimeDependencies['win32libs/lcms'] = 'default' | 12 | self.runtimeDependencies['win32libs/lcms'] = 'default' | ||
13 | self.runtimeDependencies['win32libs/lcms2'] = 'default' | 13 | self.runtimeDependencies['win32libs/lcms2'] = 'default' | ||
14 | self.runtimeDependencies['win32libs/freetype'] = 'default' | 14 | self.runtimeDependencies['win32libs/freetype'] = 'default' | ||
15 | self.runtimeDependencies['win32libs/libjpeg-turbo'] = 'default' | 15 | self.runtimeDependencies['win32libs/libjpeg-turbo'] = 'default' | ||
16 | self.runtimeDependencies['win32libs/libpng'] = 'default' | 16 | self.runtimeDependencies['win32libs/libpng'] = 'default' | ||
17 | self.runtimeDependencies['win32libs/tiff'] = 'default' | 17 | self.runtimeDependencies['win32libs/tiff'] = 'default' | ||
18 | 18 | | |||
19 | def setTargets( self ): | 19 | def setTargets( self ): | ||
20 | for ver in ['9.19']: | 20 | for ver in ['9.19']: | ||
21 | 21 | | |||
22 | self.targets[ ver ] = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/ghostscript-%s.tar.gz" % (ver.replace(".",""), ver) | 22 | self.targets[ ver ] = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/ghostscript-%s.tar.gz" % (ver.replace(".",""), ver) | ||
23 | self.targetInstSrc[ver] = 'ghostscript-%s' % ver | 23 | self.targetInstSrc[ver] = 'ghostscript-%s' % ver | ||
24 | self.targetDigestUrls[ver] = (["https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/SHA1SUMS" % ver.replace(".","")], CraftHash.HashAlgorithm.SHA1) | 24 | self.targetDigestUrls[ver] = (["https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/SHA1SUMS" % ver.replace(".","")], CraftHash.HashAlgorithm.SHA1) | ||
25 | 25 | | |||
26 | if compiler.isMinGW(): | 26 | if craftCompiler.isMinGW(): | ||
27 | self.patchToApply['9.19'] = [ | 27 | self.patchToApply['9.19'] = [ | ||
28 | #("mingw-build.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | 28 | #("mingw-build.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | ||
29 | #("ghostscript-sys-zlib.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | 29 | #("ghostscript-sys-zlib.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | ||
30 | ("ghostscript-9.18-20151217.diff", 1), | 30 | ("ghostscript-9.18-20151217.diff", 1), | ||
31 | ("libspectre.patch", 1)# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | 31 | ("libspectre.patch", 1)# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript | ||
32 | ] | 32 | ] | ||
33 | self.defaultTarget = '9.19' | 33 | self.defaultTarget = '9.19' | ||
34 | 34 | | |||
35 | from Package.CMakePackageBase import * | 35 | from Package.CMakePackageBase import * | ||
36 | 36 | | |||
37 | class PackageMSVC(CMakePackageBase): | 37 | class PackageMSVC(CMakePackageBase): | ||
38 | def __init__( self ): | 38 | def __init__( self ): | ||
39 | CMakePackageBase.__init__( self ) | 39 | CMakePackageBase.__init__( self ) | ||
40 | 40 | | |||
41 | def configure( self ): | 41 | def configure( self ): | ||
42 | return True | 42 | return True | ||
43 | 43 | | |||
44 | def make( self ): | 44 | def make( self ): | ||
45 | self.enterSourceDir() | 45 | self.enterSourceDir() | ||
46 | _win64 = "" | 46 | _win64 = "" | ||
47 | _rcomp = "" | 47 | _rcomp = "" | ||
48 | if compiler.isX64(): _win64 = " WIN64=" | 48 | if craftCompiler.isX64(): _win64 = " WIN64=" | ||
49 | # because ghostscript doesn't know about msvc2015, it guesses wrong on this. But, | 49 | # because ghostscript doesn't know about msvc2015, it guesses wrong on this. But, | ||
50 | # because of where we are, rc /should/ be in the path, so we'll just use that. | 50 | # because of where we are, rc /should/ be in the path, so we'll just use that. | ||
51 | if compiler.isMSVC(): _rcomp = " RCOMP=rc.exe" | 51 | if craftCompiler.isMSVC(): _rcomp = " RCOMP=rc.exe" | ||
52 | self.system( "nmake -f psi\\msvc.mak" + _rcomp + _win64 ) | 52 | self.system( "nmake -f psi\\msvc.mak" + _rcomp + _win64 ) | ||
53 | return True | 53 | return True | ||
54 | 54 | | |||
55 | def install( self ): | 55 | def install( self ): | ||
56 | src = self.sourceDir() | 56 | src = self.sourceDir() | ||
57 | dst = self.imageDir() | 57 | dst = self.imageDir() | ||
58 | 58 | | |||
59 | if not os.path.isdir(dst): | 59 | if not os.path.isdir(dst): | ||
60 | os.mkdir(dst) | 60 | os.mkdir(dst) | ||
61 | if not os.path.isdir(os.path.join(dst, "bin")): | 61 | if not os.path.isdir(os.path.join(dst, "bin")): | ||
62 | os.mkdir(os.path.join(dst, "bin")) | 62 | os.mkdir(os.path.join(dst, "bin")) | ||
63 | if not os.path.isdir(os.path.join(dst, "lib")): | 63 | if not os.path.isdir(os.path.join(dst, "lib")): | ||
64 | os.mkdir(os.path.join(dst, "lib")) | 64 | os.mkdir(os.path.join(dst, "lib")) | ||
65 | if not os.path.isdir(os.path.join(dst, "include")): | 65 | if not os.path.isdir(os.path.join(dst, "include")): | ||
66 | os.mkdir(os.path.join(dst, "include")) | 66 | os.mkdir(os.path.join(dst, "include")) | ||
67 | if not os.path.isdir(os.path.join(dst, "include", "ghostscript")): | 67 | if not os.path.isdir(os.path.join(dst, "include", "ghostscript")): | ||
68 | os.mkdir(os.path.join(dst, "include", "ghostscript")) | 68 | os.mkdir(os.path.join(dst, "include", "ghostscript")) | ||
69 | 69 | | |||
70 | if compiler.isX64(): | 70 | if craftCompiler.isX64(): | ||
71 | _bit = "64" | 71 | _bit = "64" | ||
72 | else: | 72 | else: | ||
73 | _bit = "32" | 73 | _bit = "32" | ||
74 | utils.copyFile(os.path.join(src, "bin", "gsdll%s.dll" % _bit), os.path.join(dst, "bin"), False) | 74 | utils.copyFile(os.path.join(src, "bin", "gsdll%s.dll" % _bit), os.path.join(dst, "bin"), False) | ||
75 | utils.copyFile(os.path.join(src, "bin", "gsdll%s.lib" % _bit), os.path.join(dst, "lib"), False) | 75 | utils.copyFile(os.path.join(src, "bin", "gsdll%s.lib" % _bit), os.path.join(dst, "lib"), False) | ||
76 | utils.copyFile(os.path.join(src, "bin", "gswin%s.exe" % _bit), os.path.join(dst, "bin"), False) | 76 | utils.copyFile(os.path.join(src, "bin", "gswin%s.exe" % _bit), os.path.join(dst, "bin"), False) | ||
77 | utils.copyFile(os.path.join(src, "bin", "gswin%sc.exe" % _bit), os.path.join(dst, "bin"), False) | 77 | utils.copyFile(os.path.join(src, "bin", "gswin%sc.exe" % _bit), os.path.join(dst, "bin"), False) | ||
78 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "iapi.h"), os.path.join(self.imageDir(), "include", "ghostscript", "iapi.h"), False) | 78 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "iapi.h"), os.path.join(self.imageDir(), "include", "ghostscript", "iapi.h"), False) | ||
Show All 34 Lines | 105 | def install( self ): | |||
113 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "iapi.h"), os.path.join(self.imageDir(), "include", "ghostscript", "iapi.h"), False) | 113 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "iapi.h"), os.path.join(self.imageDir(), "include", "ghostscript", "iapi.h"), False) | ||
114 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "ierrors.h"), os.path.join(self.imageDir(), "include", "ghostscript", "ierrors.h"), False) | 114 | utils.copyFile(os.path.join(self.sourceDir(), "psi", "ierrors.h"), os.path.join(self.imageDir(), "include", "ghostscript", "ierrors.h"), False) | ||
115 | utils.copyFile(os.path.join(self.sourceDir(), "devices", "gdevdsp.h"), os.path.join(self.imageDir(), "include", "ghostscript", "gdevdsp.h"), False) | 115 | utils.copyFile(os.path.join(self.sourceDir(), "devices", "gdevdsp.h"), os.path.join(self.imageDir(), "include", "ghostscript", "gdevdsp.h"), False) | ||
116 | utils.copyFile(os.path.join(self.sourceDir(), "base", "gserrors.h"), os.path.join(self.imageDir(), "include", "ghostscript", "gserrors.h"), False) | 116 | utils.copyFile(os.path.join(self.sourceDir(), "base", "gserrors.h"), os.path.join(self.imageDir(), "include", "ghostscript", "gserrors.h"), False) | ||
117 | utils.copyDir(os.path.join(self.sourceDir(), "lib"), os.path.join(self.imageDir(), "lib"), False) | 117 | utils.copyDir(os.path.join(self.sourceDir(), "lib"), os.path.join(self.imageDir(), "lib"), False) | ||
118 | return True | 118 | return True | ||
119 | 119 | | |||
120 | 120 | | |||
121 | if compiler.isMinGW(): | 121 | if craftCompiler.isMinGW(): | ||
122 | class Package(PackageMSys): pass | 122 | class Package(PackageMSys): pass | ||
123 | else: | 123 | else: | ||
124 | class Package(PackageMSVC): pass | 124 | class Package(PackageMSVC): pass | ||
125 | No newline at end of file | |