[aur-general] Issue with a PKGBUILD

Ralf Mardorf ralf.mardorf at alice-dsl.net
Sun Apr 11 14:32:43 UTC 2021


Hi,

I don't understand why something that worked a short while back, doesn't
work anymore.




####
####

$ makepkg -s 
==> Making package: linux-rt-pussytoes 4.19.184_rt75-0.300 (Sun 11 Apr 2021 15:52:17 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
[snip]
  -> Found config
  -> Found 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
==> Validating source files with sha256sums...
    linux-4.19.184.tar.xz ... Skipped
    linux-4.19.184.tar.sign ... Skipped
    patch-4.19.184-rt75.patch.xz ... Skipped
    patch-4.19.184-rt75.patch.sign ... Skipped
    config ... Skipped
    0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch ... Passed
==> Verifying source file signatures with gpg...
    linux-4.19.184.tar ... Passed
    patch-4.19.184-rt75.patch ... Passed
==> Extracting sources...
  -> Extracting linux-4.19.184.tar.xz with bsdtar
==> Starting prepare()...
Setting version...
Applying patch patch-4.19.184-rt75.patch...
/tmp/linux-rt-pussytoes/PKGBUILD: line 62: ../patch-4.19.184-rt75.patch: No such file or directory
==> ERROR: A failure occurred in prepare().
    Aborting...




####
####

Not that long a go I used more or less the same PKGBUILD. If I use this
PKGBUILD today, it fails in the same way, as the attached PKGBUILD does:





$ pacman -Qi linux-rt-cornflower | grep -eVersion -eBuild
Version         : 4.19.173_rt72-0.300
Build Date      : Fri 19 Feb 2021 04:50:01 CET

$ uname -a
Linux archlinux 4.19.173-rt72-0.300-cornflower #1 SMP PREEMPT RT Fri, 19 Feb 2021 04:50:01 +0100 x86_64 GNU/Linux

$ diff /tmp/linux-rt-pussytoes/PKGBUILD /usr/src/linux-rt-cornflower-rm/PKGBUILD
1,3c1,3
< pkgbase=linux-rt-pussytoes
< _pkgver=4.19.184
< _rtpatchver=75
---
> pkgbase=linux-rt-cornflower
> _pkgver=4.19.173
> _rtpatchver=72
31d30
<   'D5653EA39C8675DA4BD5971C13B55DD07C53B851'  # Clark Williams
84c83
< 
---
>   
112c111
< 
---
>   pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
193c192
< 
---
>   pkgdesc="Documentation for the $pkgdesc kernel"




####
####

Regards,
Ralf
-------------- next part --------------
pkgbase=linux-rt-pussytoes
_pkgver=4.19.184
_rtpatchver=75
pkgver="${_pkgver}_rt${_rtpatchver}"
pkgrel=0.300
pkgdesc='The Linux RT kernel and modules - CONFIG_HZ=300'
arch=('x86_64')
url="https://wiki.linuxfoundation.org/realtime/start"
license=('GPL2')
makedepends=('bc' 'git' 'graphviz' 'imagemagick' 'inetutils' 'kmod' 'libelf'
'python-sphinx' 'python-sphinx_rtd_theme' 'xmlto')
options=('!strip')
_srcname=linux-${_pkgver}
source=(
  "https://www.kernel.org/pub/linux/kernel/v${_pkgver%%.*}.x/linux-${_pkgver}.tar.xz"
  "https://www.kernel.org/pub/linux/kernel/v${_pkgver%%.*}.x/linux-${_pkgver}.tar.sign"
  "https://www.kernel.org/pub/linux/kernel/projects/rt/${_pkgver%.*}/older/patch-${_pkgver}-rt${_rtpatchver}.patch.xz"
  "https://www.kernel.org/pub/linux/kernel/projects/rt/${_pkgver%.*}/older/patch-${_pkgver}-rt${_rtpatchver}.patch.sign"
  'config'
  '0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch'

)
validpgpkeys=(
  'ABAF11C65A2970B130ABE3C479BE3E4300411886'  # Linus Torvalds
  '647F28654894E3BD457199BE38DBBDC86092693E'  # Greg Kroah-Hartman
  '8218F88849AAC522E94CF470A5E9288C4FA415FA'  # Jan Alexander Steffens (heftig)
  '64254695FFF0AA4466CC19E67B96E8162A8CF5D1'  # Sebastian Andrzej Siewior
  '5ED9A48FC54C0A22D1D0804CEBC26CDB5A56DE73'  # Steven Rostedt
  'E644E2F1D45FA0B2EAA02F33109F098506FF0B14'  # Thomas Gleixner
  '5BDFC45C2ECC5387D50CE5EFDE09826778A38521'  # Tom Zanussi
  'D5653EA39C8675DA4BD5971C13B55DD07C53B851'  # Clark Williams
)
 #'D41CA3ED5B30275CF5A01B055AD24211C060D1C8'  # Stephen Rothwell
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'a13581d3c6dc595206e4fe7fcf6b542e7a1bdbe96101f0f010fc5be49f99baf2')


