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 | | } |
| 78 | array set merger_configure_args { |
| 79 | ppc darwin-ppc-cc |
| 80 | i386 darwin-i386-cc |
| 81 | ppc64 darwin64-ppc-cc |
| 82 | x86_64 darwin64-x86_64-cc |
| 83 | } |
114 | | set basepath "${workpath}/pre-dest/${first_arch}" |
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 | | } |
| 85 | # Do not set --host. |
| 86 | array set merger_host { |
| 87 | ppc "" |
| 88 | i386 "" |
| 89 | ppc64 "" |
| 90 | x86_64 "" |