File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ INPUTFILE=" Xcode_7.3.1.dmg"
5
+ HFSFILENAME=" 5.hfs"
6
+ SDKDIR=" Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"
7
+
8
+ 7z x " ${INPUTFILE} " " ${HFSFILENAME} "
9
+ SDKNAME=" $( basename " ${SDKDIR} " ) "
10
+ SDKDIRINODE=$( ifind -n " ${SDKDIR} " " ${HFSFILENAME} " )
11
+ fls " ${HFSFILENAME} " -rpF ${SDKDIRINODE} |
12
+ while read type inode filename; do
13
+ inode=" ${inode::- 1} "
14
+ if [ " ${filename: 0: 14} " = " usr/share/man/" ]; then
15
+ continue
16
+ fi
17
+ filename=" ${SDKNAME} /$filename "
18
+ echo " Extracting $filename ..."
19
+ mkdir -p " $( dirname " $filename " ) "
20
+ if [ " $type " = " l/l" ]; then
21
+ ln -s " $( icat " ${HFSFILENAME} " $inode ) " " $filename "
22
+ else
23
+ icat " ${HFSFILENAME} " $inode > " $filename "
24
+ fi
25
+ done
26
+ echo " Building ${SDKNAME} .tar.gz ..."
27
+ MTIME=" $( istat " ${HFSFILENAME} " " ${SDKDIRINODE} " | perl -nle ' m/Content Modified:\s+(.*?)\s\(/ && print $1' ) "
28
+ find " ${SDKNAME} " | sort | tar --no-recursion --mtime=" ${MTIME} " --mode=' u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > " ${SDKNAME} .tar.gz"
29
+ echo ' All done!'
Original file line number Diff line number Diff line change @@ -36,11 +36,26 @@ Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.1
36
36
```
37
37
38
38
Unfortunately, the usual linux tools (7zip, hpmount, loopback mount) are incapable of opening this file.
39
- To create a tarball suitable for Gitian input, mount the dmg in OS X, then create it with:
39
+ To create a tarball suitable for Gitian input, there are two options:
40
+
41
+ Using Mac OS X, you can mount the dmg, and then create it with:
40
42
```
43
+ $ hdiutil attach Xcode_7.3.1.dmg
41
44
$ tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.11.sdk.tar.gz MacOSX10.11.sdk
42
45
```
43
46
47
+ Alternatively, you can use 7zip and SleuthKit to extract the files one by one.
48
+ The script contrib/macdeploy/extract-osx-sdk.sh automates this. First ensure
49
+ the dmg file is in the current directory, and then run the script. You may wish
50
+ to delete the intermediate 5.hfs file and MacOSX10.11.sdk (the directory) when
51
+ you've confirmed the extraction succeeded.
52
+
53
+ ``` bash
54
+ apt-get install p7zip-full sleuthkit
55
+ contrib/macdeploy/extract-osx-sdk.sh
56
+ rm -rf 5.hfs MacOSX10.11.sdk
57
+ ```
58
+
44
59
The Gitian descriptors build 2 sets of files: Linux tools, then Apple binaries
45
60
which are created using these tools. The build process has been designed to
46
61
avoid including the SDK's files in Gitian's outputs. All interim tarballs are
You can’t perform that action at this time.
0 commit comments