Libpdfium-nojs package keeps on being reinstalled

I have a weird phenomenon with the package aur/libpdfium-nojs 4389.r1.157601b9b9-1. Everytime I am checking for updates the package is shown as “to be updated”:

17# paru -Syyu                       
:: Synchronisiere Paketdatenbanken...
 core                                                   129,9 KiB  3,62 MiB/s 00:00 [------------------------------------------------] 100%
 extra                                                 1640,1 KiB  21,9 MiB/s 00:00 [------------------------------------------------] 100%
 community                                                5,5 MiB  24,0 MiB/s 00:00 [------------------------------------------------] 100%
 multilib                                               150,5 KiB  24,5 MiB/s 00:00 [------------------------------------------------] 100%
 endeavouros                                             15,5 KiB   305 KiB/s 00:00 [------------------------------------------------] 100%
 liquorix                                                 2,7 KiB  0,00   B/s 00:00 [------------------------------------------------] 100%
:: Starte vollständige Systemaktualisierung...
Warnung: binutils: Ignoriere Paket-Aktualisierung (2.35.1-1 => 2.36.1-2)
 Es gibt nichts zu tun
:: Looking for AUR upgrades
:: Looking for devel upgrades
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...
:: Marked out of date: proton  spotify  wine-valve

Aur (1) libpdfium-nojs-4389.r1.157601b9b9-1

:: Proceed to review? [Y/n]: n

But the package is already installed:

20# pacman -Q | grep libpdfium-nojs
libpdfium-nojs 4389.r1.157601b9b9-1

When I reinstall the package it takes a few hours and then it is showing up again.

Any idea what is going wrong?

I haven’t looked at that package specifically but when that happens it is often caused by a broken pkgver() in the PKGBUILD. Essentially the pkgver() makes it looks like the package is always out of date.

2 Likes

it is back on the list to be installed again. I do not see any odd thing in the PKBGULD.

pkgver=4389.r1.157601b9b9

and installed is:

8# pacman -Q | grep libpdfium-nojs
libpdfium-nojs 4389.r1.157601b9b9-1

I guess I will contact the maintainer and ask him.

PKGBUILD
# Maintainer: Felix Kauselmann <licorn@gmail.com>

pkgname=libpdfium-nojs
pkgver=4389.r1.157601b9b9
pkgrel=1
pkgdesc="Open-source PDF rendering engine."
arch=('x86_64')
url="https://pdfium.googlesource.com/pdfium/"
license=('BSD')
depends=('freetype2' 'lcms2' 'libjpeg' 'openjpeg2' 'icu')
conflicts=('libpdfium-bin')
provides=('libpdfium')
makedepends=('git' 'python2' 'gn' 'ninja')

source=("git+https://pdfium.googlesource.com/pdfium"
    "git+https://chromium.googlesource.com/chromium/src/build.git"
    "libpdfium.pc"
    )

md5sums=('SKIP'
    'SKIP'
    'feb270967925a0844b1b9a9e15288eb3'
    )

pkgver() {

  cd $srcdir/pdfium

  # Version = branch name/number + number of commits since branch creation
  # + short head
  printf  "%s.r%s.%s" $(git rev-parse --abbrev-ref HEAD | cut -d '/' -f2)\
   $(git rev-list --count master..) $(git rev-parse --short HEAD)

}

