# Maintainer: Johannes Schindelin _realname=7zip pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=26.00 pkgrel=1 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_repository_url='https://github.com/ip7z/7zip' msys2_references=( 'aur: 7-zip' "cpe: cpe:/a:7-zip:7-zip" ) license=('spdx:LGPL-2.1-or-later AND BSD-3-Clause') depends=("${MINGW_PACKAGE_PREFIX}-cc-libs") makedepends=("${MINGW_PACKAGE_PREFIX}-cc") source=("$url/a/7z${pkgver//./}-src.tar.xz" 001-disable-static.patch 002-fix-build-on-aarch64.patch 003-fix-sfxmod-location.patch) sha256sums=('3e596155744af055a77fc433c703d54e3ea9212246287b5b1436a6beac060f16' '80678c664cefb38e6402c83fc0878911c142e471ce42665291bb313d8c8e5185' '1162ef09dfec3a6622998141e8b1b8841e71ab94e3a9fffac057c5034550ead5' 'c0e2df712efa483aa123abfc6206e4f5a8aa5fe877fc8756be13f9bbef343091') 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 patch -p1 -i "${srcdir}"/002-fix-build-on-aarch64.patch patch -p1 -i "${srcdir}"/003-fix-sfxmod-location.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 install -Dm644 "${srcdir}"/DOC/copying.txt -t "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/ install -Dm644 "${srcdir}"/DOC/License.txt -t "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/ install -Dm644 "${srcdir}"/DOC/unRarLicense.txt -t "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/ }