mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-29 14:27:50 +00:00
Add Windows testing
This commit is contained in:
17
.github/actions/mingw-configure.sh
vendored
Normal file
17
.github/actions/mingw-configure.sh
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
source mingw-env @TRIPLE@
|
||||
echo LAST IS: $last
|
||||
|
||||
# check if last arg is a path to configure, else use parent
|
||||
for last; do true; done
|
||||
if test -x "${last}/configure"; then
|
||||
config_path="$last"
|
||||
else
|
||||
config_path=".."
|
||||
fi
|
||||
|
||||
${config_path}/configure \
|
||||
--host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
|
||||
--prefix=/usr/@TRIPLE@ --libdir=/usr/@TRIPLE@/lib --includedir=/usr/@TRIPLE@/include \
|
||||
--enable-shared --enable-static "$@"
|
||||
16
.github/actions/mingw-env.sh
vendored
Normal file
16
.github/actions/mingw-env.sh
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
_arch=$1
|
||||
|
||||
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
|
||||
default_mingw_compiler_flags="$default_mingw_pp_flags -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
|
||||
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed -fstack-protector"
|
||||
|
||||
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
|
||||
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
|
||||
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
|
||||
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
|
||||
|
||||
mingw_prefix=/usr/${_arch}
|
||||
export PKG_CONFIG_SYSROOT_DIR="${mingw_prefix}"
|
||||
export PKG_CONFIG_LIBDIR="${mingw_prefix}/lib/pkgconfig:${mingw_prefix}/share/pkgconfig"
|
||||
44
.github/actions/mingw-w64-libpng-dev.sh
vendored
Executable file
44
.github/actions/mingw-w64-libpng-dev.sh
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script was written by ISSOtm while looking at Arch Linux's PKGBUILD for
|
||||
# the corresponding package. (And its dependencies)
|
||||
# https://aur.archlinux.org/packages/mingw-w64-libpng/
|
||||
|
||||
set -e
|
||||
|
||||
pngver=1.6.37
|
||||
_apngver=$pngver
|
||||
_arch="$1"
|
||||
|
||||
|
||||
## Install mingw-configure and mingw-env (both build dependencies)
|
||||
|
||||
install -m 755 .github/actions/mingw-env.sh /usr/bin/mingw-env
|
||||
|
||||
sed "s|@TRIPLE@|${_arch}|g" .github/actions/mingw-configure.sh > ${_arch}-configure
|
||||
install -m 755 ${_arch}-configure /usr/bin/
|
||||
|
||||
|
||||
## Grab sources and check them
|
||||
|
||||
wget http://downloads.sourceforge.net/sourceforge/libpng/libpng-$pngver.tar.xz
|
||||
wget http://downloads.sourceforge.net/project/apng/libpng/libpng16/libpng-$_apngver-apng.patch.gz
|
||||
sha256sum -c .github/actions/mingw-w64-libpng-dev.sha256sums
|
||||
|
||||
## Extract sources
|
||||
|
||||
tar -xf libpng-$pngver.tar.xz
|
||||
gunzip libpng-$_apngver-apng.patch.gz
|
||||
|
||||
|
||||
## Start building!
|
||||
|
||||
cd libpng-$pngver
|
||||
# Patch in apng support
|
||||
patch -p0 ../libpng-$_apngver-apng.patch
|
||||
|
||||
mkdir -p build-${_arch}
|
||||
cd build-${_arch}
|
||||
${_arch}-configure LDFLAGS=-static-libgcc
|
||||
make
|
||||
make install
|
||||
2
.github/actions/mingw-w64-libpng-dev.sha256sums
vendored
Normal file
2
.github/actions/mingw-w64-libpng-dev.sha256sums
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
10d9e0cb60e2b387a79b355eb7527c0bee2ed8cbd12cf04417cabc4d6976683c libpng-1.6.37-apng.patch.gz
|
||||
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca libpng-1.6.37.tar.xz
|
||||
Reference in New Issue
Block a user