-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile windows deps manually (pass 1 - 8)
- Loading branch information
Showing
2 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,63 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
deps: | ||
name: ${{ matrix.name }} deps | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
# make i686 deps and x86_64 deps | ||
include: | ||
- { | ||
name: "64-bit", | ||
winarch: x86_64, | ||
msystem: MINGW64 | ||
} | ||
- { | ||
name: "32-bit", | ||
winarch: i686, | ||
msystem: MINGW32 | ||
} | ||
|
||
steps: | ||
- run: git config --global core.autocrlf input # do not introduce carriage returns | ||
- uses: actions/[email protected] | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ${{ matrix.msystem }} | ||
install: >- | ||
cmake | ||
gcc | ||
- name: Test for Win Deps cache hit | ||
id: windep-cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/pygame_win_deps_${{ matrix.winarch }} | ||
# The hash of all files in buildconfig manylinux-build and windependencies is | ||
# the key to the cache. If anything changes here, the deps are built again | ||
key: windep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/windependencies/*.sh') }}-${{ matrix.winarch }} | ||
lookup-only: true | ||
|
||
# build win deps on cache miss | ||
- name: Build Win Deps | ||
if: steps.windep-cache.outputs.cache-hit != 'true' | ||
shell: msys2 {0} | ||
run: | | ||
export WIN_ARCH="${{ matrix.winarch }}" | ||
cd buildconfig/windependencies | ||
bash ./build_win_deps.sh | ||
# Uncomment when you want to manually verify the deps by downloading them | ||
- name: Upload win deps | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pygame-win-deps-${{ matrix.winarch }} | ||
path: ${{ github.workspace }}/pygame_win_deps_${{ matrix.winarch }} | ||
|
||
build: | ||
name: ${{ matrix.name }} | ||
needs: deps | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false # if a particular matrix build fails, don't skip the rest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# This uses manylinux build scripts to build dependencies on windows. | ||
|
||
set -e -x | ||
|
||
export WIN_PREFIX_PATH=${GITHUB_WORKSPACE}/pygame_win_deps_${WIN_ARCH} | ||
|
||
mkdir $WIN_PREFIX_PATH | ||
|
||
# for great speed. | ||
export MAKEFLAGS="-j 2" | ||
|
||
# for scripts using ./configure | ||
export CC="gcc" | ||
export CXX="g++" | ||
|
||
# With this we | ||
# 1) Force install prefix to $WIN_PREFIX_PATH | ||
# 2) use lib directory (and not lib64) | ||
# 3) make release binaries | ||
# 4) build shared libraries | ||
# 5) make cmake use gcc/g++/make | ||
export PG_BASE_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$WIN_PREFIX_PATH \ | ||
-DCMAKE_INSTALL_LIBDIR:PATH=lib \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_SHARED_LIBS=true \ | ||
-DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_MAKE_PROGRAM=make" | ||
|
||
export ARCHS_CONFIG_FLAG="--prefix=$WIN_PREFIX_PATH" | ||
|
||
cd ../manylinux-build/docker_base | ||
|
||
# Now start installing dependencies | ||
# --------------------------------- | ||
|
||
mkdir -p ${WIN_PREFIX_PATH}/usr/local/man/man1 | ||
|
||
# sdl_image deps | ||
bash zlib-ng/build-zlib-ng.sh | ||
bash libpng/build-png.sh # depends on zlib | ||
bash libjpegturbo/build-jpeg-turbo.sh | ||
bash libtiff/build-tiff.sh | ||
bash libwebp/build-webp.sh | ||
|
||
# freetype (also sdl_ttf dep) | ||
bash brotli/build-brotli.sh | ||
bash bzip2/build-bzip2.sh | ||
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 | ||
bash opus/build-opus.sh # needs libogg (which is a container format) | ||
|
||
# installs sdl2 by itself (fluidsynth can use it) | ||
bash sdl_libs/build-sdl2.sh | ||
|
||
# fluidsynth (for sdl_mixer) | ||
bash gettext/build-gettext.sh | ||
bash glib/build-glib.sh # depends on gettext | ||
bash sndfile/build-sndfile.sh | ||
bash fluidsynth/build-fluidsynth.sh | ||
|
||
# build sdl_image, sdl_ttf and sdl_mixer | ||
bash sdl_libs/build-sdl2-libs.sh | ||
|
||
# for pygame.midi | ||
bash portmidi/build-portmidi.sh |