[arch-commits] Commit in fontconfig/trunk (5 files)

Jan Steffens heftig at archlinux.org
Tue Mar 23 18:43:53 UTC 2021


    Date: Tuesday, March 23, 2021 @ 18:43:50
  Author: heftig
Revision: 410785

2.13.93-1: meson, unsplit docs, hook for conf.d handling

Added:
  fontconfig/trunk/40-fontconfig-config.hook
  fontconfig/trunk/40-fontconfig-config.script
Modified:
  fontconfig/trunk/PKGBUILD
  fontconfig/trunk/fontconfig.hook
  fontconfig/trunk/fontconfig.install

-----------------------------+
 40-fontconfig-config.hook   |   11 +++++
 40-fontconfig-config.script |   12 +++++
 PKGBUILD                    |   90 ++++++++++++++++++------------------------
 fontconfig.hook             |    3 +
 fontconfig.install          |   18 +++++++-
 5 files changed, 82 insertions(+), 52 deletions(-)

Added: 40-fontconfig-config.hook
===================================================================
--- 40-fontconfig-config.hook	                        (rev 0)
+++ 40-fontconfig-config.hook	2021-03-23 18:43:50 UTC (rev 410785)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = Path
+Operation = Install
+Operation = Remove
+Target = usr/share/fontconfig/conf.default/*
+
+[Action]
+Description = Updating fontconfig configuration...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/40-fontconfig-config /etc/fonts/conf.d
+NeedsTargets

Added: 40-fontconfig-config.script
===================================================================
--- 40-fontconfig-config.script	                        (rev 0)
+++ 40-fontconfig-config.script	2021-03-23 18:43:50 UTC (rev 410785)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+while read -r f; do
+  link="${1:?}/${f##*/}"
+  if [[ -e $f && ! -e $link ]]; then
+    ln -sT "$f" "$link"
+  elif [[ ! -e $f && -L $link ]]; then
+    rm -f "$link"
+  fi
+done
+
+# vim:set sw=2 et:

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-03-23 18:40:47 UTC (rev 410784)
+++ PKGBUILD	2021-03-23 18:43:50 UTC (rev 410785)
@@ -1,27 +1,36 @@
 # Maintainer: Jan Alexander Steffens (heftig) <heftig at archlinux.org>
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 
-pkgbase=fontconfig
-pkgname=(fontconfig fontconfig-docs)
-pkgver=2.13.91+48+gfcb0420
-pkgrel=2
+pkgname=fontconfig
+pkgver=2.13.93
+pkgrel=1
 epoch=2
 pkgdesc="Library for configuring and customizing font access"
-url="https://www.freedesktop.org/wiki/Software/fontconfig/"
+url=https://www.freedesktop.org/wiki/Software/fontconfig/
 arch=(x86_64)
 license=(custom)
-makedepends=(git autoconf-archive gperf python-lxml python-six docbook-utils docbook-sgml
-             perl-sgmls 'texlive-formatsextra>=2017' lynx json-c expat freetype2)
-checkdepends=(unzip)
-_commit=fcb042028126d79ea5a5fa015b2b034b98656e73  # master
+depends=(libexpat.so libfreetype.so)
+makedepends=(git meson gperf expat freetype2
+             docbook-utils docbook-sgml perl-sgmls)
+provides=(libfontconfig.so fontconfig-docs)
+conflicts=(fontconfig-docs)
+replaces=('fontconfig-docs<2:2.13.93-1')
+install=fontconfig.install
+backup=(etc/fonts/fonts.conf)
+_commit=d06103e3e764bd43758e213414a1716858ab384c  # tags/2.13.93^0
 source=("git+https://gitlab.freedesktop.org/fontconfig/fontconfig.git#commit=$_commit"
+        40-fontconfig-config.script
+        40-fontconfig-config.hook
         fontconfig.hook)
-sha256sums=('SKIP'
-            '8883f7e6e9d574ed52b89256507a6224507925715ddc85b3dfab9683df2f1e25')
+b2sums=('SKIP'
+        '858b9bc59660a9f3858caffe18862dd78776d268269e98d08b9c37ce84be6e9b0af00754ae0e522337db402c617e762e0951794a89aceb632bb193540d7dad88'
+        'b06b3f2b8c0c38139a9247c26a641e6dc01d50b530478dd14133175a603f60b0af901af16c9fcf1ce73d23786ea14bfdbacd39f1dcfd88f6382965ad22be1411'
+        'dfbf47c069c88da7687511356cef5bb94b7190e558a6f08390d6976fa7065ba7137ccb0a5ca1defdef655091afe74eb8a3d33fb9f3e0633409aa79f753ad276d')
 
