4
4
5
5
usage ()
6
6
{
7
- echo " Usage: $0 BuildArch [--jobs <N>] [--rootfsdir <directory>]"
7
+ echo " Usage: $0 BuildArch [--jobs <N>] [--rootfsdir <directory>] [--haiku-repo <uri>] [--bt-repo <uri>] [-- {extra args}] "
8
8
echo " BuildArch can be: x86, x86_64, x86h, x86_gcc2h"
9
- echo " --rootfsdir dir - optional, defaults to current dir, where to"
10
- echo " put cross-compiler and Haiku sysroot."
11
- echo " --jobs N - optional, restrict to N jobs."
9
+ echo " --rootfsdir dir - defaults to the current dir, where to"
10
+ echo " put cross-compiler and Haiku sysroot."
11
+ echo " --jobs N - restrict to N jobs, defaults to MAXCPUS."
12
+ echo " --haiku-repo uri - alternate uri to clone Haiku repo from."
13
+ echo " --bt-repo uri - alternate uri to clone buildtools from."
14
+ echo " Any additional arguments after -- will be passed directly to"
15
+ echo " Haiku's configure script."
12
16
exit 1
13
17
}
14
18
@@ -48,14 +52,30 @@ while :; do
48
52
shift
49
53
MAXJOBS=$1
50
54
;;
55
+ --haiku-repo|-haiku-repo)
56
+ shift
57
+ __HaikuRepo=$1
58
+ ;;
59
+ --bt-repo|-bt-repo)
60
+ shift
61
+ __BuildToolsRepo=$1
62
+ ;;
63
+ --)
64
+ shift
65
+ break
66
+ ;;
51
67
* )
68
+ echo " Unknown option: $1 "
52
69
usage
53
- ;;
54
70
esac
55
71
56
72
shift
57
73
done
58
74
75
+ if [ $# -gt 0 ]; then
76
+ __ExtraArgs=" $@ "
77
+ fi
78
+
59
79
60
80
if [ -z " $__RootfsDir " ] && [ ! -z " $ROOTFS_DIR " ]; then
61
81
__RootfsDir=$ROOTFS_DIR
@@ -66,6 +86,14 @@ echo "Using $__RootfsDir..."
66
86
mkdir -p $__RootfsDir
67
87
__RootfsDir=" $( cd " $__RootfsDir " && pwd ) "
68
88
89
+ if [ -z " $__HaikuRepo " ]; then
90
+ __HaikuRepo=" https://github.com/haiku/haiku"
91
+ fi
92
+
93
+ if [ -z " $__BuildToolsRepo " ]; then
94
+ __BuildToolsRepo=" https://github.com/haiku/buildtools"
95
+ fi
96
+
69
97
JOBS=${MAXJOBS:= " $( getconf _NPROCESSORS_ONLN) " }
70
98
71
99
if [ -z " $__BuildSecondaryArch " ]; then
76
104
mkdir -p " $__RootfsDir /tmp"
77
105
if [ ! -e " $__RootfsDir /tmp/haiku/.git" ]; then
78
106
cd " $__RootfsDir /tmp"
79
- git clone https://github.com/haiku/haiku
107
+ git clone " $__HaikuRepo "
80
108
cd haiku && git remote add review https://review.haiku-os.org/haiku && git fetch --tags review
81
109
else
82
110
echo " WARN: skipping clone of haiku repo, already exists"
83
- cd haiku && git fetch review
111
+ cd " $__RootfsDir /tmp/ haiku" && git fetch review
84
112
fi
85
113
86
114
if [ ! -e " $__RootfsDir /tmp/buildtools/.git" ]; then
87
115
cd " $__RootfsDir /tmp"
88
- git clone --depth=1 https://github.com/haiku/buildtools
116
+ git clone --depth=1 " $__BuildToolsRepo "
89
117
else
90
118
echo " WARN: skipping clone of buildtools repo, already exists"
91
119
fi
92
120
93
121
# Fetch some patches that haven't been merged yet
94
122
cd " $__RootfsDir /tmp/haiku"
95
123
git reset --hard review/master
96
- # # add development build profile (slimmer than nightly)
97
- git am " $__InitialDir /0002-Add-extra-build-profile-development.patch"
124
+ git am " $__InitialDir /0001-configure-add-missing-sanity-check-for-cross-tools-o.patch"
125
+ git am " $__InitialDir /0002-configure-add-a-version-check-for-python.patch"
126
+ git am " $__InitialDir /0003-build-add-an-optional-UserProfileConfig.patch"
127
+ git am " $__InitialDir /0004-configure-allow-specifying-python-to-use-with-python.patch"
98
128
99
129
# Build jam
100
130
echo ' Building jam buildtool'
101
131
cd " $__RootfsDir /tmp/buildtools/jam"
102
132
make
133
+ ./jam0 -sBINDIR=" $__RootfsDir /bin" install
103
134
104
135
# Configure cross tools
105
136
echo " Building cross tools with $JOBS parallel jobs"
106
137
mkdir -p " $__RootfsDir /generated"
107
138
cd " $__RootfsDir /generated"
108
139
if [ -z " $__BuildSecondaryArch " ]; then
109
- " $__RootfsDir /tmp/haiku/configure" -j" $JOBS " --sysroot " $__RootfsDir " --cross-tools-source " $__RootfsDir /tmp/buildtools" --build-cross-tools $__BuildArch
140
+ " $__RootfsDir /tmp/haiku/configure" -j" $JOBS " --sysroot " $__RootfsDir " --cross-tools-source " $__RootfsDir /tmp/buildtools" --build-cross-tools $__BuildArch $__ExtraArgs
110
141
else
111
- " $__RootfsDir /tmp/haiku/configure" -j" $JOBS " --sysroot " $__RootfsDir " --cross-tools-source " $__RootfsDir /tmp/buildtools" --build-cross-tools $__BuildArch --build-cross-tools $__BuildSecondaryArch
142
+ " $__RootfsDir /tmp/haiku/configure" -j" $JOBS " --sysroot " $__RootfsDir " --cross-tools-source " $__RootfsDir /tmp/buildtools" --build-cross-tools $__BuildArch --build-cross-tools $__BuildSecondaryArch $__ExtraArgs
112
143
fi
113
144
114
145
# Build haiku packages
115
146
echo ' Building Haiku packages and package tool'
116
- echo ' HAIKU_BUILD_PROFILE = "development -raw" ;' > UserProfileConfig
117
- " $__RootfsDir /tmp/buildtools/ jam/jam0 " -j" $JOBS " -q ' <build>package' ' <repository>Haiku'
147
+ echo ' HAIKU_BUILD_PROFILE = "nightly -raw" ;' > UserProfileConfig
148
+ " $__RootfsDir /bin/ jam" -j" $JOBS " -q ' <build>package' ' <repository>Haiku'
118
149
119
150
# Find the package command
120
151
__PackageCommand=` echo $__RootfsDir /generated/objects/* /* /release/tools/package/package`
0 commit comments