Skip to content
Snippets Groups Projects
PKGBUILD 5.14 KiB
Newer Older
Christian Hesse's avatar
Christian Hesse committed
# Maintainer: Christian Hesse <mail@eworm.de>

pkgname=lib32-systemd
_pkgbasename=systemd
_tag='1a43f634534bcafd9cbb39b93ce06783a3d92ae4' # git rev-parse v${_tag_name}
_tag_name=255-rc4
pkgver="${_tag_name/-/}"
Christian Hesse's avatar
Christian Hesse committed
pkgrel=1
Christian Hesse's avatar
Christian Hesse committed
pkgdesc='system and service manager (32-bit)'
Christian Hesse's avatar
Christian Hesse committed
url='https://www.github.com/systemd/systemd'
Christian Hesse's avatar
Christian Hesse committed
depends=('lib32-gcc-libs' 'lib32-libcap' 'lib32-libgcrypt' 'lib32-libxcrypt'
Christian Hesse's avatar
Christian Hesse committed
         'lib32-xz' 'lib32-zstd' 'systemd-libs')
makedepends=('git' 'gperf' 'intltool' 'lib32-acl' 'lib32-bzip2'
Christian Hesse's avatar
Christian Hesse committed
             'lib32-curl' 'lib32-dbus' 'lib32-gcc-libs' 'lib32-glib2'
Laurent Carlier's avatar
Laurent Carlier committed
             'lib32-gnutls' 'lib32-libelf' 'lib32-libidn2' 'lib32-pcre2'
             'libxslt' 'meson' 'python-jinja')
Christian Hesse's avatar
Christian Hesse committed
checkdepends=('systemd')
provides=('libsystemd.so' 'libudev.so')
Christian Hesse's avatar
Christian Hesse committed
validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4'  # Lennart Poettering <lennart@poettering.net>
Christian Hesse's avatar
Christian Hesse committed
              'A9EA9081724FFAE0484C35A1A81CEA22BC8C7E2E'  # Luca Boccassi <luca.boccassi@gmail.com>
              '9A774DB5DB996C154EBBFBFDA0099A18E29326E1'  # Yu Watanabe <watanabe.yu+github@gmail.com>
Christian Hesse's avatar
Christian Hesse committed
              '5C251B5FC54EB2F80F407AAAC54CA336CFEB557E') # Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Christian Hesse's avatar
Christian Hesse committed
source=("git+https://github.com/systemd/systemd-stable#tag=${_tag}?signed"
        "git+https://github.com/systemd/systemd#tag=v${_tag_name%.*}?signed")
sha512sums=('SKIP'
            'SKIP')
Laurent Carlier's avatar
Laurent Carlier committed
_backports=(
Laurent Carlier's avatar
Laurent Carlier committed
)

