From c98ed008fc2991d52925afd0bf176db80faf9ab2 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 29 Dec 2021 12:05:32 +0300 Subject: [PATCH] Remove libpng --- contrib/mingw64cross/mingw-w64.cmake | 2 +- mingw64_deps/zlib/build.sh | 38 ++++++++++++++++++++++++++++++++++ mingw64_deps/zlib/setup.sh | 8 +++++++ 3 files changed, 47 insertions(+), 1 deletions(-) create mode 100755 mingw64_deps/zlib/build.sh create mode 100755 mingw64_deps/zlib/setup.sh diff --git a/contrib/mingw64cross/mingw-w64.cmake b/contrib/mingw64cross/mingw-w64.cmake index ce6cda9..dd13b6f 100644 --- a/contrib/mingw64cross/mingw-w64.cmake +++ b/contrib/mingw64cross/mingw-w64.cmake @@ -19,8 +19,8 @@ set(CMAKE_FIND_ROOT_PATH $ENV{DEP_ROOT}/boost/${TOOLCHAIN_PREFIX} $ENV{DEP_ROOT}/db/${TOOLCHAIN_PREFIX} $ENV{DEP_ROOT}/openssl/${TOOLCHAIN_PREFIX} - $ENV{DEP_ROOT}/png/${TOOLCHAIN_PREFIX} $ENV{DEP_ROOT}/qt/${TOOLCHAIN_PREFIX} + $ENV{DEP_ROOT}/zlib/${TOOLCHAIN_PREFIX} ) set(BerkeleyDB_INC $ENV{DEP_ROOT}/db/${TOOLCHAIN_PREFIX}/include) diff --git a/mingw64_deps/zlib/build.sh b/mingw64_deps/zlib/build.sh new file mode 100755 index 0000000..79cfcd5 --- /dev/null +++ b/mingw64_deps/zlib/build.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +CROSS=$1 +ROOT=$(pwd) + +if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${CROSS} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! $(which ${CROSS}-w64-mingw32-clang) ]]; then +echo "llvm-mingw is not installed, please download it from https://github.com/mstorsjo/llvm-mingw/releases" +exit 1 +fi + +if [[ ! $(which make) ]]; then +echo "make is not installed, please install buld-essential package" +exit 1 +fi + +# Make build directoriy +cp -r ${ROOT}/zlib ${ROOT}/${CROSS}-w64-mingw32-build-zlib + +# Stage directory +mkdir ${ROOT}/${CROSS}-w64-mingw32 + +# Compile zlib +cd ${ROOT}/${CROSS}-w64-mingw32-build-zlib +perl -i -pe "s,(PREFIX =)\$,\$1 ${CROSS}-w64-mingw32-," win32/Makefile.gcc +make -j 4 -f win32/Makefile.gcc + +# Install zlib to our cross-tools directory +make install DESTDIR=${ROOT}/${CROSS}-w64-mingw32 INCLUDE_PATH=/include LIBRARY_PATH=/lib BINARY_PATH=/bin -f win32/Makefile.gcc + +# Remove build directory +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-w64-mingw32-build-zlib diff --git a/mingw64_deps/zlib/setup.sh b/mingw64_deps/zlib/setup.sh new file mode 100755 index 0000000..9401da7 --- /dev/null +++ b/mingw64_deps/zlib/setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ ! $(which git) ]]; then + echo "git is not installed" + exit -1 +fi + +git clone https://github.com/madler/zlib -- 1.7.1