diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b5aaf3a7b..aa962a270c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,37 @@ on: - '.github/workflows/sdl1-sdist.yml' jobs: + deps: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + + - name: Test for Mac Deps cache hit + id: macdep-cache + uses: actions/cache@v2 + with: + path: ${{ github.workspace }}/pygame_mac_deps + # The hash of all files in buildconfig manylinux-build and macdependencies is + # the key to the cache. If anything changes here, the deps are built again + key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }} + + # build mac deps on cache miss + - name: Build Mac Deps + if: steps.macdep-cache.outputs.cache-hit != 'true' + run: | + brew install coreutils + cd buildconfig/macdependencies + bash ./build_mac_deps.sh + + # Uncomment when you want to manually verify the deps by downloading them + # - name: Upload Mac deps + # uses: actions/upload-artifact@v2 + # with: + # name: pygame-mac-deps + # path: ${{ github.workspace }}/pygame_mac_deps + build: + needs: deps runs-on: ${{ matrix.os }} strategy: fail-fast: false # if a particular matrix build fails, don't skip the rest @@ -52,45 +82,43 @@ jobs: # - os: windows-latest # pyver: 'pp27' + env: + SDL_VIDEODRIVER: "dummy" + SDL_AUDIODRIVER: "disk" + + CIBW_BEFORE_ALL_MACOS: cd buildconfig/macdependencies && bash ./install_mac_deps.sh + + CIBW_BEFORE_BUILD: pip install requests numpy + CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300 + + # Increase pip debugging output + CIBW_BUILD_VERBOSITY: 2 + steps: - uses: actions/checkout@v2 + - name: Fetch Mac deps + id: macdep-cache + uses: actions/cache@v2 + with: + path: ${{ github.workspace }}/pygame_mac_deps + key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }} + # use cibuildwheel v1 to build on older python versions - name: Build wheels with CIBuildWheel v1 # if: matrix.pyver == 'cp27' || matrix.pyver == 'cp35' || matrix.pyver == 'pp27' || matrix.pyver == 'pp36' if: matrix.cibuildver == 'CIBuildWheel v1' uses: pypa/cibuildwheel@v1.12.0 env: - SDL_VIDEODRIVER: "dummy" - SDL_AUDIODRIVER: "disk" - # CIBW_BUILD: ${{ matrix.pyver }}-* CIBW_BUILD: cp27-* cp35-* pp27-* pp36-* - # Install some dependencies - CIBW_BEFORE_BUILD_MACOS: | - brew install coreutils - cd buildconfig/macdependencies - ./install_mac_deps.sh - cd ../.. - pip install requests numpy - - CIBW_BEFORE_BUILD_WINDOWS: pip install requests numpy - - CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300 - - # Increase pip debugging output - CIBW_BUILD_VERBOSITY: 2 - # use latest cibuildwheel for newer python versions - name: Build wheels with CIBuildWheel v2 # if: matrix.pyver != 'cp27' && matrix.pyver != 'cp35' && matrix.pyver != 'pp27' && matrix.pyver != 'pp36' if: matrix.cibuildver == 'CIBuildWheel v2' - uses: pypa/cibuildwheel@v2.1.2 + uses: pypa/cibuildwheel@v2.1.3 env: - SDL_VIDEODRIVER: "dummy" - SDL_AUDIODRIVER: "disk" - # CIBW_BUILD: ${{ matrix.pyver }}-* CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* pp37-* @@ -100,21 +128,6 @@ jobs: # uncomment when arm builds are working # CIBW_ARCHS_MACOS: "x86_64 universal2" - # Install some dependencies - CIBW_BEFORE_BUILD_MACOS: | - brew install coreutils - cd buildconfig/macdependencies - ./install_mac_deps.sh - cd ../.. - pip install requests numpy - - CIBW_BEFORE_BUILD_WINDOWS: pip install requests numpy - - CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300 - - # Increase pip debugging output - CIBW_BUILD_VERBOSITY: 2 - - uses: actions/upload-artifact@v2 with: name: pygame-wheels diff --git a/buildconfig/macdependencies/build_mac_deps.sh b/buildconfig/macdependencies/build_mac_deps.sh new file mode 100644 index 0000000000..ee43f7d1fa --- /dev/null +++ b/buildconfig/macdependencies/build_mac_deps.sh @@ -0,0 +1,58 @@ +# This uses manylinux build scripts to build dependencies +# on mac. +# +# Warning: this should probably not be run on your own mac. +# Since it will install all these deps all over the place, +# and they may conflict with existing installs you have. + +set -e -x + +export MACDEP_CACHE_PREFIX_PATH=${GITHUB_WORKSPACE}/pygame_mac_deps + +bash ./clean_usr_local.sh +mkdir $MACDEP_CACHE_PREFIX_PATH + +# to use the gnu readlink, needs `brew install coreutils` +export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + +# for great speed. +export MAKEFLAGS="-j 4" +export MACOSX_DEPLOYMENT_TARGET=10.9 + +cd ../manylinux-build/docker_base + +# Now start installing dependencies +# --------------------------------- + +# sdl_image deps +bash zlib/build-zlib.sh +bash libpng/build-png.sh # depends on zlib +bash libjpeg/build-jpeg.sh +bash libtiff/build-tiff.sh +bash libwebp/build-webp.sh + +# sdl_ttf deps +# export EXTRA_CONFIG_FREETYPE=--without-harfbuzz +# bash freetype/build-freetype.sh +# bash harfbuzz/build-harfbuzz.sh +# export EXTRA_CONFIG_FREETYPE= +bash freetype/build-freetype.sh + +# sdl_mixer deps +bash libmodplug/build-libmodplug.sh +bash ogg/build-ogg.sh +bash flac/build-flac.sh +bash mpg123/build-mpg123.sh + +# fluidsynth (for sdl_mixer) +bash gettext/build-gettext.sh +bash glib/build-glib.sh # depends on gettext +bash sndfile/build-sndfile.sh +sudo mkdir -p /usr/local/lib64 # the install tries to put something in here +sudo mkdir -p ${MACDEP_CACHE_PREFIX_PATH}/usr/local/lib64 +sudo bash fluidsynth/build-fluidsynth.sh # sudo otherwise install doesn't work. + +bash sdl_libs/build-sdl2-libs.sh + +# for pygame.midi +bash portmidi/build-portmidi.sh diff --git a/buildconfig/macdependencies/clean_usr_local.sh b/buildconfig/macdependencies/clean_usr_local.sh new file mode 100644 index 0000000000..97fa218d52 --- /dev/null +++ b/buildconfig/macdependencies/clean_usr_local.sh @@ -0,0 +1,43 @@ +# Cleans /usr/local for the install of mac deps, deleting things that are not +# required, or things that will be replaced with something else + + +# First clean up some homebrew stuff we don't want linked in +# ---------------------------------------------------------- + +rm -rf /usr/local/bin/curl +rm -rf /usr/local/opt/curl +rm -rf /usr/local/bin/git +rm -rf /usr/local/opt/git +# Use the apple provided curl, and git. +# The homebrew ones depend on libs we don't want to include. +# ln -s /usr/bin/curl /usr/local/bin/curl +ln -s /usr/bin/git /usr/local/bin/git + +rm -rf /usr/local/lib/libtiff* +rm -rf /usr/local/lib/libsndfile* +rm -rf /usr/local/lib/glib* +rm -rf /usr/local/lib/libglib* +rm -rf /usr/local/lib/libgthread* +rm -rf /usr/local/lib/libintl* +rm -rf /usr/local/lib/libbrotlidec* +rm -rf /usr/local/lib/libopus* +rm -rf /usr/local/opt/freetype + +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/opus +rm -rf /usr/local/Cellar/freetype + +rm -rf /usr/local/opt/gettext + +rm -rf /usr/local/share/doc/tiff-* +rm -rf /usr/local/share/doc/libsndfile +rm -rf /usr/local/share/glib-2.0 +rm -rf /usr/local/share/gdb/auto-load + +rm -rf /usr/local/include/glib-2.0 +rm -rf /usr/local/include/gio-unix-2.0 diff --git a/buildconfig/macdependencies/install_mac_deps.py b/buildconfig/macdependencies/install_mac_deps.py new file mode 100644 index 0000000000..bf962f20be --- /dev/null +++ b/buildconfig/macdependencies/install_mac_deps.py @@ -0,0 +1,61 @@ +""" +A python helper script to install built (cached) mac deps into /usr/local +""" + +import shutil +import sys +from pathlib import Path + + +def rmpath(path: Path, verbose: bool = False): + """ + Tries to remove a path of any kind + """ + if path.is_symlink(): + if verbose: + print(f"- Removing existing symlink at '{path}'") + + path.unlink() + + elif path.is_file(): + if verbose: + print(f"- Removing existing file at '{path}'") + + path.unlink() + + elif path.is_dir(): + if verbose: + print(f"- Removing existing directory at '{path}'") + + shutil.rmtree(path) + + +def symtree(srcdir: Path, destdir: Path, verbose: bool = False): + """ + This function creates symlinks pointing to srcdir, from destdir, such that + existing folders and files in the tree of destdir are retained + """ + if not destdir.is_dir(): + # dest dir does not exist at all, create dir symlink + rmpath(destdir, verbose) + if verbose: + print( + f"- Creating directory symlink from '{destdir}' pointing to '{srcdir}'" + ) + + destdir.symlink_to(srcdir) + return + + for path in srcdir.glob("*"): + destpath = destdir / path.name + if path.is_dir(): + symtree(path, destpath, verbose) + else: + rmpath(destpath, verbose) + if verbose: + print(f"- Creating file symlink from '{destpath}' pointing to '{path}'") + + destpath.symlink_to(path) + + +symtree(Path(sys.argv[1]), Path("/"), verbose=True) diff --git a/buildconfig/macdependencies/install_mac_deps.sh b/buildconfig/macdependencies/install_mac_deps.sh index f40b460630..65d810dc3e 100755 --- a/buildconfig/macdependencies/install_mac_deps.sh +++ b/buildconfig/macdependencies/install_mac_deps.sh @@ -1,95 +1,9 @@ -# This uses manylinux build scripts to build dependencies -# on mac. -# -# Warning: this should probably not be run on your own mac. -# Since it will install all these deps all over the place, -# and they may conflict with existing installs you have. - +# A script to install mac deps in /usr/local set -e -x -cd ../manylinux-build/docker_base - -# to use the gnu readlink, needs `brew install coreutils` -export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" - -# for great speed. -export MAKEFLAGS="-j 4" -export MACOSX_DEPLOYMENT_TARGET=10.9 - - -# First clean up some homebrew stuff we don't want linked in -# ---------------------------------------------------------- - -rm -rf /usr/local/bin/curl -rm -rf /usr/local/opt/curl -rm -rf /usr/local/bin/git -rm -rf /usr/local/opt/git -# Use the apple provided curl, and git. -# The homebrew ones depend on libs we don't want to include. -# ln -s /usr/bin/curl /usr/local/bin/curl -ln -s /usr/bin/git /usr/local/bin/git - -rm -rf /usr/local/lib/libtiff* -rm -rf /usr/local/lib/libsndfile* -rm -rf /usr/local/lib/glib* -rm -rf /usr/local/lib/libglib* -rm -rf /usr/local/lib/libgthread* -rm -rf /usr/local/lib/libintl* -rm -rf /usr/local/lib/libbrotlidec* -rm -rf /usr/local/lib/libopus* -rm -rf /usr/local/opt/freetype - -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/opus -rm -rf /usr/local/Cellar/freetype - -rm -rf /usr/local/opt/gettext - -rm -rf /usr/local/share/doc/tiff-* -rm -rf /usr/local/share/doc/libsndfile -rm -rf /usr/local/share/glib-2.0 -rm -rf /usr/local/share/gdb/auto-load - -rm -rf /usr/local/include/glib-2.0 -rm -rf /usr/local/include/gio-unix-2.0 - - -# Now start installing dependencies -# --------------------------------- - -# sdl_image deps -bash zlib/build-zlib.sh -bash libpng/build-png.sh # depends on zlib -bash libjpeg/build-jpeg.sh -bash libtiff/build-tiff.sh -bash libwebp/build-webp.sh - -# sdl_ttf deps -# export EXTRA_CONFIG_FREETYPE=--without-harfbuzz -# bash freetype/build-freetype.sh -# bash harfbuzz/build-harfbuzz.sh -# export EXTRA_CONFIG_FREETYPE= -bash freetype/build-freetype.sh - -# sdl_mixer deps -bash libmodplug/build-libmodplug.sh -bash ogg/build-ogg.sh -bash flac/build-flac.sh -bash mpg123/build-mpg123.sh - -# fluidsynth (for sdl_mixer) -bash gettext/build-gettext.sh -bash glib/build-glib.sh # depends on gettext -bash sndfile/build-sndfile.sh -sudo mkdir -p /usr/local/lib64 # the install tries to put something in here -sudo bash fluidsynth/build-fluidsynth.sh # sudo otherwise install doesn't work. -bash sdl_libs/build-sdl2-libs.sh +bash ./clean_usr_local.sh +sudo python3 install_mac_deps.py ${GITHUB_WORKSPACE}/pygame_mac_deps -# for pygame.midi -bash portmidi/build-portmidi.sh -# strangely somehow the built pygame links against the libportmidi.dylib here: -cp /usr/local/lib/libportmidi.dylib /Users/runner/work/pygame/pygame/libportmidi.dylib +# strangely somehow the built pygame links against the libportmidi.dylib here, so +# copy the dylib +cp /usr/local/lib/libportmidi.dylib ${GITHUB_WORKSPACE}/libportmidi.dylib diff --git a/buildconfig/manylinux-build/docker_base/flac/build-flac.sh b/buildconfig/manylinux-build/docker_base/flac/build-flac.sh index dd551cd5b3..61e2208dc6 100644 --- a/buildconfig/manylinux-build/docker_base/flac/build-flac.sh +++ b/buildconfig/manylinux-build/docker_base/flac/build-flac.sh @@ -12,6 +12,12 @@ sha512sum -c flac.sha512 unxz ${FLAC}.tar.xz tar xf ${FLAC}.tar cd $FLAC + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/fluidsynth/build-fluidsynth.sh b/buildconfig/manylinux-build/docker_base/fluidsynth/build-fluidsynth.sh index d980148f9f..a72cd28966 100644 --- a/buildconfig/manylinux-build/docker_base/fluidsynth/build-fluidsynth.sh +++ b/buildconfig/manylinux-build/docker_base/fluidsynth/build-fluidsynth.sh @@ -13,6 +13,12 @@ tar xzf ${FSYNTH}.tar.gz cd $FSYNTH mkdir build cd build + cmake .. -Denable-readline=OFF make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/freetype/build-freetype.sh b/buildconfig/manylinux-build/docker_base/freetype/build-freetype.sh index ff7795836f..f7eddb1e35 100644 --- a/buildconfig/manylinux-build/docker_base/freetype/build-freetype.sh +++ b/buildconfig/manylinux-build/docker_base/freetype/build-freetype.sh @@ -13,6 +13,12 @@ if [ ! -d $FREETYPE ]; then tar xzf ${FREETYPE}.tar.gz fi cd $FREETYPE + ./configure $EXTRA_CONFIG_FREETYPE make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/gettext/build-gettext.sh b/buildconfig/manylinux-build/docker_base/gettext/build-gettext.sh index 38c2e0ddd1..c4b7e81f4b 100644 --- a/buildconfig/manylinux-build/docker_base/gettext/build-gettext.sh +++ b/buildconfig/manylinux-build/docker_base/gettext/build-gettext.sh @@ -18,6 +18,7 @@ fi tar xzf ${GETTEXT}.tar.gz cd $GETTEXT + ./configure $GETTEXT_CONFIGURE --disable-dependency-tracking \ --disable-silent-rules \ --disable-debug \ @@ -34,3 +35,8 @@ cd $GETTEXT make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/glib/build-glib.sh b/buildconfig/manylinux-build/docker_base/glib/build-glib.sh index 97c544f96d..143f020788 100644 --- a/buildconfig/manylinux-build/docker_base/glib/build-glib.sh +++ b/buildconfig/manylinux-build/docker_base/glib/build-glib.sh @@ -11,6 +11,12 @@ sha512sum -c glib.sha512 unxz ${GLIB}.tar.xz tar xzf ${GLIB}.tar cd $GLIB + ./configure --with-pcre=internal make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/harfbuzz/build-harfbuzz.sh b/buildconfig/manylinux-build/docker_base/harfbuzz/build-harfbuzz.sh index 59955b693c..871041d11c 100644 --- a/buildconfig/manylinux-build/docker_base/harfbuzz/build-harfbuzz.sh +++ b/buildconfig/manylinux-build/docker_base/harfbuzz/build-harfbuzz.sh @@ -11,7 +11,13 @@ sha512sum -c harfbuzz.sha512 unxz -xf ${HARFBUZZ_NAME}.tar.xz tar -xf ${HARFBUZZ_NAME}.tar cd ${HARFBUZZ_NAME} + # To avoid a circular dependency on freetype ./configure --with-freetype=no --with-fontconfig=no make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/libjpeg/build-jpeg.sh b/buildconfig/manylinux-build/docker_base/libjpeg/build-jpeg.sh index e74e66149f..7b5fc96096 100755 --- a/buildconfig/manylinux-build/docker_base/libjpeg/build-jpeg.sh +++ b/buildconfig/manylinux-build/docker_base/libjpeg/build-jpeg.sh @@ -10,6 +10,12 @@ sha512sum -c jpeg.sha512 tar xzf ${JPEG}.tar.gz cd jpeg-* + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/libmodplug/build-libmodplug.sh b/buildconfig/manylinux-build/docker_base/libmodplug/build-libmodplug.sh index deff79c02f..bbbb84afa8 100644 --- a/buildconfig/manylinux-build/docker_base/libmodplug/build-libmodplug.sh +++ b/buildconfig/manylinux-build/docker_base/libmodplug/build-libmodplug.sh @@ -10,6 +10,12 @@ curl -sL https://sourceforge.net/projects/modplug-xmms/files/libmodplug/${MODPLU sha512sum -c libmodplug.sha512 tar -xf ${MODPLUG_NAME}.tar.gz cd ${MODPLUG_NAME} + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/libpng/build-png.sh b/buildconfig/manylinux-build/docker_base/libpng/build-png.sh index 91132a0244..3c118c10ce 100644 --- a/buildconfig/manylinux-build/docker_base/libpng/build-png.sh +++ b/buildconfig/manylinux-build/docker_base/libpng/build-png.sh @@ -10,6 +10,12 @@ sha512sum -c png.sha512 tar xzf ${PNG}.tar.gz cd $PNG + ./configure --with-zlib-prefix=/usr/local/ make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/libtiff/build-tiff.sh b/buildconfig/manylinux-build/docker_base/libtiff/build-tiff.sh index 490af3f472..0cb27d6257 100644 --- a/buildconfig/manylinux-build/docker_base/libtiff/build-tiff.sh +++ b/buildconfig/manylinux-build/docker_base/libtiff/build-tiff.sh @@ -10,7 +10,12 @@ sha512sum -c tiff.sha512 tar xzf ${TIFF}.tar.gz cd $TIFF -./configure --disable-lzma --disable-webp --disable-zstd +./configure --disable-lzma --disable-webp --disable-zstd make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/libwebp/build-webp.sh b/buildconfig/manylinux-build/docker_base/libwebp/build-webp.sh index c170f4d1f1..e1ce5edf15 100644 --- a/buildconfig/manylinux-build/docker_base/libwebp/build-webp.sh +++ b/buildconfig/manylinux-build/docker_base/libwebp/build-webp.sh @@ -10,6 +10,12 @@ sha512sum -c webp.sha512 tar xzf ${WEBP}.tar.gz cd $WEBP + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/mpg123/build-mpg123.sh b/buildconfig/manylinux-build/docker_base/mpg123/build-mpg123.sh index 5deb8b8af5..ad7056a088 100644 --- a/buildconfig/manylinux-build/docker_base/mpg123/build-mpg123.sh +++ b/buildconfig/manylinux-build/docker_base/mpg123/build-mpg123.sh @@ -11,7 +11,14 @@ sha512sum -c mpg123.sha512 bzip2 -d ${MPG123}.tar.bz2 tar xf ${MPG123}.tar cd $MPG123 + ./configure --enable-int-quality --disable-debug make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. diff --git a/buildconfig/manylinux-build/docker_base/ogg/build-ogg.sh b/buildconfig/manylinux-build/docker_base/ogg/build-ogg.sh index ba6c7f406d..86cd6c8135 100644 --- a/buildconfig/manylinux-build/docker_base/ogg/build-ogg.sh +++ b/buildconfig/manylinux-build/docker_base/ogg/build-ogg.sh @@ -12,14 +12,27 @@ sha512sum -c ogg.sha512 tar xzf ${OGG}.tar.gz cd $OGG + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. tar xzf ${VORBIS}.tar.gz cd $VORBIS + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. diff --git a/buildconfig/manylinux-build/docker_base/portmidi/build-portmidi.sh b/buildconfig/manylinux-build/docker_base/portmidi/build-portmidi.sh index 97e4dc7e7f..458212685c 100644 --- a/buildconfig/manylinux-build/docker_base/portmidi/build-portmidi.sh +++ b/buildconfig/manylinux-build/docker_base/portmidi/build-portmidi.sh @@ -3,7 +3,8 @@ set -e -x cd $(dirname `readlink -f "$0"`) -SRC_ZIP="portmidi-src-217.zip" +PORTMIDI="portmidi-src-217" +SRC_ZIP="${PORTMIDI}.zip" curl -sL http://downloads.sourceforge.net/project/portmedia/portmidi/217/${SRC_ZIP} > ${SRC_ZIP} sha512sum -c portmidi.sha512 @@ -28,6 +29,12 @@ patch -p1 < ../mac.patch #cmake -DJAVA_JVM_LIBRARY=${JAVA_HOME}/jre/lib/${JRE_LIB_DIR}/server/libjvm.so . mkdir buildportmidi cd buildportmidi + cmake -DCMAKE_BUILD_TYPE=Release .. make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl-libs.sh b/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl-libs.sh index 5f1ccc0cbc..3ac247efc8 100644 --- a/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl-libs.sh +++ b/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl-libs.sh @@ -21,6 +21,12 @@ cd $SDL ./configure --enable-png --disable-png-shared --enable-jpg --disable-jpg-shared make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. # Link sdl-config into /usr/bin so that smpeg-config can find it @@ -37,6 +43,12 @@ cd release_0_4_5 ./configure --disable-dependency-tracking --disable-debug --disable-gtk-player --disable-gtktest --disable-opengl-player --disable-sdltest make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. # Build SDL_image @@ -49,6 +61,12 @@ cd $IMG --enable-tif --disable-tif-shared --enable-webp --disable-webp-shared make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. # Build SDL_ttf @@ -57,6 +75,12 @@ cd $TTF ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. # Build SDL_mixer @@ -72,4 +96,10 @@ cd $MIX --enable-music-mp3 --disable-music-mp3-shared make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. diff --git a/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh b/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh index 67f4ae6f3b..8a22adaf85 100644 --- a/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh +++ b/buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh @@ -31,6 +31,12 @@ cd $SDL2 ./configure --disable-video-vulkan make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. @@ -54,6 +60,12 @@ fi --enable-tif --disable-tif-shared --enable-webp --disable-webp-shared $SDL_IMAGE_CONFIGURE make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. # Build SDL_ttf @@ -62,6 +74,12 @@ cd $TTF2 ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. @@ -90,4 +108,10 @@ cd $MIX2 make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi + cd .. diff --git a/buildconfig/manylinux-build/docker_base/sndfile/build-sndfile.sh b/buildconfig/manylinux-build/docker_base/sndfile/build-sndfile.sh index ab924c4d1a..6c084398a5 100644 --- a/buildconfig/manylinux-build/docker_base/sndfile/build-sndfile.sh +++ b/buildconfig/manylinux-build/docker_base/sndfile/build-sndfile.sh @@ -4,13 +4,20 @@ set -e -x cd $(dirname `readlink -f "$0"`) SNDFILEVER=1.0.31 -SNDFILE="libsndfile-$SNDFILEVER.tar.bz2" +SNDNAME="libsndfile-$SNDFILEVER" +SNDFILE="$SNDNAME.tar.bz2" curl -sL https://github.com/libsndfile/libsndfile/releases/download/${SNDFILEVER}/${SNDFILE} > ${SNDFILE} sha512sum -c sndfile.sha512 tar xf ${SNDFILE} -cd libsndfile-${SNDFILEVER} +cd $SNDNAME # autoreconf -fvi + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi diff --git a/buildconfig/manylinux-build/docker_base/zlib/build-zlib.sh b/buildconfig/manylinux-build/docker_base/zlib/build-zlib.sh index d4f9e82b59..cb11ad50de 100644 --- a/buildconfig/manylinux-build/docker_base/zlib/build-zlib.sh +++ b/buildconfig/manylinux-build/docker_base/zlib/build-zlib.sh @@ -10,6 +10,12 @@ curl -sL https://www.zlib.net/${ZLIB_NAME}.tar.gz > ${ZLIB_NAME}.tar.gz sha512sum -c zlib.sha512 tar -xf ${ZLIB_NAME}.tar.gz cd ${ZLIB_NAME} + ./configure make make install + +if [[ "$OSTYPE" == "darwin"* ]]; then + # Install to mac deps cache dir as well + make install DESTDIR=${MACDEP_CACHE_PREFIX_PATH} +fi