Ticket #5454: FileRules-Rule-UntarArchive-v4.patch
File FileRules-Rule-UntarArchive-v4.patch, 3.4 KB (added by , 14 years ago) |
---|
-
build/jam/FileRules
190 190 } 191 191 192 192 193 rule UnzipArchive directory : entries : zipFile : grist193 rule ExtractArchive directory : entries : archiveFile : grist 194 194 { 195 # UnzipArchive <directory> : <entries> : <zipFile> [ : <grist> ]195 # ExtractArchive <directory> : <entries> : <archiveFile> [ : <grist> ] 196 196 # 197 # Unzips the zip file target <zipFile> to directory <directory>. The rule197 # Extract the archive file target <archiveFile> to directory <directory>. The rule 198 198 # can be called multiple times for different <entries> for the same 199 # <directory> and < zipFile> combo.199 # <directory> and <archiveFile> combo. 200 200 # 201 # <directory> - The directory into which to unzip the zipfile. The201 # <directory> - The directory into which to extract the archive file. The 202 202 # directory is created is by this rule and it is the target 203 # that the unzipaction is associated with.203 # that the extract action is associated with. 204 204 # <entries> - The entries of the zip file one is interested in. The rule 205 205 # always unzips the complete zip file, from the given entries 206 206 # the rule creates targets (using <grist>) representing the 207 207 # unzipped entries. Those targets are returned by the rule. 208 # < zipFile> - The zip file target to unzip.208 # <archiveFile> - The archive file target to extract. 209 209 # <grist> - The grist used to create targets from <entries>. Defaults to 210 # " unzipped".210 # "extracted". 211 211 212 grist ?= unzipped ;212 grist ?= extracted ; 213 213 214 214 # Turn the entries into targets to build. 215 215 local targets ; … … 231 231 MkDir $(parentDir) ; 232 232 233 233 NoUpdate $(directory) ; 234 Depends $(directory) : $(zipFile) ; 235 UnzipArchive1 $(directory) : $(zipFile) ; 234 Depends $(directory) : $(archiveFile) ; 235 switch $(archiveFile:S) 236 { 237 case .zip : ExtractZipArchive1 $(directory) : $(archiveFile) ; 238 case .tgz : ExtractTarArchive1 $(directory) : $(archiveFile) ; 239 case * : Exit "ExtractArchive: Unhandled archive extension: $(archiveFile:S)" ; 240 } 236 241 INITIALIZED on $(directory) = 1 ; 237 242 } 238 243 239 244 # Use a dummy rule so that it looks to jam like the targets are actually 240 245 # built from the directory target. 241 UnzipArchiveDummy $(targets) : $(directory) ;246 ExtractArchiveDummy $(targets) : $(directory) ; 242 247 243 248 return $(targets) ; 244 249 } 245 250 246 actions UnzipArchive1251 actions ExtractZipArchive1 247 252 { 248 253 mkdir -p $(1[1]) 249 254 unzip -q -u -o -d $(1[1]) $(2) 250 255 } 251 256 252 actions UnzipArchiveDummy257 actions ExtractTarArchive1 253 258 { 259 mkdir -p $(1[1]) 260 tar -C $(1[1]) -xf $(2) 254 261 } 255 262 263 actions ExtractArchiveDummy 264 { 265 } 256 266 257 267 rule ObjectReference 258 268 { -
build/jam/OptionalBuildFeatures
29 29 $(HAIKU_OPENSSL_PACKAGE) ] ; 30 30 31 31 # unzip headers and libraries 32 HAIKU_OPENSSL_HEADERS_DEPENDENCY = [ UnzipArchive $(HAIKU_OPENSSL_DIR)32 HAIKU_OPENSSL_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_OPENSSL_DIR) 33 33 : common/include/ : $(zipFile) 34 34 ] ; 35 35 36 HAIKU_OPENSSL_LIBS = [ UnzipArchive $(HAIKU_OPENSSL_DIR)36 HAIKU_OPENSSL_LIBS = [ ExtractArchive $(HAIKU_OPENSSL_DIR) 37 37 : 38 38 common/lib/libcrypto.so 39 39 common/lib/libssl.so