-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathPKGBUILD
121 lines (102 loc) · 3.42 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Renato Silva <br.renatosilva@gmail.com>
_realname=libtiff
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-docs")
pkgver=4.7.0
pkgrel=1
pkgdesc="Library for manipulation of TIFF images (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://libtiff.gitlab.io/libtiff/"
msys2_references=(
"cpe: cpe:/a:libtiff:libtiff"
"cpe: cpe:/a:remotesensing:libtiff"
"cpe: cpe:/a:simplesystems:libtiff"
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-jbigkit"
"${MINGW_PACKAGE_PREFIX}-lerc"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libdeflate"
"${MINGW_PACKAGE_PREFIX}-libwebp"
"${MINGW_PACKAGE_PREFIX}-xz"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-python-sphinx")
source=(https://download.osgeo.org/libtiff/tiff-${pkgver}.tar.gz
0002-libtiff-install-headers.patch)
sha256sums=('67160e3457365ab96c5b3286a0903aa6e78bdc44c4bc737d2e486bcecb6ba976'
'493742947c8667655b6b89f2d7d27e92e1438a490ed86f50811112394b432a12')
prepare() {
cd tiff-${pkgver}
patch -p1 -i "${srcdir}/0002-libtiff-install-headers.patch"
# autoreconf to get updated libtool files for clang support
autoreconf -fiv
}
build() {
export CFLAGS+=" -fno-strict-aliasing"
export CXXFLAGS+=" -fno-strict-aliasing"
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"
../tiff-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-static \
--disable-shared \
--enable-cxx \
--enable-jbig \
--enable-lerc \
--enable-libdeflate \
--enable-webp
make
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"
../tiff-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--disable-static \
--enable-shared \
--enable-cxx \
--enable-jbig \
--enable-lerc \
--enable-libdeflate \
--enable-webp
make
}
check() {
cd "${srcdir}/build-${MSYSTEM}-static"
make check || true
cd "${srcdir}/build-${MSYSTEM}-shared"
make check || true
}
package_libtiff() {
make DESTDIR="${pkgdir}" -C "${srcdir}/build-${MSYSTEM}-static" install
make DESTDIR="${pkgdir}" -C "${srcdir}/build-${MSYSTEM}-shared" install
# License
# See https://fedoraproject.org/wiki/Licensing:MIT#Hylafax_Variant
install -Dm644 "${srcdir}/tiff-${pkgver}/LICENSE.md" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.md"
# split docs
mkdir -p dest${MINGW_PREFIX}/share
mv "${pkgdir}${MINGW_PREFIX}"/share/doc dest${MINGW_PREFIX}/share/doc
}
package_libtiff-docs() {
pkgdesc+=" (documentation)"
depends=()
mv dest/* "${pkgdir}"
}
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :
# generate wrappers
for _name in "${pkgname[@]}"; do
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
_func="$(declare -f "${_short}")"
eval "${_func/#${_short}/package_${_name}}"
done
# template end;