Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install meson+ninja on buildscripts, bump glib #2549

Merged
merged 3 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions buildconfig/macdependencies/build_mac_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export PG_BASE_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PG_DEP_PREFIX \

export PG_BASE_CONFIGURE_FLAGS="--prefix=$PG_DEP_PREFIX"

export PG_BASE_MESON_FLAGS="--prefix=$PG_DEP_PREFIX \
-Dlibdir=lib \
-Dbuildtype=release \
-Ddefault_library=shared"

if [[ "$MAC_ARCH" == "arm64" ]]; then
# for scripts using ./configure to make arm64 binaries
export CC="clang -target arm64-apple-macos11.0"
Expand All @@ -45,6 +50,9 @@ if [[ "$MAC_ARCH" == "arm64" ]]; then
# configure cmake to cross-compile
export PG_BASE_CMAKE_FLAGS="$PG_BASE_CMAKE_FLAGS -DCMAKE_OSX_ARCHITECTURES=arm64"

# configure meson to cross-compile
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --cross-file $(pwd)/macos_arm64.ini"

# we don't need mac 10.9 support while compiling for apple M1 macs
export MACOSX_DEPLOYMENT_TARGET=11.0
else
Expand All @@ -54,13 +62,19 @@ else
# SDL 2.26.5 new minimum macos is 10.11, so we build our x86 mac deps
# for 10.11 as well.
export MACOSX_DEPLOYMENT_TARGET=10.11

# needs native-file that has correct macosx deployment target
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --native-file $(pwd)/macos_x86_64.ini"
fi

cd ../manylinux-build/docker_base

# Now start installing dependencies
# ---------------------------------

# install some buildtools
bash buildtools/install.sh

# sdl_image deps
bash zlib-ng/build-zlib-ng.sh
bash libpng/build-png.sh # depends on zlib
Expand All @@ -81,8 +95,8 @@ bash mpg123/build-mpg123.sh
bash opus/build-opus.sh # needs libogg (which is a container format)

# fluidsynth (for sdl_mixer)
bash gettext/build-gettext.sh
bash glib/build-glib.sh # depends on gettext
# bash gettext/build-gettext.sh
bash glib/build-glib.sh
bash sndfile/build-sndfile.sh
bash fluidsynth/build-fluidsynth.sh

Expand Down
2 changes: 1 addition & 1 deletion buildconfig/macdependencies/clean_usr_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rm -rf /usr/local/Cellar/libtiff
rm -rf /usr/local/Cellar/libsndfile
rm -rf /usr/local/Cellar/glib
rm -rf /usr/local/Cellar/brotli
rm -rf /usr/local/Cellar/pcre
rm -rf /usr/local/Cellar/pcre*
rm -rf /usr/local/Cellar/opusfile
rm -rf /usr/local/Cellar/opus
rm -rf /usr/local/Cellar/freetype
Expand Down
28 changes: 28 additions & 0 deletions buildconfig/macdependencies/macos_arm64.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[constants]
macos_ver = ['-mmacosx-version-min=11.0']
macos_arch = ['-arch', 'arm64']

[host_machine]
system = 'darwin'
cpu_family = 'aarch64'
cpu = 'arm64'
endian = 'little'

[binaries]
c = ['clang']
cpp = ['clang++']
objc = ['clang']
objcpp = ['clang++']
ar = ['ar']
strip = ['strip']
pkgconfig = ['pkg-config']

[built-in options]
c_args = macos_arch + macos_ver
cpp_args = macos_arch + macos_ver + ['-stdlib=libc++']
objc_args = macos_arch + macos_ver
objcpp_args = macos_arch + macos_ver + ['-stdlib=libc++']
c_link_args = macos_arch + macos_ver
cpp_link_args = macos_arch + macos_ver
objc_link_args = macos_arch + macos_ver
objcpp_link_args = macos_arch + macos_ver
21 changes: 21 additions & 0 deletions buildconfig/macdependencies/macos_x86_64.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[constants]
macos_ver = ['-mmacosx-version-min=10.11']

[binaries]
c = ['clang']
cpp = ['clang++']
objc = ['clang']
objcpp = ['clang++']
ar = ['ar']
strip = ['strip']
pkgconfig = ['pkg-config']

