forked from mapbox/mason
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mapbox#749 fixes link libpng 1.6.32 and added 1.6.39
- Loading branch information
Showing
3 changed files
with
117 additions
and
1 deletion.
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
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,45 @@ | ||
language: generic | ||
|
||
matrix: | ||
include: | ||
- os: osx | ||
osx_image: xcode8.2 | ||
compiler: clang | ||
- os: linux | ||
env: MASON_PLATFORM_VERSION=cortex_a9 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM_VERSION=i686 | ||
sudo: false | ||
addons: | ||
apt: | ||
packages: [ 'zlib1g-dev:i386' ] | ||
- os: linux | ||
env: MASON_PLATFORM=linux | ||
compiler: clang | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v5 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v7 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v8 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=x86 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=x86-64 | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=mips | ||
sudo: false | ||
- os: linux | ||
env: MASON_PLATFORM=android MASON_ANDROID_ABI=mips-64 | ||
sudo: false | ||
|
||
script: | ||
- ./mason build ${MASON_NAME} ${MASON_VERSION} | ||
- ./mason publish ${MASON_NAME} ${MASON_VERSION} |
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,71 @@ | ||
#!/usr/bin/env bash | ||
|
||
MASON_NAME=libpng | ||
MASON_VERSION=1.6.39 | ||
MASON_LIB_FILE=lib/libpng.a | ||
MASON_PKGCONFIG_FILE=lib/pkgconfig/libpng.pc | ||
|
||
# Used when cross compiling to cortex_a9 | ||
ZLIB_SHARED_VERSION=1.2.8 | ||
|
||
. ${MASON_DIR}/mason.sh | ||
|
||
function mason_load_source { | ||
mason_download \ | ||
https://downloads.sourceforge.net/project/libpng/libpng16/${MASON_VERSION}/libpng-${MASON_VERSION}.tar.gz \ | ||
752b19285db1aab9d0b8f5ef2312390734f71e70 | ||
|
||
mason_extract_tar_gz | ||
|
||
export MASON_BUILD_PATH=${MASON_ROOT}/.build/libpng-${MASON_VERSION} | ||
} | ||
|
||
function mason_prepare_compile { | ||
# Install the zlib dependency when cross compiling as usually the host system only | ||
# provides the zlib headers and libraries in the path for the host architecture. | ||
if [ ${MASON_PLATFORM_VERSION} == "cortex_a9" ] || [ ${MASON_PLATFORM_VERSION} == "i686" ]; then | ||
cd $(dirname ${MASON_ROOT}) | ||
${MASON_DIR}/mason install zlib_shared ${ZLIB_SHARED_VERSION} | ||
${MASON_DIR}/mason link zlib_shared ${ZLIB_SHARED_VERSION} | ||
|
||
MASON_ZLIB_CFLAGS="$(${MASON_DIR}/mason cflags zlib_shared ${ZLIB_SHARED_VERSION})" | ||
MASON_ZLIB_LDFLAGS="-L$(${MASON_DIR}/mason prefix zlib_shared ${ZLIB_SHARED_VERSION})/lib" | ||
fi | ||
} | ||
|
||
function mason_compile { | ||
export CFLAGS="${CFLAGS:-} ${MASON_ZLIB_CFLAGS:-} -O3 -DNDEBUG" | ||
export LDFLAGS="${CFLAGS:-} ${MASON_ZLIB_LDFLAGS:-}" | ||
|
||
if [ ${MASON_PLATFORM_VERSION} == "cortex_a9" ] || [ ${MASON_PLATFORM_VERSION} == "i686" ]; then | ||
# XXX: This hack is because libpng does not respect CFLAGS | ||
# for all the files. Bruteforce in the compiler command line. | ||
export CC="${CC:-} ${CFLAGS}" | ||
fi | ||
|
||
./configure \ | ||
--prefix=${MASON_PREFIX} \ | ||
${MASON_HOST_ARG} \ | ||
--enable-static \ | ||
--with-pic \ | ||
--disable-shared \ | ||
--disable-dependency-tracking | ||
|
||
V=1 VERBOSE=1 make install -j${MASON_CONCURRENCY} | ||
} | ||
|
||
function mason_strip_ldflags { | ||
shift # -L... | ||
shift # -lpng16 | ||
echo "$@" | ||
} | ||
|
||
function mason_ldflags { | ||
mason_strip_ldflags $(`mason_pkgconfig` --static --libs) | ||
} | ||
|
||
function mason_clean { | ||
make clean | ||
} | ||
|
||
mason_run "$@" |