forked from gbdev/rgbds
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build libpng manually to create fat macOS binaries
The lib Brew distributes only contains code for the host arch. (Which makes sense, not gonna blame them.)
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 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,27 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
pngver=1.6.43 | ||
|
||
## Grab sources and check them | ||
|
||
curl -LOJ "http://prdownloads.sourceforge.net/libpng/libpng-$pngver.tar.xz?download" | ||
# Brew doesn't provide any sha256sum, so we're making do with `sha2` instead. | ||
if [ "$(sha2 -q -256 libpng-$pngver.tar.xz)" != 6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c ]; then | ||
sha2 -256 libpng-$pngver.tar.xz | ||
echo Checksum mismatch! Aborting. >&2 | ||
exit 1 | ||
fi | ||
|
||
## Extract sources and patch them | ||
|
||
tar -xvf libpng-$pngver.tar.xz | ||
|
||
## Start building! | ||
|
||
mkdir -p build | ||
cd build | ||
../libpng-$pngver/configure --disable-shared --enable-static \ | ||
CFLAGS="-O3 -flto -DNDEBUG -mmacosx-version-min=10.9 -arch x86_64 -arch arm64 -fno-exceptions" | ||
make -kj | ||
make install prefix="$PWD/../libpng-staging" |
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
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
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