[built-in options]
c_args = macos_ver
cpp_args = macos_ver + ['-stdlib=libc++']
objc_args = macos_ver
objcpp_args = macos_ver + ['-stdlib=libc++']
c_link_args = macos_ver
cpp_link_args = macos_ver
objc_link_args = macos_ver
objcpp_link_args = macos_ver
17 changes: 13 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ ENV PG_BASE_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PG_DEP_PREFIX \

ENV PG_BASE_CONFIGURE_FLAGS="--prefix=$PG_DEP_PREFIX"

ENV PG_BASE_MESON_FLAGS="--prefix=$PG_DEP_PREFIX \
-Dlibdir=lib \
-Dbuildtype=release \
-Ddefault_library=shared"

# remember to keep this updated when we drop 3.11 support
ENV PATH="/opt/python/cp311-cp311/bin:$PATH"

ADD pkg-config /pkg-config_build/
RUN ["bash", "/pkg-config_build/build-pkg-config.sh"]

ADD cmake /cmake_build/
RUN ["bash", "/cmake_build/build-cmake.sh"]
ADD buildtools /buildtools/
RUN ["bash", "/buildtools/install.sh"]

#ADD zlib-ng /zlib-ng_build/
#RUN ["bash", "/zlib-ng_build/build-zlib-ng.sh"]
Expand Down Expand Up @@ -89,8 +97,9 @@ RUN ["bash", "/libmodplug_build/build-libmodplug.sh"]
ADD libffi /libffi_build/
RUN ["bash", "/libffi_build/build-libffi.sh"]

ADD gettext /gettext_build/
RUN ["bash", "/gettext_build/build-gettext.sh"]
# explicit install not needed anymore
# ADD gettext /gettext_build/
# RUN ["bash", "/gettext_build/build-gettext.sh"]

ADD glib /glib_build/
RUN ["bash", "/glib_build/build-glib.sh"]
Expand Down
17 changes: 13 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-i686
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ ENV PG_BASE_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PG_DEP_PREFIX \

ENV PG_BASE_CONFIGURE_FLAGS="--prefix=$PG_DEP_PREFIX"

ENV PG_BASE_MESON_FLAGS="--prefix=$PG_DEP_PREFIX \
-Dlibdir=lib \
-Dbuildtype=release \
-Ddefault_library=shared"

# remember to keep this updated when we drop 3.11 support
ENV PATH="/opt/python/cp311-cp311/bin:$PATH"

ADD pkg-config /pkg-config_build/
RUN ["linux32", "bash", "/pkg-config_build/build-pkg-config.sh"]

ADD cmake /cmake_build/
RUN ["linux32", "bash", "/cmake_build/build-cmake.sh"]
ADD buildtools /buildtools/
RUN ["linux32", "bash", "/buildtools/install.sh"]

#ADD zlib-ng /zlib-ng_build/
#RUN ["linux32", "bash", "/zlib-ng_build/build-zlib-ng.sh"]
Expand Down Expand Up @@ -89,8 +97,9 @@ RUN ["linux32", "bash", "/libmodplug_build/build-libmodplug.sh"]
ADD libffi /libffi_build/
RUN ["bash", "/libffi_build/build-libffi.sh"]

ADD gettext /gettext_build/
RUN ["bash", "/gettext_build/build-gettext.sh"]
# explicit install not needed anymore
# ADD gettext /gettext_build/
# RUN ["bash", "/gettext_build/build-gettext.sh"]

ADD glib /glib_build/
RUN ["bash", "/glib_build/build-glib.sh"]
Expand Down
17 changes: 13 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ ENV PG_BASE_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PG_DEP_PREFIX \

ENV PG_BASE_CONFIGURE_FLAGS="--prefix=$PG_DEP_PREFIX"

ENV PG_BASE_MESON_FLAGS="--prefix=$PG_DEP_PREFIX \
-Dlibdir=lib \
-Dbuildtype=release \
-Ddefault_library=shared"

# remember to keep this updated when we drop 3.11 support
ENV PATH="/opt/python/cp311-cp311/bin:$PATH"

ADD pkg-config /pkg-config_build/
RUN ["bash", "/pkg-config_build/build-pkg-config.sh"]

