-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wizard recipe: SDL2_gfx-v1.0.3 (#438)
* New Recipe: SDL2_gfx v1.0.3 * build all platforms. * typo: missing comma * [SDL2_gfx] Disable mmx for non-x86 architectures * [SDL2_gfx] Add patch to rebuild configure script * [SDL2_gfx] Manually build the shared library for Windows Co-authored-by: Mosè Giordano <[email protected]>
- Loading branch information
Showing
2 changed files
with
68 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Note that this script can accept some limited command-line arguments, run | ||
# `julia build_tarballs.jl --help` to see a usage message. | ||
using BinaryBuilder, Pkg | ||
|
||
name = "SDL2_gfx" | ||
version = v"1.0.3" | ||
|
||
# Collection of sources required to complete build | ||
sources = [ | ||
"http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-$(version).tar.gz" => | ||
"a4066bd467c96469935a4b1fe472893393e7d74e45f95d59f69726784befd8f8", | ||
"./bundled", | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/SDL2_gfx-* | ||
FLAGS=() | ||
if [[ "${target}" != *86* ]]; then | ||
FLAGS+=(--enable-mmx=no) | ||
fi | ||
if [[ "${target}" == powerpc64le-* ]] || [[ "${target}" == *-freebsd* ]]; then | ||
atomic_patch -p1 ../patches/configure_in_add_macro_dir.patch | ||
autoreconf -vi | ||
./autogen.sh | ||
fi | ||
update_configure_scripts | ||
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target} "${FLAGS[@]}" | ||
make -j${nproc} | ||
make install | ||
if [[ "${target}" == *-mingw* ]]; then | ||
# The shared library is not built for Windows, let's do it ourselves | ||
cd "${prefix}/lib" | ||
ar x libSDL2_gfx.a | ||
cc -shared -o "${libdir}/SDL2_gfx.${dlext}" *.o -lSDL2 | ||
rm *.o | ||
fi | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = supported_platforms() | ||
|
||
|
||
# The products that we will ensure are always built | ||
products = [ | ||
LibraryProduct(["libSDL2_gfx", "SDL2_gfx"], :libsdl2_gfx) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
PackageSpec(name="SDL2_jll", uuid="ab825dc5-c88e-5901-9575-1e5e20358fcf") | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) |
10 changes: 10 additions & 0 deletions
10
S/SDL2_gfx/bundled/patches/configure_in_add_macro_dir.patch
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,10 @@ | ||
--- a/configure.in | ||
+++ b/configure.in | ||
@@ -24,6 +24,7 @@ | ||
AC_SUBST(INTERFACE_AGE) | ||
AC_SUBST(BINARY_AGE) | ||
AC_SUBST(VERSION) | ||
+AC_CONFIG_MACRO_DIR(acinclude) | ||
|
||
# libtool versioning | ||
LT_INIT([win32-dll]) |