Skip to content

Commit 3260ced

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

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 4 deletions
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 python@3.10
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 7 additions & 15 deletions
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 () {
@@ -204,6 +207,7 @@ generate_meson_cross() {
204207
echo "pkgconfig = ['$PREFIX/host/bin/pkg-config']" >> $cross
205208
echo "ranlib = [$(meson_quote $RANLIB)]" >> $cross
206209
echo "strip = [$(meson_quote $STRIP), '-x']" >> $cross
210+
echo "python = ['$(which python3)']" >> $cross
207211
echo "[host_machine]" >> $cross
208212
case $PLATFORM in
209213
ios* )
@@ -464,18 +468,6 @@ build_qemu_dependencies () {
464468
meson_build $VIRGLRENDERER_REPO -Dtests=false
465469
}
466470

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-
479471
build_spice_client () {
480472
meson_build "$QEMU_DIR/subprojects/libucontext" -Ddefault_library=static -Dfreestanding=true
481473
meson_build $JSON_GLIB_SRC -Dintrospection=disabled
@@ -761,7 +753,7 @@ rm -f "$BUILD_DIR/meson.cross"
761753
copy_private_headers
762754
build_pkg_config
763755
build_qemu_dependencies
764-
build_qemu $QEMU_PLATFORM_BUILD_FLAGS
756+
build $QEMU_SRC --cross-prefix="" $QEMU_PLATFORM_BUILD_FLAGS
765757
build_spice_client
766758
fixup_all
767759
remove_shared_gst_plugins # another hack...

0 commit comments

Comments
 (0)