Skip to content

Commit fb33cb2

Browse files
committed
build: updated dependency build requirements
1 parent 5e4531c commit fb33cb2

File tree

4 files changed

+19
-25
lines changed

4 files changed

+19
-25
lines changed

.github/workflows/build.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ jobs:
5454
- name: Setup Path
5555
shell: bash
5656
run: |
57-
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
57+
echo "/usr/local/opt/bison/bin:/opt/homebrew/opt/bison/bin" >> $GITHUB_PATH
5858
- name: Build Sysroot
5959
if: steps.cache-sysroot.outputs.cache-hit != 'true'
6060
run: |
6161
brew uninstall cmake
62-
brew install bison pkg-config nasm make meson glib-utils python3
63-
brew unlink python && brew link [email protected]
64-
pip3 install six pyparsing
62+
brew install bison pkg-config gettext glib-utils libgpg-error nasm make meson
63+
pip3 install --user six pyparsing
6564
rm -f /usr/local/lib/pkgconfig/*.pc
6665
./scripts/build_dependencies.sh -p ${{ matrix.platform }} -a ${{ matrix.arch }}
6766
- name: Compress Sysroot

Documentation/MacDevelopment.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ If you want to build the dependencies yourself, it is highly recommended that yo
2121

2222
1. Install Xcode command line and [Homebrew][1]
2323
2. Install the following build prerequisites
24-
`brew install bison pkg-config gettext glib-utils libgpg-error nasm make meson`
25-
Make sure to add `bison` and `gettext` to your `$PATH` environment variable!
26-
`export PATH=/usr/local/opt/bison/bin:/usr/local/opt/gettext/bin:$PATH`
24+
`brew install bison pkg-config gettext glib-utils libgpg-error nasm meson`
25+
`pip3 install six pyparsing`
26+
Make sure to add `bison` to your `$PATH` environment variable!
27+
`export PATH=/usr/local/opt/bison/bin:/opt/homebrew/opt/bison/bin:$PATH`
2728
3. Run `./scripts/build_dependencies.sh -p macos -a ARCH` where `ARCH` is either `arm64` or `x86_64`.
2829

2930
If you want to build universal binaries, you need to run `build_dependencies.sh` for both `arm64` and `x86_64` and then run

Documentation/iOSDevelopment.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ If you want to build the dependencies yourself, it is highly recommended that yo
2828

2929
1. Install Xcode command line and [Homebrew][1]
3030
2. Install the following build prerequisites
31-
`brew install bison pkg-config gettext glib-utils libgpg-error nasm make meson`
32-
Make sure to add `bison` and `gettext` to your `$PATH` environment variable!
33-
`export PATH=/usr/local/opt/bison/bin:/usr/local/opt/gettext/bin:$PATH`
31+
`brew install bison pkg-config gettext glib-utils libgpg-error nasm meson`
32+
`pip3 install six pyparsing`
33+
Make sure to add `bison` to your `$PATH` environment variable!
34+
`export PATH=/usr/local/opt/bison/bin:/opt/homebrew/opt/bison/bin:$PATH`
3435
3. Run `./scripts/build_dependencies.sh -p PLATFORM -a ARCHITECTURE` where `ARCHITECTURE` is the last part of the table above (e.g. `x86_64`) and `PLATFORM` is the first part (e.g. `ios_simulator-tci`).
3536
4. Repeat the above for any other platforms and architectures you wish to target.
3637

scripts/build_dependencies.sh

+8-15
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ command -v realpath >/dev/null 2>&1 || realpath() {
3535
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
3636
}
3737

38+
version_check() {
39+
[ "$1" = "$(echo "$1\n$2" | sort -V | head -n1)" ]
40+
}
41+
3842
usage () {
3943
echo "Usage: [VARIABLE...] $(basename $0) [-p platform] [-a architecture] [-q qemu_path] [-d] [-r]"
4044
echo ""
@@ -61,15 +65,14 @@ check_env () {
6165
command -v python3 >/dev/null 2>&1 || { echo >&2 "${RED}You must install 'python3' on your host machine.${NC}"; exit 1; }
6266
python_module_test six >/dev/null 2>&1 || { echo >&2 "${RED}'six' not found in your Python 3 installation.${NC}"; exit 1; }
6367
python_module_test pyparsing >/dev/null 2>&1 || { echo >&2 "${RED}'pyparsing' not found in your Python 3 installation.${NC}"; exit 1; }
64-
command -v gmake >/dev/null 2>&1 || { echo >&2 "${RED}You must install GNU make on your host machine (and link it to 'gmake').${NC}"; exit 1; }
6568
command -v meson >/dev/null 2>&1 || { echo >&2 "${RED}You must install 'meson' on your host machine.${NC}"; exit 1; }
6669
command -v msgfmt >/dev/null 2>&1 || { echo >&2 "${RED}You must install 'gettext' on your host machine.\n\t'msgfmt' needs to be in your \$PATH as well.${NC}"; exit 1; }
6770
command -v glib-mkenums >/dev/null 2>&1 || { echo >&2 "${RED}You must install 'glib-utils' on your host machine.\n\t'glib-mkenums' needs to be in your \$PATH as well.${NC}"; exit 1; }
6871
command -v gpg-error-config >/dev/null 2>&1 || { echo >&2 "${RED}You must install 'libgpg-error' on your host machine.\n\t'gpg-error-config' needs to be in your \$PATH as well.${NC}"; exit 1; }
6972
command -v xcrun >/dev/null 2>&1 || { echo >&2 "${RED}'xcrun' is not found. Make sure you are running on OSX."; exit 1; }
7073
command -v otool >/dev/null 2>&1 || { echo >&2 "${RED}'otool' is not found. Make sure you are running on OSX."; exit 1; }
7174
command -v install_name_tool >/dev/null 2>&1 || { echo >&2 "${RED}'install_name_tool' is not found. Make sure you are running on OSX."; exit 1; }
72-
# TODO: check bison version >= 2.4
75+
version_check "2.4" "$(bison -V | head -1 | awk '{ print $NF }')" || { echo >&2 "${RED}'bison' >= 2.4 is required. Did you install from Homebrew and updated your \$PATH variable?"; exit 1; }
7376
}
7477

7578
download () {
@@ -177,6 +180,7 @@ copy_private_headers() {
177180
LC_ALL=C sed -i '' -e 's/#if !KERNEL_USER32/#if 1/g' $(find "$OUTPUT_INCLUDES/IOKit" -type f)
178181
LC_ALL=C sed -i '' -e 's/#if KERNEL/#if 0/g' $(find "$OUTPUT_INCLUDES/IOKit" -type f)
179182
LC_ALL=C sed -i '' -e 's/#if !KERNEL/#if 1/g' $(find "$OUTPUT_INCLUDES/IOKit" -type f)
183+
LC_ALL=C sed -i '' -e 's/__UNAVAILABLE_PUBLIC_IOS;//g' $(find "$OUTPUT_INCLUDES/IOKit" -type f)
180184
mkdir -p "$OUTPUT_INCLUDES/libkern"
181185
cp -r "$OSTYPES_HEADERS_PATH/OSTypes.h" "$OUTPUT_INCLUDES/libkern/OSTypes.h"
182186
}
@@ -204,6 +208,7 @@ generate_meson_cross() {
204208
echo "pkgconfig = ['$PREFIX/host/bin/pkg-config']" >> $cross
205209
echo "ranlib = [$(meson_quote $RANLIB)]" >> $cross
206210
echo "strip = [$(meson_quote $STRIP), '-x']" >> $cross
211+
echo "python = ['$(which python3)']" >> $cross
207212
echo "[host_machine]" >> $cross
208213
case $PLATFORM in
209214
ios* )
@@ -464,18 +469,6 @@ build_qemu_dependencies () {
464469
meson_build $VIRGLRENDERER_REPO -Dtests=false
465470
}
466471

467-
build_qemu () {
468-
pwd="$(pwd)"
469-
cd "$QEMU_DIR"
470-
echo "${GREEN}Configuring QEMU...${NC}"
471-
./configure --prefix="$PREFIX" --host="$CHOST" --cross-prefix="" $@
472-
echo "${GREEN}Building QEMU...${NC}"
473-
gmake -j$NCPU
474-
echo "${GREEN}Installing QEMU...${NC}"
475-
gmake install
476-
cd "$pwd"
477-
}
478-
479472
build_spice_client () {
480473
meson_build "$QEMU_DIR/subprojects/libucontext" -Ddefault_library=static -Dfreestanding=true
481474
meson_build $JSON_GLIB_SRC -Dintrospection=disabled
@@ -761,7 +754,7 @@ rm -f "$BUILD_DIR/meson.cross"
761754
copy_private_headers
762755
build_pkg_config
763756
build_qemu_dependencies
764-
build_qemu $QEMU_PLATFORM_BUILD_FLAGS
757+
build $QEMU_SRC --cross-prefix="" $QEMU_PLATFORM_BUILD_FLAGS
765758
build_spice_client
766759
fixup_all
767760
remove_shared_gst_plugins # another hack...

0 commit comments

Comments
 (0)