prepare() {

  cd "$srcdir/pdfium"

  ln -sf $srcdir/build build

  # Pdfium is developed alongside Chromium and does not provide releases
  # Upstream recommends using Chromium's dev channels instead

  # Extract pdfium branch name used in stable channel from omahaproxy and do
  # a checkout
  git checkout "chromium/$(curl https://omahaproxy.appspot.com/linux?channel=stable | cut -d'.' -f 3)"

  # git checkout "chromium/$(curl https://omahaproxy.appspot.com/linux?channel=beta | cut -d'.' -f 3)"
  # git checkout "chromium/$(curl https://omahaproxy.appspot.com/linux?channel=dev | cut -d'.' -f 3)"

  # Extract build repo revision needed from DEPS file and do a checkout
  cd "$srcdir/pdfium/build"
  git checkout $(awk '/build_revision/ {print substr($2,2,40)}' $srcdir/pdfium/DEPS) -q
  
  # Use system provided icu library (unbundling)
  mkdir -p "$srcdir/pdfium/third_party/icu"
  ln -sf "$srcdir/build/linux/unbundle/icu.gn" "$srcdir/pdfium/third_party/icu/BUILD.gn"

  # Download and decode shim header script needed to unbundle icu (gittiles is weird)
  mkdir -p "$srcdir/pdfium/tools/generate_shim_headers/"
  echo "Downloading generate_shim_headers script from Chromium."
  curl https://chromium.googlesource.com/chromium/src/+/master/tools/generate_shim_headers/generate_shim_headers.py?format=TEXT \
    | base64 --decode > "$srcdir/pdfium/tools/generate_shim_headers/generate_shim_headers.py"
  echo "Done."
  
  # Create fake gclient_args.gni file to satisfy include list for build/config/compiler/compiler.gni
  touch "$srcdir/build/config/gclient_args.gni"
  
} 

build() {

  cd "$srcdir/pdfium"

  local _flags=(
      'is_clang=false'
      'use_sysroot=false'
      'is_debug=false'
      'symbol_level=0'
      'pdf_enable_v8=false'
      'pdf_enable_xfa=false'
      'treat_warnings_as_errors=false'
      'use_system_libjpeg=true'
      'use_system_zlib=true'
      'pdf_bundle_freetype=false'
      'use_system_freetype=true'
      'use_system_lcms2=true'
      'use_system_libpng=true'
      'use_custom_libcxx=false'
      'pdf_is_standalone = true'
      'use_system_libopenjpeg2 = true'
      'is_component_build = true'
      'use_gold = false' 
  )
  
  gn gen out/Release --script-executable=/usr/bin/python2 --args="${_flags[*]}"
  ninja -C out/Release pdfium

  # set pdfium version in pc file
  sed "s/@VERSION@/${pkgver}/g" -i "${srcdir}/libpdfium.pc"

}

package() {

  cd "$srcdir/pdfium"

  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D public/*.h --target-directory="${pkgdir}/usr/include/pdfium"
  install -D public/cpp/* --target-directory="${pkgdir}/usr/include/pdfium/cpp"
  install -D docs/* --target-directory="${pkgdir}/usr/share/doc/pdfium"
  install -Dm755 out/Release/libpdfium.so --target-directory="${pkgdir}/usr/lib"
  install -Dm644 ${srcdir}/libpdfium.pc --target-directory=${pkgdir}/usr/lib/pkgconfig

}

Is this strange AUR issue specific to paru?

No. I tried it with yay and it is the same thing.

Did you ever figure this out? I seem to be having the same issue with this package.

No, this was not sorted out for libpdfium-nojs.

In June I experienced a similar issue with package libadwaita-shortwave. I first thought that this is an issue with the AUR helper I am using (paru). So I opened an issue for it on github: https://github.com/Morganamilo/paru/issues/422

But during the discussion with the paru developer it became clear that this is an issue with how the PKGBUILD is written.

Luckily the package maintainer was listening to the suggestions from the paru developer and changed the package: https://aur.archlinux.org/packages/libadwaita-shortwave/

I did not go that far for libpdfium-nojs. I have simply put it on the IgnorePkg list.

The PKGBUILD is poorly written as it pulls the latest commits from the git repo rather than using a set commit. Either it should be a -git package, or it should specify a static commit.

1 Like

Alright thanks for the info. I’ll do the same.

Yes, it seems like it should be a ‘-git’ package.

After updating through YAD, I got a similar warning to your unsolved issue.

$ pacman -Q | grep libpdfium-nojs
libpdfium-nojs 4951.r2.f4c62094ab-1

This is because:

This means the version you have installed locally will always be newer than that listed in the PKGBUILD, and so you will always get that warning.

The only person who can fix this issue is the PKGBUILD maintainer.

1 Like

I haven’t had much success getting replies from package maintainers. I am doing the same as you.