_reverts=(
Christian Hesse's avatar
Christian Hesse committed
prepare() {
  cd "$_pkgbasename-stable"

  # add upstream repository for cherry-picking
Christian Hesse's avatar
Christian Hesse committed
  git remote add -f upstream ../systemd

  local _c _l
Laurent Carlier's avatar
Laurent Carlier committed
  for _c in "${_backports[@]}"; do
    if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
    git log --oneline "${_l}" "${_c}"
    git cherry-pick --mainline 1 --no-commit "${_c}"
Christian Hesse's avatar
Christian Hesse committed
  done
Laurent Carlier's avatar
Laurent Carlier committed
  for _c in "${_reverts[@]}"; do
    if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
    git log --oneline "${_l}" "${_c}"
    git revert --mainline 1 --no-commit "${_c}"
Christian Hesse's avatar
Christian Hesse committed
  done
Christian Hesse's avatar
Christian Hesse committed
build() {
Laurent Carlier's avatar
Laurent Carlier committed
  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
Laurent Carlier's avatar
Laurent Carlier committed
  local _timeservers=({0..3}.arch.pool.ntp.org)
  local _nameservers=(
    # We use these public name services, ordered by their
    # privacy policy (hopefully):
    #  * Cloudflare (https://1.1.1.1/)
Christian Hesse's avatar
Christian Hesse committed
    #  * Quad9 (https://www.quad9.net/)
Laurent Carlier's avatar
Laurent Carlier committed
    #  * Google (https://developers.google.com/speed/public-dns/)
Christian Hesse's avatar
Christian Hesse committed
    '1.1.1.1#cloudflare-dns.com'
    '9.9.9.9#dns.quad9.net'
    '8.8.8.8#dns.google'
    '2606:4700:4700::1111#cloudflare-dns.com'
    '2620:fe::9#dns.quad9.net'
    '2001:4860:4860::8888#dns.google'
Laurent Carlier's avatar
Laurent Carlier committed
  )
 
  local _meson_options=(
Christian Hesse's avatar
Christian Hesse committed
    --libexecdir	/usr/lib32
    --libdir		/usr/lib32

    # internal version comparison is incompatible with pacman:
    #   249~rc1 < 249 < 249.1 < 249rc
    -Dversion-tag="${_tag_name/-/\~}-${pkgrel}-arch"
    -Dshared-lib-tag="${pkgver}-${pkgrel}"
Christian Hesse's avatar
Christian Hesse committed
    -Dmode=release
    # components & features
    -Dapparmor=false
Christian Hesse's avatar
Christian Hesse committed
    -Daudit=false
    -Dbacklight=false
    -Dbinfmt=false
Christian Hesse's avatar
Christian Hesse committed
    -Dblkid=false
    -Dbpf-framework=false
    -Dcoredump=false
    -Dcreate-log-dirs=false
    -Defi=false
    -Denvironment-d=false
    -Dfirstboot=false
    -Dhibernate=false
    -Dhomed=false
    -Dhostnamed=false
    -Dhtml=false
    -Dhwdb=false
Christian Hesse's avatar
Christian Hesse committed
    -Dima=false
Christian Hesse's avatar
Christian Hesse committed
    -Dkmod=false
Christian Hesse's avatar
Christian Hesse committed
    -Dlibcryptsetup=false
    -Dlibcryptsetup-plugins=false
    -Dlibfido2=false
Christian Hesse's avatar
Christian Hesse committed
    -Dlibidn2=true
Christian Hesse's avatar
Christian Hesse committed
    -Dlibiptc=false
    -Dlocaled=false
    -Dlogind=false
    -Dlz4=false
    -Dmachined=false
    -Dmachined=true
    -Dnetworkd=false
    -Dnss-myhostname=true
    -Dnss-mymachines=true
    -Dnss-resolve=true
    -Dnss-systemd=true
    -Doomd=false
    -Dpam=false
    -Dpasswdqc=false
    -Dportabled=false
    -Dpstore=false
    -Dpwquality=false
    -Dqrencode=false
    -Dquotacheck=false
    -Drandomseed=false
    -Dremote=false
    -Drepart=false
    -Dresolve=false
    -Dresolve=true
    -Drfkill=false
    -Dseccomp=false
    -Dselinux=false
    -Dsysext=false
    -Dsysusers=false
    -Dtimedated=false
    -Dtimesyncd=false
    -Dtmpfiles=false
    -Dtranslations=false
    -Dukify=false
    -Duserdb=false
    -Dutmp=false
    -Dvconsole=false
    -Dxdg-autostart=false
    -Dxenctrl=false
    -Dxkbcommon=false
Christian Hesse's avatar
Christian Hesse committed
    -Ddbuspolicydir=/usr/share/dbus-1/system.d
    -Ddefault-hierarchy=unified
Christian Hesse's avatar
Christian Hesse committed
    -Ddefault-kill-user-processes=false
    -Ddefault-locale='C.UTF-8'
Christian Hesse's avatar
Christian Hesse committed
    -Dfallback-hostname='archlinux'
    -Dnologin-path=/usr/bin/nologin
Laurent Carlier's avatar
Laurent Carlier committed
    -Dntp-servers="${_timeservers[*]}"
    -Ddns-servers="${_nameservers[*]}"
Christian Hesse's avatar
Christian Hesse committed
    -Drpmmacrosdir=no
    -Dsysvinit-path=
    -Dsysvrcnd-path=
  # this uses malloc_usable_size, which is incompatible with fortification level 3
  export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"

Laurent Carlier's avatar
Laurent Carlier committed
  arch-meson "$_pkgbasename-stable" build "${_meson_options[@]}"
Laurent Carlier's avatar
Laurent Carlier committed

Christian Hesse's avatar
Christian Hesse committed
  meson compile -C build
Christian Hesse's avatar
Christian Hesse committed
check() {
Laurent Carlier's avatar
Laurent Carlier committed
  meson test -C build
  meson install -C build --destdir "$pkgdir"
Laurent Carlier's avatar
Laurent Carlier committed
  rm -rf "${pkgdir}"/{etc,var}
Christian Hesse's avatar
Christian Hesse committed
  rm -rf "${pkgdir}"/usr/{bin,include,lib,lib32/systemd,share}