Remove libpng
authoruser <balthazar@yandex.ru>
Wed, 29 Dec 2021 09:05:32 +0000 (12:05 +0300)
committeruser <balthazar@yandex.ru>
Wed, 29 Dec 2021 09:05:32 +0000 (12:05 +0300)
contrib/mingw64cross/mingw-w64.cmake
mingw64_deps/zlib/build.sh [new file with mode: 0755]
mingw64_deps/zlib/setup.sh [new file with mode: 0755]

index ce6cda9..dd13b6f 100644 (file)
@@ -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 (executable)
index 0000000..79cfcd5
--- /dev/null
@@ -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 (executable)
index 0000000..9401da7
--- /dev/null
@@ -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