export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -R${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

prepare() {
  cd $_srcname

  echo "Setting version..."
  scripts/setlocalversion --save-scmversion
  echo "-$pkgrel" > localversion.10-pkgrel
  echo "${pkgbase#linux-rt}" > localversion.20-pkgname

  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    # picking up the RT patch
    src="${src//patch.xz/patch}"
    [[ $src = *.patch ]] || continue
    echo "Applying patch $src..."
    patch -Np1 < "../$src"
  done
  # removing cdomain configuration (incompatible with python-sphinx >= 3.0.0):
  # https://github.com/sphinx-doc/sphinx/issues/7421
  sed -e "s/'cdomain',//" -i Documentation/conf.py

  echo "Setting config..."
  cp ../config .config
  make olddefconfig
#  make menuconfig # CLI menu for configuration
#  make olddefconfig
  make -s kernelrelease > version
  echo "Prepared $pkgbase version $(<version)"
}

build() {
  cd $_srcname
  make all
  make htmldocs
}

_package() {

  depends=(coreutils kmod initramfs)
  optdepends=('crda: to set the correct wireless channels of your country'
              'linux-firmware: firmware images needed for some devices')

  cd $_srcname
  local kernver="$(<version)"
  local modulesdir="$pkgdir/usr/lib/modules/$kernver"

  echo "Installing boot image..."
  # systemd expects to find the kernel here to allow hibernation
  # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
  install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"

  # Used by mkinitcpio to name the kernel
  echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"

  echo "Installing modules..."
  make INSTALL_MOD_PATH="$pkgdir/usr" modules_install

  # remove build and source links
  rm "$modulesdir"/{source,build}

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

_package-headers() {


  cd $_srcname
  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"

  echo "Installing build files..."
  install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
    localversion.* version vmlinux
  install -Dt "$builddir/kernel" -m644 kernel/Makefile
  install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
  cp -t "$builddir" -a scripts

  # add objtool for external module building and enabled VALIDATION_STACK option
  install -Dt "$builddir/tools/objtool" tools/objtool/objtool

  # add xfs and shmem for aufs building
  mkdir -p "$builddir"/{fs/xfs,mm}

  # this is gone in v5.3
  mkdir "$builddir/.tmp_versions"

  echo "Installing headers..."
  cp -t "$builddir" -a include
  cp -t "$builddir/arch/x86" -a arch/x86/include
  install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s

  install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
  install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  echo "Installing KConfig files..."
  find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;

  echo "Removing unneeded architectures..."
  local arch
  for arch in "$builddir"/arch/*/; do
    [[ $arch = */x86/ ]] && continue
    echo "Removing $(basename "$arch")"
    rm -r "$arch"
  done

  echo "Removing documentation..."
  rm -r "$builddir/Documentation"

  echo "Removing broken symlinks..."
  find -L "$builddir" -type l -printf 'Removing %P\n' -delete

  echo "Removing loose objects..."
  find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete

  echo "Stripping build tools..."
  local file
  while read -rd '' file; do
    case "$(file -bi "$file")" in
      application/x-sharedlib\;*)      # Libraries (.so)
        strip -v $STRIP_SHARED "$file" ;;
      application/x-archive\;*)        # Libraries (.a)
        strip -v $STRIP_STATIC "$file" ;;
      application/x-executable\;*)     # Binaries
        strip -v $STRIP_BINARIES "$file" ;;
      application/x-pie-executable\;*) # Relocatable binaries
        strip -v $STRIP_SHARED "$file" ;;
    esac
  done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)

  echo "Adding symlink..."
  mkdir -p "$pkgdir/usr/src"
  ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

_package-docs() {


  cd $_srcname
  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"

  echo "Installing documentation..."
  local src dst
  while read -rd '' src; do
    dst="${src#Documentation/}"
    dst="$builddir/Documentation/${dst#output/}"
    install -Dm644 "$src" "$dst"
  done < <(find Documentation -name '.*' -prune -o ! -type d -print0)

  echo "Adding symlink..."
  mkdir -p "$pkgdir/usr/share/doc"
  ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
for _p in "${pkgname[@]}"; do
  eval "package_$_p() {
    $(declare -f "_package${_p#$pkgbase}")
    _package${_p#$pkgbase}
  }"
done


More information about the aur-general mailing list