-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMCairo.class.st
133 lines (106 loc) · 2.97 KB
/
CMCairo.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"
This is Cairo library config for building on MacOSX
"
Class {
#name : #CMCairo,
#superclass : #CMCairoBundle,
#category : #'CMakeVMMaker-Libs'
}
{ #category : #'as yet unclassified' }
CMCairo class >> canonicalName [
^ 'cairo'
]
{ #category : #'package properties' }
CMCairo >> archiveMD5Sum [
^ '645b7c1421ed52260d0853e3215c1d8f'
]
{ #category : #'generating actions' }
CMCairo >> build [
gen
puts:
'
add_custom_command(OUTPUT "${libcairoInstalled}"
COMMAND ./configure --prefix=''${installPrefix}'' PKG_CONFIG="${pkgconfigPath}"
PKG_CONFIG_PATH="${installPrefix}/lib/pkgconfig" CFLAGS=''-arch i386'' LDFLAGS=''-arch i386''
--disable-silent-rules --disable-xlib --disable-dependency-tracking
COMMAND make
COMMAND make install
WORKING_DIRECTORY "${libSourcesDir}"
DEPENDS "${unpackTarget}" pkg-config freetype2 libpng pixman
COMMENT "Building ${libName}"
)
'
]
{ #category : #'generating actions' }
CMCairo >> copyArtefacts [
self
copy: '${libcairoInstalled}'
to: '${externalModulesDir}/${libraryFileName}'
]
{ #category : #'generating actions' }
CMCairo >> defineAsTarget [
gen puts:
'add_custom_target(${libName}
DEPENDS pixman freetype2 "${externalModulesDir}/${libraryFileName}"
)'
]
{ #category : #'generating actions' }
CMCairo >> defineGlobalTargets [
| var |
var := self canonicalName , '_LIB'.
vmGen set: var toString: self targetForLinking.
"
define a library as imported one
and make it depend from it's build target
"
vmGen
puts:
('add_library("{1}" SHARED IMPORTED GLOBAL)
set_target_properties("{1}" PROPERTIES IMPORTED_LOCATION "{1}")
add_dependencies("{1}" "{2}")
' format: { '${',var, '}' . self buildTarget }
).
vmGen cmd: 'add_dependencies' params:
vmGen moduleName , ' ' , self buildTarget
]
{ #category : #'package properties' }
CMCairo >> dependencies [
^ #( 'pkg-config' 'pixman' 'libpng' 'freetype2')
]
{ #category : #'package properties' }
CMCairo >> downloadURL [
^ 'http://www.cairographics.org/releases/cairo-1.12.6.tar.xz'
]
{ #category : #'package properties' }
CMCairo >> libraryFileName [
^ 'libcairo.2.dylib'
]
{ #category : #'generating actions' }
CMCairo >> setVariables [
super setVariables.
gen
set: #libraryFileName to: self libraryFileName;
set: #libcairoInstalled toString: '${installPrefix}/lib/${libraryFileName}'.
]
{ #category : #'generating actions' }
CMCairo >> unpack [
"produce commands for unpacking the library archive.
the output of this command should use a directory
${workDir}/${libName}
where the unpacked library sources will be located.
see #setVariables method for understanding what variables used here
NOTE: had to override since cairo uses 7z compression
"
gen set: #unpackTarget toString: '${libSourcesDir}/touch.cmake'.
gen puts:
'add_custom_command(OUTPUT "${unpackTarget}"
COMMAND tar -Jxf "${archiveFileName}"
COMMAND touch "${unpackTarget}"
COMMENT "Unpacking ${libName} ... "
)
'.
]
{ #category : #'package properties' }
CMCairo >> unpackedDirName [
^ 'cairo-1.12.6'
]