49 | | livecheck.check regex |
50 | | livecheck.url ${master_sites} |
51 | | livecheck.regex ${name}-(0.9.8\[a-z\]) |
52 | | |
53 | | if { ![info exists universal_archs] } { |
54 | | set universal_archs {i386 ppc} |
55 | | #set universal_archs {i386 x86_64 ppc ppc64} |
| 50 | post-patch { |
| 51 | # Ensure that the correct compiler is used |
| 52 | reinplace "s|cc:|${configure.cc}:|" ${worksrcpath}/Configure |
| 53 | |
| 54 | # For universal builds, add "-isysroot ${universal_sysroot}" to compiler options |
| 55 | if { [variant_isset universal] } { |
| 56 | reinplace "s|\\(-arch \[_a-zA-Z0-9\]*\\)|\\1 -isysroot ${universal_sysroot}|" ${worksrcpath}/Configure |
| 57 | } |
92 | | |
93 | | destroot { |
94 | | # in port 1.7, just call: |
95 | | # merge "${workpath}/pre-dest" |
96 | | # till then, do this: |
97 | | foreach arch ${universal_archs} { |
98 | | xinstall -d ${workpath}/pre-dest/${arch} |
99 | | system "cd ${workpath}/${arch} && make install INSTALL_PREFIX=${workpath}/pre-dest/${arch} MANDIR=${prefix}/share/man" |
100 | | |
101 | | # opensslconf.h will differ between 32- and 64-bit, so patch it so it doesn't |
102 | | if { [string first 64 $arch] != -1 } { |
103 | | if { [string first ppc $arch] != -1 } { |
104 | | set configpatch ${filespath}/patch-opensslconf.h-ppc64.diff |
105 | | } else { |
106 | | set configpatch ${filespath}/patch-opensslconf.h-x86_64.diff |
107 | | } |
108 | | } else { |
109 | | set configpatch ${filespath}/patch-opensslconf.h-32.diff |
110 | | } |
111 | | system "cd ${workpath}/pre-dest/${arch}${prefix} && patch --no-backup-if-mismatch -p0 < ${configpatch}" |
112 | | } |
113 | | |
114 | | set basepath "${workpath}/pre-dest/i386" |
115 | | fs-traverse file "${basepath}" { |
116 | | set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]] |
117 | | if {${fpath} != ""} { |
118 | | ui_debug ":: ${fpath}" |
119 | | |
120 | | switch -exact [file type "${basepath}${fpath}"] { |
121 | | directory { |
122 | | # just create directories |
123 | | ui_debug "-- dir:: ${fpath}" |
124 | | file mkdir "${destroot}${fpath}" |
125 | | } |
126 | | link { |
127 | | # copy symlinks (TODO: check if target matches) |
128 | | ui_debug "-- lnk:: ${fpath}" |
129 | | file copy "${basepath}${fpath}" "${destroot}${fpath}" |
130 | | } |
131 | | file { |
132 | | # treat files depending on their filetype |
133 | | ui_debug "-- file:: ${fpath}" |
134 | | set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"] |
135 | | switch -regexp ${filetype} { |
136 | | Mach-O.* { |
137 | | # Mach-O binaries get lipo-ed |
138 | | ui_debug "Mach-O file -- lipo-ing" |
139 | | set machocmd "lipo" |
140 | | foreach arch ${universal_archs} { |
141 | | set machocmd "${machocmd} -arch $arch ${workpath}/pre-dest/${arch}/${fpath}" |
142 | | } |
143 | | set machocmd "${machocmd} -create -output ${destroot}${fpath}" |
144 | | system ${machocmd} |
145 | | } |
146 | | current\ ar\ archive { |
147 | | # ar archives get lipo-ed |
148 | | ui_debug "ar archive -- lipo-ing" |
149 | | set arcmd "lipo" |
150 | | foreach arch ${universal_archs} { |
151 | | set arcmd "${arcmd} -arch $arch ${workpath}/pre-dest/${arch}/${fpath}" |
152 | | } |
153 | | set arcmd "${arcmd} -create -output ${destroot}${fpath}" |
154 | | system ${arcmd} |
155 | | } |
156 | | default { |
157 | | # unknown file types are copied IF they do not differ across ALL architectures -- if they do: This is an error! |
158 | | ui_debug "unknown filetype: ${filetype}" |
159 | | |
160 | | set any_difference no |
161 | | foreach arch ${universal_archs} { |
162 | | if {![string equal ${arch} ${first_arch}]} { |
163 | | set differ1 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/${first_arch}/${fpath}" "${workpath}/pre-dest/${arch}/${fpath}"] |
164 | | if {![string equal ${differ1} ""]} { |
165 | | set any_difference yes |
166 | | } |
167 | | } |
168 | | } |
169 | | if {${any_difference}} { |
170 | | ui_debug "ERROR: files differ" |
171 | | } else { |
172 | | ui_debug "files match, just copying" |
173 | | file copy "${basepath}${fpath}" "${destroot}${fpath}" |
174 | | } |
175 | | } |
176 | | } |
177 | | } |
178 | | default { ui_debug "serious error" } |
179 | | } |
180 | | } |
181 | | } |
| 72 | array set merger_configure_args { |
| 73 | ppc darwin-ppc-cc |
| 74 | i386 darwin-i386-cc |
| 75 | ppc64 darwin64-ppc-cc |
| 76 | x86_64 darwin64-x86_64-cc |
| 77 | } |
| 78 | array set merger_host { |
| 79 | ppc "" |
| 80 | i386 "" |
| 81 | ppc64 "" |
| 82 | x86_64 "" |