summaryrefslogtreecommitdiff
path: root/libre/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'libre/pacman')
-rw-r--r--libre/pacman/PKGBUILD186
-rw-r--r--libre/pacman/makepkg.conf.in21
2 files changed, 133 insertions, 74 deletions
diff --git a/libre/pacman/PKGBUILD b/libre/pacman/PKGBUILD
index 6f3bbd303..7405d8974 100644
--- a/libre/pacman/PKGBUILD
+++ b/libre/pacman/PKGBUILD
@@ -18,31 +18,34 @@
# require openssl=1.1 during openssl v3 migration
# also openssl=1.0 for neglected/legacy systems
# TODO: relax after some grace period (~2024)
-# 2022-12-18: arch already dropped openssl-1.0
-# it is now in libre - we could maybe drop it after the grace period
+# 2022-12-18: arch already dropped openssl-1.0
+# it is now in libre - we could maybe drop it after the grace period
+
# archlinuxarm changes and rationale:
-# - arch/host/flags for arm, armv6h, armv7h, and aarch64
+# - arch/host/flags for armv7h, and aarch64
+# - pacman.conf: architecture=armv7h/aarch64, added our aur and alarm repos
+# - 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
pkgname=pacman
-pkgver=6.0.2
-pkgrel=8
+pkgver=6.1.0
+pkgrel=3
pkgrel+=.parabola1
pkgdesc="A library-based package manager with dependency support"
arch=('x86_64')
arch+=('armv7h' 'i686')
url="https://www.archlinux.org/pacman/"
+#license=('GPL-2.0-or-later') # TODO:
license=('GPL')
-groups=('base-devel')
depends=('bash' 'glibc' 'libarchive' 'curl' 'gpgme' 'pacman-mirrorlist'
'gettext' 'gawk' 'coreutils' 'gnupg' 'grep')
_upstream_keyring=$(case ${CARCH} in armv7h) echo 'archlinuxarm-keyring' ;; \
i686 ) echo 'archlinux32-keyring' ;; esac)
depends+=('archlinux-keyring' 'parabola-keyring' ${_upstream_keyring})
-depends+=('openssl>=3' 'openssl-1.0' 'openssl-1.1') # ease migration to openssl v3
+depends+=('openssl>=3' 'openssl-1.0' 'openssl-1.1') # BR #3372 ease migration to openssl v3
makedepends=('meson' 'asciidoc' 'doxygen')
checkdepends=('python' 'fakechroot')
optdepends=('perl-locale-gettext: translation support in makepkg-template')
@@ -53,35 +56,40 @@ options=('strip')
options+=('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}
- pacman-always-create-directories-from-debugedit.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/efd0c24c07b86be014a4edb5a8ece021b87e3900.patch
- pacman-always-create-directories-from-debugedit-fixup.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/86981383a2f4380bda26311831be94cdc743649b.patch
- pacman-fix-unique-source-paths.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/478af273dfe24ded197ec54ae977ddc3719d74a0.patch
- pacman-strip-include-o-files-similar-to-kernel-modules.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/de11824527ec4e2561e161ac40a5714ec943543c.patch
- pacman-fix-compatibility-with-bash-5.2-patsub_replacement.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/0e938f188692c710be36f9dd9ea7b94381aed1b4.patch
- pacman-fix-order-of-fakechroot-fakeroot-nesting.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/05f283b5ad8f5b8f995076e93a27c8772076f872.patch
+source=(https://gitlab.archlinux.org/pacman/pacman/-/releases/v$pkgver/downloads/pacman-$pkgver.tar.xz{,.sig}
+ revertme-makepkg-remove-libdepends-and-libprovides.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/354a300cd26bb1c7e6551473596be5ecced921de.patch
+ "$pkgname-fix-msg-unknown-key.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/6bb95c8856437513ee0ab19226bc090d6fd0fb06.patch"
+ "$pkgname-man-gitlab.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/95f148c2222db608a0d72d5c5577d0c71e7fa199.patch"
+ "$pkgname-make-aligned-titles.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/5e0496260b7d3f9c9fcf2b1c4899e4dbcc20ff03.patch"
+ "$pkgname-repo-add-parseopts.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/0571ee82bff0edbd5ffac2228d4e6ac510b9008e.patch"
+ "$pkgname-drop-result-warn.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/111eed0251238a9d3f90e76d62f2ac01aeccce48.patch"
+ "$pkgname-fix-debugedit.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/bae9594ac1806ce30f2af1de27c49bb101a00d44.patch"
pacman.conf
makepkg.conf)
-source=( ${source[*]/makepkg.conf/makepkg.conf.in} ) # makepkg.conf.in
-source=( ${source[*]/pacman.conf/} $(printf "pacman.conf.%s\n" "${arch[@]}" | sort) ) # pacman.conf.{armv7h,i686,x86_64}
+source=( ${source[*]/pacman.conf/$(printf "pacman.conf.%s\n" ${arch[*]} | sort)} ) # pacman.conf.{armv7h,i686,x86_64}
+source=( ${source[*]/makepkg.conf/makepkg.conf.in} ) # makepkg.conf.in
source+=(dummy.conf
9001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch
9002-pacman-key-updatedb.patch)
source_armv7h=(0001-Sychronize-filesystem.patch
0002-Revert-close-stdin-before-running-install-scripts.patch
0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch)
-sha256sums=('7d8e3e8c5121aec0965df71f59bedf46052c6cf14f96365c4411ec3de0a4c1a5'
+sha256sums=('5a60ac6e6bf995ba6140c7d038c34448df1f3daa4ae7141d2cad88eeb5f1f9d9'
'SKIP'
- '6fed94326b9ecfbb438ab17a4576b5e9d52ecc0f4574f29d46adfde3886dee03'
- 'd2bc104788290e3de829a232590b66ad745cf5b4762a01acc1191ebf70fef114'
- 'f3d4f39ef24e312f610cbb3439fb02bc6b8829e37bcf1a50ae50cd0a69bde5d0'
- 'd87d0c9957c613fda272553bee58140349d151ae399f346ddaf6d75ee5916312'
- '8641d514ef4cae9e4d1867aadf4b9c850a9e8dc9792c6c559f9d2a0e1713a5a1'
- 'b11f62d4bd9557e9d3e7456bc95f63e9eabab5ecee1368f4a14a84bc94b1c8d1'
- '0e87c4906efe4ac6e39b1a4c0243257092b4ed550e3cbe0739d0e52b8e87021f' # makepkg.conf.in
- '82a696bc3254b3fa2ab2666d239445e1a431b5e7d0152690f4265b82112cc86f' # pacman.conf.armv7h
- '8be3b33a28c74630b74d1997795424a1c0af82c26625a428ec139480fb1115a1' # pacman.conf.i686
- '5be276a68f7ec1d0497e26afba205a9feb14308b6fddc6cae3b32a0b6e9f9bbf') # pacman.conf.x86_64
+ 'b3bce9d662e189e8e49013b818f255d08494a57e13fc264625f852f087d3def2'
+ '94c987046c2ff232fa0d395cddc11644840d767806711e04ef34f876a9baf217'
+ '0774d7035e34661f74b673d4b0a94be877bdc0158a555b873ec6bd4e2c936377'
+ '7bb64910265ce2590f593cdfd302076e49f67a68f8cc792a9aaac572d36fc842'
+ '2bbfe40539513ff5775aaf900644c8985ef618f5df9af856b9d571e2501365b0'
+ '160515b741aadc876a67f213029f5f62a51ff072ea4aaeb687bbe614035bf72f'
+ '1f4e4cc54332e60c9da2bdabf9a80dc11db466535f1a0be298cbf654f0723721'
+ # pacman.conf over-ridden
+ # makepkg.conf over-ridden
+)
+sha256sums+=('82a696bc3254b3fa2ab2666d239445e1a431b5e7d0152690f4265b82112cc86f' # pacman.conf.armv7h
+ '8be3b33a28c74630b74d1997795424a1c0af82c26625a428ec139480fb1115a1' # pacman.conf.i686
+ '5be276a68f7ec1d0497e26afba205a9feb14308b6fddc6cae3b32a0b6e9f9bbf' # pacman.conf.x86_64
+ 'd8d68a71904d3e8015bf4454e1f2ae083c7b70624c5bb4b04331ee450d4285eb') # makepkg.conf.in
sha256sums+=('8fca32bf5ee85b67c93983d7e1c93734de5e715b3bb732f7e48b88da7844f94b'
'9ccc7ef5bd27a68d8788f10c6e5b36495c5d9038d4eb160f9ea4dc9901b622d8'
'39e4db3eed5dc522baffb7f853a7dbb7b417cc7a718599d768297adfbe99e263')
@@ -90,79 +98,119 @@ sha256sums_armv7h=('8d70fb5094f58aad98b601bbc42be354c2014b9fe734a1ee0b1e14bb041c
'2f586f72c34150330389854575a21be1d3ef3637c4f94bec2e948c2717a5aecb')
prepare() {
- cd "${pkgname}-${pkgver}"
- # we backport way too often in pacman
- # lets at least make it more convenient
- local src
- for src in "${source[@]}"; do
- src="${src%%::*}"
- src="${src##*/}"
- [[ $src = *.patch ]] || continue
- msg2 "Applying patch $src..."
- patch -Np1 < "../$src"
- done
+ cd "$pkgname-$pkgver"
+
+ # 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
## Parabola changes ##
# Generate the architecture-specific makepkg.conf files
- local carch chost cflags ldflags ltoflags dbgflags
+ local carch chost cflags cxxflags ldflags ltoflags rustflags dbgflags dbgrustflags
+ local options=() libdirs=()
for carch in ${arch[*]}
do case ${carch} in
aarch64)
chost='aarch64-unknown-linux-gnu'
cflags="-march=armv8-a \
-O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
- -fstack-clash-protection"
- ltoflags=''
- dbgflags='-fvar-tracking-assignments'
+ -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
+ -fstack-clash-protection \
+ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
+ cxxflags="\$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
+ ldflags='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
+ ltoflags=""
+ rustflags=""
+ dbgflags='-g -fvar-tracking-assignments'
+ dbgrustflags=""
+ options=(strip docs !libtool !staticlibs emptydirs zipman purge debug !lto)
+ libdirs=('lib:usr/lib')
;;
armv7h)
chost='armv7l-unknown-linux-gnueabihf'
cflags="-march=armv7-a -mfloat-abi=hard -mfpu=neon \
-O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
- -fstack-clash-protection"
- ltoflags=''
- dbgflags='-fvar-tracking-assignments'
+ -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
+ -fstack-clash-protection \
+ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
+ cxxflags="\$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
+ ldflags='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
+ ltoflags=""
+ rustflags=""
+ dbgflags='-g -fvar-tracking-assignments'
+ dbgrustflags=""
+ options=(strip docs !libtool !staticlibs emptydirs zipman purge debug !lto)
+ libdirs=('lib:usr/lib')
;;
i686)
chost='i686-pc-linux-gnu'
cflags="-march=i686 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
+ cxxflags="\$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
+ ldflags='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
ltoflags="-flto=auto"
- dbgflags=''
+ rustflags=""
+ dbgflags='-g'
+ #dbgrustflags=
+ options=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
+ #libdirs=()
;;
x86_64)
chost='x86_64-pc-linux-gnu'
cflags="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
- -fstack-clash-protection -fcf-protection"
+ -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
+ -fstack-clash-protection -fcf-protection \
+ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
+ cxxflags="\$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
+ ldflags="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
+ -Wl,-z,pack-relative-relocs"
ltoflags="-flto=auto"
- dbgflags=''
+ rustflags="-Cforce-frame-pointers=yes"
+ dbgflags="-g"
+ dbgrustflags="-C debuginfo=2"
+ options=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
+ libdirs=('lib:usr/lib' 'lib32:usr/lib32')
;;
esac
- ldflags='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
- # configure the per-arch default makepkg.conf files
sed < "${srcdir}"/makepkg.conf.in > "${srcdir}"/makepkg.conf.${carch} \
- -e "s|@CARCH[@]|${carch}|g" \
- -e "s|@CHOST[@]|${chost}|g" \
- -e "s|@CFLAGS[@]|${cflags}|g" \
- -e "s|@LDFLAGS[@]|${ldflags}|g" \
- -e "s|@LTOFLAGS[@]|${ltoflags}|g" \
- -e "s|@DBGFLAGS[@]|${dbgflags}|g"
+ -e "s|@CARCH@|${carch}|g" \
+ -e "s|@CHOST@|${chost}|g" \
+ -e "s|@CFLAGS@|${cflags}|g" \
+ -e "s|@CXXFLAGS@|${cxxflags}|g" \
+ -e "s|@LDFLAGS@|${ldflags}|g" \
+ -e "s|@LTOFLAGS@|${ltoflags}|g" \
+ -e "s|@RUSTFLAGS@|${rustflags}|g" \
+ -e "s|@DBGFLAGS@|${dbgflags}|g" \
+ -e "s|@DBGRUSTFLAGS@|${dbgrustflags}|g" \
+ -e "s|@OPTIONS@|${options[*]}|g" \
+ -e "s|@LIBDIRS@|${libdirs[*]}|g"
done
- # neutralize tests which require networking
+ # disable or neutralize tests which require networking
local net_check_url=https://repo.parabola.nu/check_network_status.txt
- local tests=() # eg: tests/sync-failover-404-with-body.py
- local sed_rx="s|/PKGBUILD|&$(printf "\\\n'%s': true," "${tests[@]}")|"
+ local fail_tests=() # eg: tests/sync-failover-404-with-body.py
+ local sed_rx="s|xfail_tests = {|&$(printf "\\\n '%s': true," "${fail_tests[@]}")|"
- if (( ${#tests[@]} ))
- then curl ${net_check_url} &> /dev/null || sed -i "${sed_rx}" test/pacman/meson.build
+ if (( ${#fail_tests[@]} )) && ! curl ${net_check_url} &> /dev/null
+ then sed -i "${sed_rx}" test/pacman/meson.build
fi
}
@@ -181,7 +229,7 @@ build() {
# terminate called after throwing an instance of 'ghc::filesystem::filesystem_error'
# what(): Value too large for defined data type: '/build/pacman/src'
# qemu: uncaught target signal 6 (Aborted) - core dumped
- [[ "${CARCH}" != armv7h ]] || meson configure -Ddoxygen=disabled build
+# [[ "${CARCH}" != armv7h ]] || meson configure -Ddoxygen=disabled build
meson compile -C build
}
@@ -205,6 +253,14 @@ package() {
install -m644 "$srcdir/pacman.conf" "$pkgdir/etc"
install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
+ 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
+
## install Parabola specific stuff ##
diff --git a/libre/pacman/makepkg.conf.in b/libre/pacman/makepkg.conf.in
index b3121548a..b1627974e 100644
--- a/libre/pacman/makepkg.conf.in
+++ b/libre/pacman/makepkg.conf.in
@@ -1,4 +1,6 @@
#!/hint/bash
+# shellcheck disable=2034
+
#
# /etc/makepkg.conf
#
@@ -39,17 +41,16 @@ CHOST="@CHOST@"
#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="@CFLAGS@"
-CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
+CXXFLAGS="@CXXFLAGS@"
LDFLAGS="@LDFLAGS@"
LTOFLAGS="@LTOFLAGS@"
-#RUSTFLAGS="-C opt-level=2"
+RUSTFLAGS="@RUSTFLAGS@"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
-DEBUG_CFLAGS="-g"
-DEBUG_CFLAGS+=" @DBGFLAGS@"
+DEBUG_CFLAGS="@DBGFLAGS@"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
-#DEBUG_RUSTFLAGS="-C debuginfo=2"
+DEBUG_RUSTFLAGS="@DBGRUSTFLAGS@"
#########################################################################
# BUILD ENVIRONMENT
@@ -78,7 +79,7 @@ BUILDENV=(!distcc color !ccache check !sign)
# These are default values for the options=() settings
#########################################################################
#
-# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
+# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto !autodeps)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
@@ -90,9 +91,9 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- purge: Remove files specified by PURGE_TARGETS
#-- debug: Add debugging flags as specified in DEBUG_* variables
#-- lto: Add compile flags for building with link time optimization
+#-- autodeps: Automatically add depends/provides
#
-OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
-OPTIONS=( ${OPTIONS[*]/\!debug/debug} ) # TODO: implement debuginfod?
+OPTIONS=(@OPTIONS@)
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256)
@@ -110,6 +111,8 @@ DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"
+#-- Prefix and directories for library autodeps
+LIB_DIRS=(@LIBDIRS@)
#########################################################################
# PACKAGE OUTPUT
@@ -137,7 +140,7 @@ DBGSRCDIR="/usr/src/debug"
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
-COMPRESSZST=(zstd -c -z -q -)
+COMPRESSZST=(zstd -c -T0 --ultra -20 -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)