Newer
Older
# Maintainer: Philip Müller <philm@manjaro.org>
# Maintainer: Guinux <guillaume@manjaro.org>
# Maintainer: Rob McCathie <rob@manjaro.org>
# Contributor: Dan Johansen
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Morten Linderud <foxboron@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - arch/host/flags for armv7h, and aarch64
# - pacman.conf: architecture=armv7h/aarch64
# - makepkg.conf: adjusted C/CXX/LDFLAGS
# - patch to sync filesystem after install/remove
# - reverts to allow scriplet input on stdin
# - patch to fix application/gzip change in file 5.37
# use annotated tag and patch level commit from release branch (can be empty for no patches)
_git_tag=7.0.0
_git_patch_level_commit=77361331ae3864c6ea880e715c5864d59336f275
pkgdesc="A library-based package manager with dependency support"
depends=(
bash
coreutils
curl
gawk
gettext
glibc
gnupg
gpgme
grep
libarchive
pacman-mirrorlist
systemd
)
makedepends=(
asciidoc
doxygen
git
meson
)
checkdepends=(
fakechroot
python
)
optdepends=(
'base-devel: required to use makepkg'
'perl-locale-gettext: translation support in makepkg-template'
)
provides=('libalpm.so')
etc/makepkg.conf
etc/makepkg.conf.d/rust.conf)
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
source=("git+https://gitlab.archlinux.org/pacman/pacman.git#tag=v${_git_tag}?signed"
revertme-makepkg-remove-libdepends-and-libprovides.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/354a300cd26bb1c7e6551473596be5ecced921de.patch
libalpm-sandbox-guinux.patch #Fix a crash in sandbox
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
alpm.sysusers
rust.conf)
sha256sums=('06d082c3ce6f0811ca728515aa82d69d372800bd3ada99f5c445ef9429b6e3a6'
'b3bce9d662e189e8e49013b818f255d08494a57e13fc264625f852f087d3def2'
'3475d9f8a33ba51f5f54b53c696556989ed97c7bc6363a62ed4bca9a50a6338a'
'e055c072608bac62f6d74ab980b3851ac740ae476847de2f5dd5021fd97613ab'
'b36c4975286f8dea0fc3c64abf52706c31cb6d6e2c05a4983834b5417e23e802'
'7ea05a9457f3b6b1edd9dc82f8a1231b0b9048e8c0a7e75fb99abb330a304234'
'72b2acf61920171fd404656e4227db3bd24cfc81cf31b353ccbae6054c43aece'
'02abd46887d75f267eac36cad7bf9951b984c2ccee2ea37150c0cd36a8f3e7bd'
'c8760d7ebb6c9817d508c691c67084be251cd9c8811ee1ccf92c1278bad74c1c'
'3d7579f4fa52ef512dc82187c010f273aa45e6e8349f8fda9839f808c7dae042')
pkgver() {
cd "$pkgname"
git describe --abbrev=7 --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
cd "$pkgname"
# apply patch level commits on top of annotated tag
if [[ -n ${_git_patch_level_commit} ]]; then
if [[ v${_git_tag} != $(git describe --tags --abbrev=0 "${_git_patch_level_commit}") ]]; then
error "patch level commit ${_git_patch_level_commit} is not a descendant of v${_git_tag}"
exit 1
fi
git rebase "${_git_patch_level_commit}"
fi
# handle patches
local -a patches
patches=($(printf '%s\n' "${source[@]}" | grep '.patch'))
patches=("${patches[@]%%::*}")
patches=("${patches[@]##*/}")
if (( ${#patches[@]} != 0 )); then
for patch in "${patches[@]}"; do
if [[ $patch =~ revertme-* ]]; then
msg2 "Reverting patch $patch..."
patch -RNp1 < "../$patch"
else
msg2 "Applying patch $patch..."
patch -Np1 < "../$patch"
fi
done
fi
meson --prefix=/usr \
--buildtype=plain \
-Ddoc=enabled \
-Ddoxygen=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/bin/ldconfig \
build
meson compile -C build
DESTDIR="$pkgdir" meson install -C build
install -dm755 "$pkgdir/etc"
install -m644 "$srcdir/pacman.conf" "$pkgdir/etc"
install -D -m644 "$srcdir/alpm.sysusers" "${pkgdir}"/usr/lib/sysusers.d/alpm.conf
install -m644 "$srcdir/rust.conf" "$pkgdir/etc/makepkg.conf.d"
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 "
;;
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"
local wantsdir="$pkgdir/usr/lib/systemd/system/sockets.target.wants"
install -dm755 "$wantsdir"
local unit
for unit in dirmngr gpg-agent gpg-agent-{browser,extra,ssh} keyboxd; do
ln -s "../${unit}@.socket" "$wantsdir/${unit}@etc-pacman.d-gnupg.socket"
done