PKGBUILDs/core/pacman/PKGBUILD
2022-09-27 12:52:59 +00:00

122 lines
4.7 KiB
Bash

# vim: set ts=2 sw=2 et:
# Maintainer:
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - arch/host/flags for arm, armv6h, armv7h, and aarch64
# - pacman.conf: architecture=arm/armv6h/armv7h/aarch64, added our aur and alarm repos
# - makepkg.conf: adjusted C/CXX/LDFLAGS, drop -z,now for armv5
# - patch to sync filesystem after install/remove
# - reverts to allow scriplet input on stdin
# - patch to fix application/gzip change in file 5.37
pkgname=pacman
pkgver=6.0.1
pkgrel=8
pkgdesc="A library-based package manager with dependency support"
arch=('x86_64')
url="https://www.archlinux.org/pacman/"
license=('GPL')
groups=('base-devel')
depends=('bash' 'glibc' 'libarchive' 'curl' 'gpgme' 'pacman-mirrorlist'
'gettext' 'gawk' 'coreutils' 'gnupg' 'grep')
makedepends=('meson' 'asciidoc' 'doxygen')
checkdepends=('python' 'fakechroot')
optdepends=('perl-locale-gettext: translation support in makepkg-template')
provides=('libalpm.so')
backup=(etc/pacman.conf
etc/makepkg.conf)
options=('strip' 'debug')
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.xz{,.sig}
"fix-wkd-lookup.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/e1246baddd14ec6f4b6270b59bea0e1b639472a7.patch"
"patch-updatedb.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/58d678fa289034f1fe2a56adbb5e496b774755fc.patch"
add-flto-to-LDFLAGS-for-clang.patch
makepkg-use-ffile-prefix-map-instead-of-fdebug-prefi.patch
libmakepkg-add-extra-buildflags-only-when-buildflags.patch
make-link-time-optimization-flags-configurable.patch
0001-Sychronize-filesystem.patch
0002-Revert-close-stdin-before-running-install-scripts.patch
0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
pacman.conf
makepkg.conf)
sha256sums=('0db61456e56aa49e260e891c0b025be210319e62b15521f29d3e93b00d3bf731'
'SKIP'
'8ab5b1338874d7d58e11c5d1185ea3454fcc89755f9c18faf87ff348ad1ed16c'
'988acbb76a0bbd866ab76121191ba4a968bf12970d581fb81b47504c4d998e96'
'82ff91b85f4c6ceba19f9330437e2a22aabc966c2b9e2a20a53857f98a42c223'
'b940e6c0c05a185dce1dbb9da0dcbebf742fca7a63f3e3308d49205afe5a6582'
'7d0aee976c9c71fcf7c96ef1d99aa76efe47d8c1f4451842d6d159ec7deb4278'
'5b43e26a76be3ed10a69d4bfb2be48db8cce359baf46583411c7f124737ebe6a'
'f9a8ae2805cc995ef1b787e10f402d574aaee183cc3a23fe26805555b7d87fea'
'7beb2faec0ec37dcb2050d9ed3c95353fb7f73da7e3bbe0e226e9e3f7858a01f'
'0fdbdc3c86b826fe87d8051a5d34db23b366b0a7bdc22f3701b1bf2b01218d59'
'19f189accab294af7085cb709417eb41784d21aa8da07a8aa24bf7591ec3ce94'
'd001efcbcbe97e4be27639cb7709813a40803e8aead8f544fc7c5b92fb64b062')
prepare() {
cd "$pkgname-$pkgver"
patch -Np1 -i ../add-flto-to-LDFLAGS-for-clang.patch
patch -Np1 -i ../makepkg-use-ffile-prefix-map-instead-of-fdebug-prefi.patch
patch -Np1 -i ../libmakepkg-add-extra-buildflags-only-when-buildflags.patch
patch -Np1 -i ../make-link-time-optimization-flags-configurable.patch
patch -Np1 -i ../fix-wkd-lookup.patch
patch -Np1 -i ../patch-updatedb.patch
patch -p1 -i ../0001-Sychronize-filesystem.patch
patch -p1 -i ../0002-Revert-close-stdin-before-running-install-scripts.patch
patch -p1 -i ../0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
}
build() {
cd "$pkgname-$pkgver"
meson --prefix=/usr \
--buildtype=plain \
-Ddoc=enabled \
-Ddoxygen=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/bin/ldconfig \
build
meson compile -C build
}
check() {
cd "$pkgname-$pkgver"
meson test -C build
}
package() {
cd "$pkgname-$pkgver"
DESTDIR="$pkgdir" meson install -C build
# install Arch specific stuff
install -dm755 "$pkgdir/etc"
install -m644 "$srcdir/pacman.conf" "$pkgdir/etc"
case $CARCH in
armv7h)
mycarch="armv7h"
mychost="armv7l-unknown-linux-gnueabihf"
myflags="-march=armv7-a -mfloat-abi=hard -mfpu=neon "
;;
aarch64)
mycarch="aarch64"
mychost="aarch64-unknown-linux-gnu"
myflags="-march=armv8-a "
;;
esac
install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
sed -i "$pkgdir/etc/makepkg.conf" \
-e "s|@CARCH[@]|$mycarch|g" \
-e "s|@CHOST[@]|$mychost|g" \
-e "s|@CARCHFLAGS[@]|$myflags|g"
sed -i $pkgdir/etc/pacman.conf -e "s|@CARCH[@]|$mycarch|g"
if [[ $CARCH == "arm" ]]; then
sed -i 's/,-z,now//' "$pkgdir/etc/makepkg.conf"
fi
}