-# a nice page to test font matching:
-# http://zipcon.net/~swhite/docs/computers/browsers/fonttest.html
-# http://getemoji.com/
+prepare() {
+  cd fontconfig
+  git cherry-pick -n 4e42925096e9  # Fix meson install
+}
 
 pkgver() {
   cd fontconfig
@@ -28,50 +37,31 @@
   git describe --tags | sed 's/-/+/g'
 }
 
-prepare() {
-  cd fontconfig
-  NOCONFIGURE=1 ./autogen.sh
-}
-
 build() {
-  cd fontconfig
-  ./configure --prefix=/usr \
-    --sysconfdir=/etc \
-    --with-templatedir=/etc/fonts/conf.avail \
-    --localstatedir=/var \
-    --disable-static \
-    --with-default-fonts=/usr/share/fonts \
-    --with-add-fonts=/usr/local/share/fonts
-  make
+  arch-meson fontconfig build \
+    -D doc-txt=disabled \
+    -D doc-pdf=disabled \
+    -D doc-html=disabled
+  meson compile -C build
 }
 
 check() {
-  cd fontconfig
-  make -k check
+  meson test -C build --print-errorlogs
 }
 
-package_fontconfig() {
-  depends=(expat libfreetype.so)
-  provides=(libfontconfig.so)
-  install=fontconfig.install
-  backup=(etc/fonts/fonts.conf)
+package() {
+  DESTDIR="$pkgdir" meson install -C build
 
-  cd fontconfig
-  make DESTDIR="$pkgdir" install
+  # Handle conf.d using the hook to avoid overwriting the symlinks on upgrade
+  mkdir -p "$pkgdir/usr/share/fontconfig/conf.default"
+  for _f in "$pkgdir"/etc/fonts/conf.d/*.conf; do
+    ln -sr "$pkgdir"/usr/share/fontconfig/conf.{avail,default}/"${_f##*/}"
+    rm "$_f"
+  done
 
-  install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 ../*.hook
-  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 COPYING
-
-  # Split -docs
-  mkdir -p "$srcdir/doc/usr/share/man"
-  mv {"$pkgdir","$srcdir"/doc}/usr/share/doc
-  mv {"$pkgdir","$srcdir"/doc}/usr/share/man/man3
-}
-
-package_fontconfig-docs() {
-  pkgdesc+=" (documentation)"
-
-  mv doc/* "$pkgdir"
+  install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 *.hook
+  install -D 40-fontconfig-config.script \
+    "$pkgdir/usr/share/libalpm/scripts/40-fontconfig-config"
   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 fontconfig/COPYING
 }
 

Modified: fontconfig.hook
===================================================================
--- fontconfig.hook	2021-03-23 18:40:47 UTC (rev 410784)
+++ fontconfig.hook	2021-03-23 18:43:50 UTC (rev 410785)
@@ -3,7 +3,10 @@
 Operation = Install
 Operation = Upgrade
 Operation = Remove
+Target = etc/fonts/conf.d/*
 Target = usr/share/fonts/*
+Target = usr/share/fontconfig/conf.avail/*
+Target = usr/share/fontconfig/conf.default/*
 
 [Action]
 Description = Updating fontconfig cache...

Modified: fontconfig.install
===================================================================
--- fontconfig.install	2021-03-23 18:40:47 UTC (rev 410784)
+++ fontconfig.install	2021-03-23 18:43:50 UTC (rev 410785)
@@ -1,8 +1,22 @@
 post_upgrade() {
+  if (( $(vercmp $2 2:2.13.93-1) < 0 )); then
+    echo "Creating fontconfig configuration..."
+    find /usr/share/fontconfig/conf.default -mindepth 1 |
+      /usr/share/libalpm/scripts/40-fontconfig-config /etc/fonts/conf.d
+
+    (( $(vercmp $2 0) > 0 )) && cat <<END
+
+>>> If you have configured NoExtract to prevent symlinks in /etc/fonts/conf.d/
+    from being restored, these symlinks have been recreated one last time. You
+    can now delete the symlinks and remove the paths from NoExtract and they
+    will not be created again.
+
+END
+  fi
+
   # a full forced directory scan is required here
-  echo -n "Rebuilding fontconfig cache..."
+  echo "Rebuilding fontconfig cache..."
   /usr/bin/fc-cache -rs
-  echo " done."
 }
 
 post_install() {



More information about the arch-commits mailing list