Skip to content
Snippets Groups Projects
PKGBUILD 5.11 KiB
Newer Older
Strit's avatar
Strit committed
# Based on the file created for Arch Linux by:
# Dan McGee <dan@archlinux.org>
# Dave Reisner <dreisner@archlinux.org>

# Maintainer: Philip Müller <philm@manjaro.org>
# Maintainer: Guinux <guillaume@manjaro.org>
# Maintainer: Rob McCathie <rob@manjaro.org>
Dan Johansen's avatar
Dan Johansen committed
# Maintainer: Dan Johansen <strit@manjaro.org>
Strit's avatar
Strit committed

pkgname=pacman
pkgver=6.0.0
_pkgver=1.4.0
Strit's avatar
Strit committed
pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="http://www.archlinux.org/pacman/"
license=('GPL')
groups=('base-devel')
Dan Johansen's avatar
Dan Johansen committed
depends=('bash' 'glibc' 'libarchive' 'curl' 'perl' 'gpgme' 'archlinux-keyring' 'archlinuxarm-keyring' 'manjaro-keyring' 'manjaro-arm-keyring' 'pacman-mirrors' 'gawk')
makedepends=('meson' 'asciidoc' 'pacman>=5.2' 'doxygen')
Dan Johansen's avatar
Dan Johansen committed
optdepends=('haveged: for pacman-init.service'
            'perl-locale-gettext: translation support in makepkg-template'
            'findutils: for pacdiff --find'
            'mlocate: for pacdiff --locate'
            'sudo: privilege elevation for several scripts'
            'vim: default merge program for pacdiff')
provides=('pacman-contrib' 'pacman-init' 'libalpm.so')
Strit's avatar
Strit committed
conflicts=('pacman-contrib' 'pacman-init')
replaces=('pacman-contrib' 'pacman-init')
backup=(etc/pacman.conf etc/makepkg.conf)
install=pacman.install
options=('strip' 'debug')
source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.xz
        https://gitlab.archlinux.org/pacman/pacman-contrib/-/archive/v$_pkgver/pacman-contrib-v$_pkgver.tar.gz
        pacman-6.0.0-fix-404-download.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/3401f9e142ac4c701cd98c52618cb13164f2146b.patch
        pacman-6.0.0-fix-key-import-double-free.patch::https://gitlab.archlinux.org/pacman/pacman/-/commit/542910d684191eb7f25ddc5d3d8fe3060028a267.patch
Strit's avatar
Strit committed
        makepkg.conf
Dan Johansen's avatar
Dan Johansen committed
        0001-Sychronize-filesystem.patch
        0002-add-sync-first-option.patch
        0001-pactree-fix-compilation-with-pacman-6.patch
Strit's avatar
Strit committed
        pacman-init.service)

prepare() {
  cd $srcdir/$pkgname-$pkgver

Dan Johansen's avatar
Dan Johansen committed
  # Arch Linux ARM patches
  patch -p1 -i "${srcdir}/0001-Sychronize-filesystem.patch"
  patch -p1 -i "${srcdir}/pacman-6.0.0-fix-404-download.patch"
  patch -p1 -i "${srcdir}/pacman-6.0.0-fix-key-import-double-free.patch"
  
  # Manjaro patches
  patch -Np1 -i "${srcdir}/0002-add-sync-first-option.patch"
  patch -Np1 -i "${srcdir}/0003-fix-execution-of-pacman-hooks.patch"
Dan Johansen's avatar
Dan Johansen committed
    
  cd $srcdir/pacman-contrib-v$_pkgver
  patch -Np1 -i "${srcdir}/0001-pactree-fix-compilation-with-pacman-6.patch"
Dan Johansen's avatar
Dan Johansen committed
  ./autogen.sh

Strit's avatar
Strit committed
}

build() {
  cd $srcdir/$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
Strit's avatar
Strit committed

  cd $srcdir/pacman-contrib-v$_pkgver
Dan Johansen's avatar
Dan Johansen committed
  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var
Strit's avatar
Strit committed
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  DESTDIR="$pkgdir" meson install -C build
Strit's avatar
Strit committed

  # install Arch specific stuff
  install -dm755 $pkgdir/etc
  install -m644 $srcdir/pacman.conf $pkgdir/etc/pacman.conf
Strit's avatar
Strit committed
  
case $CARCH in
    armv6h)
      mycarch="armv6h"
      mychost="armv6l-unknown-linux-gnueabihf"
      myflags="-march=armv6 -mfloat-abi=hard -mfpu=vfp "
      ;;
    armv7h)
      mycarch="armv7h"
      mychost="armv7l-unknown-linux-gnueabihf"
      myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 "
      ;;
    aarch64)
      mycarch="aarch64"
      mychost="aarch64-unknown-linux-gnu"
      myflags="-march=armv8-a "
      ;;
esac
  install -m644 $srcdir/makepkg.conf $pkgdir/etc/
  # set things correctly in the default conf file
  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"
  [[ $CARCH == "arm" ]] && sed -i 's/,-z,now//' "$pkgdir/etc/makepkg.conf"
Strit's avatar
Strit committed

  # install pacman-init
  install -dm755 $pkgdir/usr/lib/systemd/system/
  install -m644 $srcdir/pacman-init.service $pkgdir/usr/lib/systemd/system/pacman-init.service

  cd $srcdir/pacman-contrib-v$_pkgver
Strit's avatar
Strit committed

  make DESTDIR="$pkgdir" install

  # remove rankmirrors
  rm "$pkgdir/usr/bin/rankmirrors"
Strit's avatar
Strit committed
}

sha256sums=('004448085a7747bdc7a0a4dd5d1fb7556c6b890111a06e029ab088f9905d4808'
            'c97b2889ab012feaa1882865af9cfeb2406c9045757d2e73b5903277472ce6a2'
            'f4c1c39b43b52ba19b656b32913688b81085c73685afe32d2018dbb695d5a1e6'
            'defdf1686d65fc896c19f41d1bc166912fccf9134b72e50da3b24538366cecdf'
            '2049a7ed4711de8b1d31b963c23460d37b65555fbe9083be222d8d6cf0520e38'
            'ddc85870ec034d779efe7de73531b99fb395b7aa0253e39a3a3dbd0fee75463a'
Dan Johansen's avatar
Dan Johansen committed
            '187bef40b14461ef7caba83e8124b6725e0cc9d46fa84353dae3b2afdc013589'
            '5c864e6c089f3fa699796b5b010378f1b3eddedcb4122a7ade9641cb348c2f95'
            'd6169005faf9491d0c5ef3a88c416a2cabd116cc59c28a733b2f854c85b376b4'
Dan Johansen's avatar
Dan Johansen committed
            '7c9b2519f0545f7acb864bc6b86a3c289a6c4bc0a3a55458b56d74cc0ea5ea47'
            '7343937734a025dd622f4dac5920e71331da1e74457b18b1f5c7409b15c3a253')