123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- # Maintainer (arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
- # Maintainer (arch): Morten Linderud <foxboron@archlinux.org>
- # Maintainer (archarm): Kevin Mihelich <kevin@archlinuxarm.org>
- # Maintainer: Luke T. Shumaker <lukeshu@parabola.nu>
- # Contributor: André Silva <emulatorman@hyperbola.info>
- # Contributor: Márcio Silva <coadde@hyperbola.info>
- # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
- # Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar>
- # Contributor: Daniel Milewski <niitotantei@riseup.net>
- # Contributor: bill-auger <bill-auger@programmer.net>
- # ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
- # - 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
- # Parabola:
- # - pacman: backport
- # https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/152
- # per https://labs.parabola.nu/issues/3625
- # - pacman.conf, makepkg.conf: Provide the default files for all
- # architectures.
- # - makepkg: Allow "${X}.parabola${Y}" pkgrel values
- # - pacman-key: Have `pacman-key --updatedb` pass --yes to gpg, which
- # can help with expired keys.
- pkgname=pacman
- pkgver=6.1.0
- pkgrel=3
- pkgrel+=.parabola7
- 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')
- 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')
- validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
- 'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
- 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_armv7h=(arm-0001-Sychronize-filesystem.patch
- arm-0002-Revert-close-stdin-before-running-install-scripts.patch
- arm-0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch)
- source=(${source[@]/pacman.conf/"${arch[@]/#/pacman.conf.}"}) # Parabola: pacman.conf -> pacman.conf.{armv7h,i686,x86_64}
- source=("${source[@]/makepkg.conf/makepkg.conf.in}") # Parabola: makepkg.conf -> makepkg.conf.in
- source+=(1001-backport-url-fix.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/eb5bf6913835e7553433ef82bdf0a456528f9b50.patch # https://labs.parabola.nu/issues/3625
- 9001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch
- 9002-pacman-key-updatedb.patch)
- sha256sums=('5a60ac6e6bf995ba6140c7d038c34448df1f3daa4ae7141d2cad88eeb5f1f9d9'
- 'SKIP'
- 'b3bce9d662e189e8e49013b818f255d08494a57e13fc264625f852f087d3def2'
- '94c987046c2ff232fa0d395cddc11644840d767806711e04ef34f876a9baf217'
- '0774d7035e34661f74b673d4b0a94be877bdc0158a555b873ec6bd4e2c936377'
- '7bb64910265ce2590f593cdfd302076e49f67a68f8cc792a9aaac572d36fc842'
- '2bbfe40539513ff5775aaf900644c8985ef618f5df9af856b9d571e2501365b0'
- '160515b741aadc876a67f213029f5f62a51ff072ea4aaeb687bbe614035bf72f'
- '1f4e4cc54332e60c9da2bdabf9a80dc11db466535f1a0be298cbf654f0723721'
- '1f0563083ae048f54da8db2bc2790c9f21c09f2af54dadb6d00d8f6be5d537cc'
- 'fb668d67c2e8db6f1500e53706fbb0aee5213a494b30ce287524b62a818f94a4'
- 'ef6e712ac51a237d0d05be5805fb30fe952d255aaeb5d70ce851d39c76937903'
- '72c606c676252b72fcaab5ac3aa057332d748e1930200c7fa95c73e09208d898'
- '353069264dda744736ac57ef2bb1f7c6617a922252ca8e6be26b08a929cb3410'
- '9ccc7ef5bd27a68d8788f10c6e5b36495c5d9038d4eb160f9ea4dc9901b622d8'
- '39e4db3eed5dc522baffb7f853a7dbb7b417cc7a718599d768297adfbe99e263')
- sha256sums_armv7h=('8d70fb5094f58aad98b601bbc42be354c2014b9fe734a1ee0b1e14bb041cc9cc'
- '0e771370da68c855bfb4eaad4c2ae137883a474886a049b934dac2e775574cb9'
- '2f586f72c34150330389854575a21be1d3ef3637c4f94bec2e948c2717a5aecb')
- prepare() {
- 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 a "makepkg.conf.${carch}" file for each "${arch[@]}".
- local carch chost cflags ldflags
- local cxxflags ltoflags rustflags dbgflags dbgrustflags options libdirs
- for carch in "${arch[@]}"; do
- # Base definitions. Each architecture must still set `chost`,
- # `cflags`, and `ldflags`; and may modify these base definitions.
- cxxflags='$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS'
- ltoflags='-flto=auto'
- 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')
- zstdflags=(-T0 --ultra -20)
- case "$carch" in
- armv7h)
- chost='armv7l-unknown-linux-gnueabihf'
- # ALARM includes '-mno-omit-leaf-frame-pointer' in CFLAGS in
- # their pacman-6.1.0-3-armv7h.pkg.tar.xz, even though that
- # flag doesn't exist on armv7h (as of
- # gcc-14.1.1+r1+g43b730b9134-1-armv7h.pkg.tar.xz). So I guess
- # ALARM is just shipping a broken makepkg.conf?
- cflags='-march=armv7-a -mfloat-abi=hard -mfpu=neon -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
- -fstack-clash-protection \
- -fno-omit-frame-pointer'
- # ALARM includes '-Wl,-z,pack-relative-relocs' in LDFLAGS in
- # their pacman-6.1.0-3-armv7h.pkg.tar.xz, even though that
- # flag is x86- (and ppc64-?) -only. Depending on how the
- # compiler is called, that may result in a harmless warning on
- # stderr, or it may result in the compiler failing.
- ldflags='-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now'
- # overrides
- ltoflags=""
- rustflags=""
- dbgrustflags=""
- options=("${options[@]/#lto/!lto}") # disable lto
- zstdflags=(--single-thread) # optimize for memory use
- ;;
- i686)
- chost='i686-pc-linux-gnu'
- cflags='-march=i686 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
- -fstack-clash-protection -fcf-protection \
- -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
- ldflags='-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
- -Wl,-z,pack-relative-relocs'
- ;;
- x86_64)
- chost='x86_64-pc-linux-gnu'
- cflags='-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
- -fstack-clash-protection -fcf-protection \
- -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
- ldflags='-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
- -Wl,-z,pack-relative-relocs'
- # overrides
- libdirs+=('lib32:usr/lib32')
- ;;
- esac
- 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|@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[*]@Q}|g" \
- -e "s|@ZSTDFLAGS@|${zstdflags[*]}|g"
- done
- # Put the files for this arch at a neutral location.
- cp -T "${srcdir}/pacman.conf.${CARCH}" "${srcdir}"/pacman.conf
- cp -T "${srcdir}/makepkg.conf.${CARCH}" "${srcdir}"/makepkg.conf
- }
- 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"
- 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 ##
- # per-arch pacman.conf(s) and makepkg.conf(s)
- local carch
- for carch in "${arch[@]}"; do
- install -D -m644 -t "$pkgdir/usr/share/pacman/defaults/" "$srcdir/pacman.conf.$carch"
- install -D -m644 -t "$pkgdir/usr/share/pacman/defaults/" "$srcdir/makepkg.conf.$carch"
- done
- }
- # vim: set ts=2 sw=2 et:
|