Split minizip from zlib package to allow build zlib while cmake not yet
compiled
This commit is contained in:
94
mingw-w64-minizip-git/PKGBUILD
Normal file
94
mingw-w64-minizip-git/PKGBUILD
Normal file
@@ -0,0 +1,94 @@
|
||||
# Maintainer: Alexey Pavlov <Alexpux@gmail.com>
|
||||
# Contributor: Martell Malone <martellmalone@gmail.com>
|
||||
# Contributor: Renato Silva <br.renatosilva@gmail.com>
|
||||
# Contributor: Ray Donnelly <mingw.android@gmail.com>
|
||||
|
||||
_realname=minizip
|
||||
pkgbase=mingw-w64-${_realname}-git
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git")
|
||||
replaces=("${MINGW_PACKAGE_PREFIX}-minizip")
|
||||
provides=("${MINGW_PACKAGE_PREFIX}-minizip")
|
||||
_base_ver=1.2
|
||||
pkgver=1.2.445.e67b996
|
||||
pkgrel=1
|
||||
pkgdesc="Compression library implementing the deflate compression method found in gzip and PKZIP (mingw-w64)"
|
||||
arch=('any')
|
||||
license=(ZLIB)
|
||||
url="https://www.zlib.net/"
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-bzip2" "${MINGW_PACKAGE_PREFIX}-zlib")
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
"git"
|
||||
"${MINGW_PACKAGE_PREFIX}-cmake")
|
||||
options=('staticlibs')
|
||||
source=("git+https://github.com/nmoinvaz/minizip#branch=1.2"
|
||||
010-unzip-add-function-unzOpenBuffer.patch
|
||||
011-minizip-cmake-pkgconfig.patch
|
||||
012-minizip-all-in-one-library.patch
|
||||
013-fix-cmake-destination.patch)
|
||||
sha256sums=('SKIP'
|
||||
'dcc6138a806fede86aa469fdb28afe4b3206272cf5530c1888fd7986f9c46e9b'
|
||||
'7856b9aabb0d8bfd4d43dc9a3e6cd8561f61af2089069579907225583f613a03'
|
||||
'7323d55572be4da277e586405ea0c68be1d41e62686c7e247a237d5a6c2f3e2d'
|
||||
'5062c51dd10626e179f5b3f3e55225c62390f6ba1f38dd4ef70b4fb7ba6926b2')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}"/${_realname}
|
||||
printf "%s.%s.%s" ${_base_ver} "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd ${srcdir}/${_realname}
|
||||
patch -p1 -i ${srcdir}/010-unzip-add-function-unzOpenBuffer.patch
|
||||
patch -p1 -i ${srcdir}/011-minizip-cmake-pkgconfig.patch
|
||||
patch -p1 -i ${srcdir}/012-minizip-all-in-one-library.patch
|
||||
patch -p1 -i ${srcdir}/013-fix-cmake-destination.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"/${_realname}
|
||||
declare -a extra_config
|
||||
if check_option "debug" "n"; then
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
||||
else
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
||||
fi
|
||||
|
||||
mkdir -p build-shared
|
||||
pushd build-shared > /dev/null
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe \
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
"${extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DDEF_ZLIB_ROOT=${MINGW_PREFIX} \
|
||||
../
|
||||
make
|
||||
popd > /dev/null
|
||||
|
||||
mkdir -p build-static
|
||||
pushd build-static > /dev/null
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe \
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
"${extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DDEF_ZLIB_ROOT=${MINGW_PREFIX} \
|
||||
../
|
||||
make
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${srcdir}/${_realname}
|
||||
pushd build-static > /dev/null
|
||||
make DESTDIR="${pkgdir}" install
|
||||
popd > /dev/null
|
||||
|
||||
pushd build-shared > /dev/null
|
||||
make DESTDIR="${pkgdir}" install
|
||||
popd > /dev/null
|
||||
}
|
||||
@@ -7,59 +7,31 @@ _external_minizip=yes
|
||||
_realname=zlib
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
||||
conflicts=("${MINGW_PACKAGE_PREFIX}-minizip")
|
||||
replaces=("${MINGW_PACKAGE_PREFIX}-minizip")
|
||||
provides=("${MINGW_PACKAGE_PREFIX}-minizip")
|
||||
pkgver=1.2.11
|
||||
pkgrel=5
|
||||
pkgrel=7
|
||||
pkgdesc="Compression library implementing the deflate compression method found in gzip and PKZIP (mingw-w64)"
|
||||
arch=('any')
|
||||
license=(ZLIB)
|
||||
url="https://www.zlib.net/"
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-bzip2")
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
"git"
|
||||
$([[ "$_external_minizip" == "yes" ]] && echo \
|
||||
"${MINGW_PACKAGE_PREFIX}-cmake"))
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
|
||||
options=('staticlibs')
|
||||
source=("https://zlib.net/current/${_realname}-${pkgver}.tar.gz"
|
||||
"git+https://github.com/nmoinvaz/minizip#branch=1.2"
|
||||
01-zlib-1.2.11-1-buildsys.mingw.patch
|
||||
03-dont-put-sodir-into-L.mingw.patch
|
||||
04-fix-largefile-support.patch
|
||||
06-add-64bit-functions-and-fix-typos.patch
|
||||
07-Add-no-undefined-to-link-to-enable-build-shared-vers.patch
|
||||
08-Add-bzip2-library-to-pkg-config-file.patch
|
||||
010-unzip-add-function-unzOpenBuffer.patch
|
||||
011-minizip-cmake-pkgconfig.patch
|
||||
012-minizip-all-in-one-library.patch
|
||||
013-fix-cmake-destination.patch)
|
||||
08-Add-bzip2-library-to-pkg-config-file.patch)
|
||||
sha256sums=('c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1'
|
||||
'SKIP'
|
||||
'ac91f905b695d71f6c9c471ac98c14a3ed989a1e2b2a3b1171b3f6dc6bfc31b4'
|
||||
'3d039f42194aade91dadf4174f55fd6db349fd8044db93875bed1042dcfe1f31'
|
||||
'3b36fe536a7458af2a9a494d70d24048da10c43423fd620ed93fa0a6ddd14f78'
|
||||
'6677eff383727cef5f6d142892fd1c78b5012e080dcede3d0651f96e9330c4e6'
|
||||
'fb83292f494f649ea7f1835aa4abea61acc593d7f90625741d42cd99cac0e075'
|
||||
'0be98a7e660e7c068856f08b9e92d6c73a6b0d88c3e29a9716140b147f7c23c5'
|
||||
'dcc6138a806fede86aa469fdb28afe4b3206272cf5530c1888fd7986f9c46e9b'
|
||||
'7856b9aabb0d8bfd4d43dc9a3e6cd8561f61af2089069579907225583f613a03'
|
||||
'7323d55572be4da277e586405ea0c68be1d41e62686c7e247a237d5a6c2f3e2d'
|
||||
'5062c51dd10626e179f5b3f3e55225c62390f6ba1f38dd4ef70b4fb7ba6926b2')
|
||||
'0be98a7e660e7c068856f08b9e92d6c73a6b0d88c3e29a9716140b147f7c23c5')
|
||||
|
||||
prepare() {
|
||||
if [ "${_external_minizip}" = "yes" ]; then
|
||||
pushd minizip > /dev/null
|
||||
patch -p1 -i ${srcdir}/010-unzip-add-function-unzOpenBuffer.patch
|
||||
patch -p1 -i ${srcdir}/011-minizip-cmake-pkgconfig.patch
|
||||
patch -p1 -i ${srcdir}/012-minizip-all-in-one-library.patch
|
||||
patch -p1 -i ${srcdir}/013-fix-cmake-destination.patch
|
||||
popd > /dev/null
|
||||
# Replace minizip with external
|
||||
rm -rf ${srcdir}/${_realname}-${pkgver}/contrib/minizip
|
||||
cp -r ${srcdir}/minizip/ ${srcdir}/${_realname}-${pkgver}/contrib
|
||||
fi
|
||||
|
||||
cd ${srcdir}/${_realname}-${pkgver}
|
||||
grep -A 24 '^ Copyright' zlib.h > LICENSE
|
||||
|
||||
@@ -80,43 +52,8 @@ build() {
|
||||
make -j1 all
|
||||
|
||||
# build minizip
|
||||
pushd contrib/minizip > /dev/null
|
||||
if [ "${_external_minizip}" = "yes" ]; then
|
||||
declare -a extra_config
|
||||
if check_option "debug" "n"; then
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
||||
else
|
||||
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
||||
fi
|
||||
|
||||
mkdir -p build-shared
|
||||
pushd build-shared > /dev/null
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe \
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
"${extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DDEF_ZLIB_ROOT=${srcdir}/${_realname}-${pkgver} \
|
||||
../
|
||||
make
|
||||
popd > /dev/null
|
||||
|
||||
mkdir -p build-static
|
||||
pushd build-static > /dev/null
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_PREFIX}/bin/cmake.exe \
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
||||
"${extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DDEF_ZLIB_ROOT=${srcdir}/${_realname}-${pkgver} \
|
||||
../
|
||||
make
|
||||
popd > /dev/null
|
||||
else
|
||||
if [ "${_external_minizip}" != "yes" ]; then
|
||||
pushd contrib/minizip > /dev/null
|
||||
autoreconf -fi
|
||||
CFLAGS+=" -DHAVE_BZIP2"
|
||||
./configure --prefix=${MINGW_PREFIX} \
|
||||
@@ -126,8 +63,8 @@ build() {
|
||||
--enable-demos \
|
||||
LIBS="-lbz2"
|
||||
make
|
||||
popd > /dev/null
|
||||
fi
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
check() {
|
||||
@@ -141,17 +78,9 @@ package() {
|
||||
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
|
||||
# install minizip
|
||||
pushd contrib/minizip > /dev/null
|
||||
if [ "${_external_minizip}" = "yes" ]; then
|
||||
pushd build-static > /dev/null
|
||||
if [ "${_external_minizip}" != "yes" ]; then
|
||||
pushd contrib/minizip > /dev/null
|
||||
make DESTDIR="${pkgdir}" install
|
||||
popd > /dev/null
|
||||
|
||||
pushd build-shared > /dev/null
|
||||
make DESTDIR="${pkgdir}" install
|
||||
popd > /dev/null
|
||||
else
|
||||
make DESTDIR="${pkgdir}" install
|
||||
fi
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user