-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathPKGBUILD
59 lines (51 loc) · 2.1 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
# Maintainer: Johannes Schindelin <[email protected]>
_realname=7zip
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=24.09
pkgrel=3
pkgdesc="A file archiver with a high compression ratio (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://7-zip.org"
msys2_references=(
'aur: 7-zip'
"cpe: cpe:/a:7-zip:7-zip"
)
license=('spdx:LGPL-2.1-or-later AND BSD-3-Clause')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
source=("$url/a/7z${pkgver//./}-src.tar.xz"
001-disable-static.patch
002-guard-msvc-code.patch)
sha256sums=('49c05169f49572c1128453579af1632a952409ced028259381dac30726b6133a'
'80678c664cefb38e6402c83fc0878911c142e471ce42665291bb313d8c8e5185'
'6e2898dd658d760cf82b591d90031cd06cf670714e611a9d5b662bb25f426ded')
prepare () {
if [[ ${CC} == clang ]] ; then
sed -i 's/-Werror/ -Wno-missing-exception-spec -Wno-unused-but-set-variable -Wno-unknown-attributes/' */*.mak */*/*.mak
fi
patch -p1 -i "${srcdir}"/001-disable-static.patch
# https://sourceforge.net/p/sevenzip/bugs/2530/
patch -p1 -i "${srcdir}"/002-guard-msvc-code.patch
}
build() {
[[ -d build-${MSYSTEM} ]] && rm -rf build-${MSYSTEM}
mkdir -p build-${MSYSTEM}
cp -r CPP build-${MSYSTEM}/CPP
cp -r C build-${MSYSTEM}/C
cd build-${MSYSTEM}
make -C CPP/7zip/Bundles/Format7zF -f makefile.gcc
make -C CPP/7zip/UI/Console -f makefile.gcc
# undo 001-disable-static.patch for SFXCon in particular, it should be
# standalone
make -C CPP/7zip/Bundles/SFXCon -f makefile.gcc LDFLAGS_STATIC_2=-static
}
package() {
cd "${srcdir}"/build-${MSYSTEM}
install -D -m755 $(find CPP/7zip/Bundles/ -name \*.dll) -t "${pkgdir}"${MINGW_PREFIX}/bin/
install -D -m755 CPP/7zip/UI/Console/_o/7z.exe "${pkgdir}"${MINGW_PREFIX}/bin/7z.exe
install -D -m755 CPP/7zip/Bundles/SFXCon/_o/7zCon.exe "${pkgdir}"${MINGW_PREFIX}/lib/7zip/7zCon.sfx
install -d "${pkgdir}"${MINGW_PREFIX}/share/doc/7zip
install -D -m644 "${srcdir}"/DOC/* "${pkgdir}"${MINGW_PREFIX}/share/doc/7zip
}