ADD cmake /cmake_build/
RUN ["bash", "/cmake_build/build-cmake.sh"]
ADD buildtools /buildtools/
RUN ["bash", "/buildtools/install.sh"]

#ADD zlib-ng /zlib-ng_build/
#RUN ["bash", "/zlib-ng_build/build-zlib-ng.sh"]
Expand Down Expand Up @@ -89,8 +97,9 @@ RUN ["bash", "/libmodplug_build/build-libmodplug.sh"]
ADD libffi /libffi_build/
RUN ["bash", "/libffi_build/build-libffi.sh"]

ADD gettext /gettext_build/
RUN ["bash", "/gettext_build/build-gettext.sh"]
# explicit install not needed anymore
# ADD gettext /gettext_build/
# RUN ["bash", "/gettext_build/build-gettext.sh"]

ADD glib /glib_build/
RUN ["bash", "/glib_build/build-glib.sh"]
Expand Down
22 changes: 22 additions & 0 deletions buildconfig/manylinux-build/docker_base/buildtools/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e -x

cd $(dirname `readlink -f "$0"`)

# This file installs tools (cmake and meson+ninja) needed to build dependencies
# Also installs setuptools to make sure distutils is available (on newer python
# versions) because some builds may need it.
# cmake is also installed via pip because it is easier than maintaining a
# separate build script for it

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
export PG_LINUX_EXTRA_FLAGS="--user"
fi

# pin versions for stability (remember to keep updated)
python3 -m pip install $PG_LINUX_EXTRA_FLAGS \
setuptools==68.2.2 cmake==3.27.6 meson==1.2.2 ninja==1.11.1

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cp /root/.local/bin/* /usr/bin
fi
23 changes: 0 additions & 23 deletions buildconfig/manylinux-build/docker_base/cmake/build-cmake.sh

This file was deleted.

This file was deleted.

20 changes: 10 additions & 10 deletions buildconfig/manylinux-build/docker_base/glib/build-glib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

GLIB=glib-2.56.4
GLIB_VER="2.78"
GLIB_PATCH="1"
GLIB="glib-${GLIB_VER}.${GLIB_PATCH}"

curl -sL --retry 10 https://download.gnome.org/sources/glib/2.56/${GLIB}.tar.xz > ${GLIB}.tar.xz
curl -sL --retry 10 https://download.gnome.org/sources/glib/${GLIB_VER}/${GLIB}.tar.xz > ${GLIB}.tar.xz
sha512sum -c glib.sha512

unxz ${GLIB}.tar.xz
tar xf ${GLIB}.tar
cd $GLIB

if [[ "$MAC_ARCH" == "arm64" ]]; then
# pass a 'cache' file while cross compiling to arm64 for glib. This is
# needed for glib to determine some info about the target architecture
export GLIB_COMPILE_EXTRA_FLAGS="--cache-file=../macos_arm64.cache"
fi
# a minimal glib install will do for us
meson setup _build $PG_BASE_MESON_FLAGS -Dtests=false \
-Dselinux=disabled -Dlibmount=disabled -Ddtrace=false -Dsystemtap=false -Dnls=disabled

meson compile -C _build
meson install -C _build

CFLAGS=-Wno-error ./configure $PG_BASE_CONFIGURE_FLAGS --with-pcre=internal $GLIB_COMPILE_EXTRA_FLAGS --disable-libmount --disable-dbus
make
make install
2 changes: 1 addition & 1 deletion buildconfig/manylinux-build/docker_base/glib/glib.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
280a46c2af13283a08c15ff0b4f5492659c2884521930600ad45310ed181c44a878ad8f9b36bae68ed6e7d92db6f1630f7bf015148c513dc317d25807f13abb0 glib-2.56.4.tar.xz
aa9ed9195951b00ac8221e958ea337fbda82621a862ef8f29dc2ea396a6253ce51c2a0a498dfa4e12642f1836f85f9564f09991979ae85c5ed4368355d857376 glib-2.78.1.tar.xz
16 changes: 0 additions & 16 deletions buildconfig/manylinux-build/docker_base/glib/macos_arm64.cache

This file was deleted.

Loading