Bug 239167

Summary: [exp-run] upgrade x11-fonts/fontconfig: update to 2.13.92 (remove libuuid dependency)
Product: Ports & Packages Reporter: Steve Wills <swills>
Component: Individual Port(s)Assignee: Tobias C. Berner <tcberner>
Status: Closed FIXED    
Severity: Affects Only Me CC: desktop, gnome, kwm, lightside, lwhsu, mfechner, swills, tcberner, theraven
Priority: --- Flags: tcberner: maintainer-feedback+
antoine: exp-run+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 245915    
Bug Blocks:    
Attachments:
Description Flags
patch to update fontconfig
none
Proposed patch for x11-fonts/fontconfig (since 479806 revision)
none
Proposed patch for x11-fonts/fontconfig-reference (since 469428 revision)
none
Proposed patch for x11-fonts/fontconfig (since 479806 revision)
none
Proposed patch for x11-fonts/fontconfig (since 479806 revision)
none
x11-fonts/fontconfig (since 479806 revision)
none
updated unified patch relative to PORTSDIR
none
updated unified patch relative to PORTSDIR, with missing patch
none
Proposed unified patch (since 479806 revision)
none
Proposed unified patch (since 479806 revision)
none
Proposed patch for deskutils/simpleagenda (since 492056 revision)
none
Proposed patch (since 528458 revision)
none
Proposed patch (since 528458 revision)
tcberner: maintainer-approval-
Patch for 2.13.92 version (since 528458 revision)
none
v1
none
Patch for 2.13.92 version (since 528919 revision)
none
Patch for 2.13.92 version (since 528919 revision) lightside: maintainer-approval? (desktop)

Description Steve Wills freebsd_committer 2019-07-12 16:15:15 UTC
Created attachment 205723 [details]
patch to update fontconfig
Comment 1 Steve Wills freebsd_committer 2019-07-12 16:18:11 UTC
Obtained from: https://github.com/freebsd/freebsd-ports-gnome/tree/gnome-3.32
Comment 2 lightside 2019-07-15 01:43:53 UTC
Created attachment 205785 [details]
Proposed patch for x11-fonts/fontconfig (since 479806 revision)

Hello.

I propose some changes for x11-fonts/fontconfig update (based on attachment #205723 [details]):
- Fix pkg-plist for non-default options
- Revert changes for REFERENCE_PORT check
- Remove CONFIGURE_ENV changes, because of following changes:
https://cgit.freedesktop.org/fontconfig/commit/?id=8f4c4d278d013f6cc69ba7d7bf0f8aed11398dfb
Comment 3 lightside 2019-07-15 01:44:54 UTC
Created attachment 205786 [details]
Proposed patch for x11-fonts/fontconfig-reference (since 469428 revision)

Don't know why there is a need to remove x11-fonts/fontconfig-reference port.
Possible to update it, with using changes for pkg-plist file.
Comment 4 lightside 2019-07-15 22:14:57 UTC
Created attachment 205810 [details]
Proposed patch for x11-fonts/fontconfig (since 479806 revision)

There is also a possibility to use some patches from upstream repository (or 2.13.91 version with some patches).

Attached new patch with files/patch-2.13.1.diff, just in case.
Comment 5 lightside 2019-07-16 18:48:16 UTC
Created attachment 205827 [details]
Proposed patch for x11-fonts/fontconfig (since 479806 revision)

Added changes from the following commit to the files/patch-2.13.1.diff:
Improve the performance a bit
https://cgit.freedesktop.org/fontconfig/commit/?id=cb3e6ff4d7628b6eb1dd8f78737de5c387aaf2e1
Comment 6 lightside 2019-07-16 19:12:07 UTC
(In reply to comment #5)
I used following commands to create (and check) files/patch-2.13.1.diff file:
-8<--
% git clone git://anongit.freedesktop.org/fontconfig
% git clone fontconfig fontconfig-devel
% cd fontconfig-devel
% git checkout -b devel 2.13.1
% setenv COMMITS "8208f99fa1676c42bfd8d74de3e9dac5366c150c 806fd4c2c5164d66d978b0a4c579c157e5cbe766 1aa8b700c3f09a31c78e7834e0db373f80b5e226 67b4090321c0ec3cf3dc96f6d3cd7b9d03af0f25 e4788c5a96e0f384ad5702ad8096b0e144613895 ff5b49be2be0922f0fb6b9daf08f64a88d2fae6b 5f5ec5676c61b9773026a9335c9b0dfa73a73353 5f12f564f8748deaa603adb7a4b8f616b6390ad4 f7036d589bffe353c1982b881afae6ec0a2ef200 648e0cf3d5a53efeab93b24ae37490427d05229d 9d5149ac41e18ab67404ddba41d7ef7e71839ebc b047e299546ac3abb79cf0bac3c67f5c2dfc7fb6 699d6e4d8415a5d94483ea81fdf277964a33b8f1 586e35450e9ca7c1dc647ceb9d75ac8ed08c5c16 97fa77d27facc6a31486fdca5b3b853c591f792c c336b8471877371f0190ba06f7547c54e2b890ba 66b0af41b81c5f0db1a8f952beaaada95e221d14 c0dc76268bb278c4bd123afbfb3409be64d0ed75 f2d4291d12ca1a2146d90da32a399fffff3e8227 322131f4330f972820fd903959999af9360120c0 a57f22bf6d93ad4079a6ae01fa00456921dc73e1 cb3e6ff4d7628b6eb1dd8f78737de5c387aaf2e1 2960391699ab3b417a17a0a2ac29e97e9c3d3c99"
% git cherry-pick $COMMITS
<..>
% git show -s --format="# %s%n# https://cgit.freedesktop.org/fontconfig/commit/?id=%H" $COMMITS > ../patch-2.13.1.diff
% echo >> ../patch-2.13.1.diff
% git diff --no-color --no-prefix 2.13.1 HEAD | sed -e '/^index/d ; /^deleted/d' >> ../patch-2.13.1.diff
% echo "How to check changes for used files in the final patch" > /dev/null
% sha256 fc-validate/fc-validate.c fontconfig/fontconfig.h fonts.dtd src/fccache.c src/fccfg.c src/fcdir.c src/fcfreetype.c src/fcint.h src/fcweight.c src/fcxml.c | sha256
a176090a086817ec1f7c3a42389d9264ce0372c088e113f895079268ad0a976b
% git checkout master
<..>
% git branch -D devel
<..>
-->8-
Comment 7 Steve Wills freebsd_committer 2019-07-16 23:02:50 UTC
Comment on attachment 205723 [details]
patch to update fontconfig

Other patches look fine to me, marking mine obsolete.
Comment 8 lightside 2019-07-18 00:32:53 UTC
Created attachment 205855 [details]
x11-fonts/fontconfig (since 479806 revision)

(In reply to comment #7)
Thanks for review.

Sorted OPTIONS_DEFINE.
Comment 9 Steve Wills freebsd_committer 2019-07-23 12:40:38 UTC
Created attachment 206007 [details]
updated unified patch relative to PORTSDIR

Here's an updated version of the patch that puts all changes in one file and is relative to PORTSDIR.
Comment 10 Steve Wills freebsd_committer 2019-07-23 12:59:27 UTC
Created attachment 206009 [details]
updated unified patch relative to PORTSDIR, with missing patch

Oops, missed adding a file there. This should be right.
Comment 11 Koop Mast freebsd_committer 2019-07-23 20:46:03 UTC
Apologies, I was under the impression that I already responded.

First off thanks for doing the work on this update.

I'm still having the opinion of deleting the -reference ports. They only contain development API documentation and I also keep forgetting they exist.
Comment 12 lightside 2019-07-24 08:57:16 UTC
Created attachment 206030 [details]
Proposed unified patch (since 479806 revision)

Thanks for review.

(In reply to comment #11)
If this is because of the need to update x11-fonts/fontconfig-reference/pkg-plist file, there is a possibility to remove it and use dynamic package list, like it already used for PORTDOCS in included devel/glib20-reference/bsd.gnome-reference.mk file:
--8<--
DATADIR=	${PREFIX}/man/man3
PORTDATA=	*
-->8--

How to check such package list:
-8<--
% make check-plist
% make -V TMPPLIST | xargs cat
-->8-

Attached this variant, just in case.
Comment 14 lightside 2019-07-26 19:32:57 UTC
Created attachment 206087 [details]
Proposed unified patch (since 479806 revision)

Added changes from the following commit to the files/patch-2.13.1.diff:
Fix a memory leak in FcFreeTypeQuery*()
https://cgit.freedesktop.org/fontconfig/commit/?id=e2f9f28aed1470a07c33a57940d68b6a3cbe235b
Comment 15 Antoine Brodin freebsd_committer 2019-07-28 05:30:56 UTC
New failure on 12.0 amd64:

http://package18.nyi.freebsd.org/data/120amd64-default-PR239167/2019-07-26_19h12m36s/logs/errors/simpleagenda-0.43_10.log

This seems to be a side effect of the new misc/e2fsprogs-libuuid dependency
Comment 16 lightside 2019-07-28 13:36:44 UTC
Created attachment 206117 [details]
Proposed patch for deskutils/simpleagenda (since 492056 revision)

Thanks for exp-run.

(In reply to comment #15)
> New failure on 12.0 amd64:
> <..>
> This seems to be a side effect of the new misc/e2fsprogs-libuuid dependency
Yes, the same happens for current x11-fonts/fontconfig v2.12.6, if install misc/e2fsprogs-libuuid port (for example, as dependency for other port(s)).

This is because of usage of following sed patch in deskutils/simpleagenda/Makefile:
https://github.com/freebsd/freebsd-ports/blob/0699c59a70f510b71506ecb61199c2ee997c9c8a/deskutils/simpleagenda/Makefile#L26
-8<--
	${REINPLACE_CMD} -e 's|-luuid||' ${WRKSRC}/GNUmakefile.preamble
-->8-
which removes linkage with uuid library.

Attached patch for deskutils/simpleagenda port.

To note:
The uuid library dependency was removed for fontconfig v2.13.91:
https://cgit.freedesktop.org/fontconfig/commit/?id=c4324f54ee16e648ba91f3e9c66af13ab3b1754c
Comment 17 lightside 2019-07-28 13:50:36 UTC
Comment on attachment 206117 [details]
Proposed patch for deskutils/simpleagenda (since 492056 revision)

(In reply to comment #16)
I also added base and gui to USE_GNUSTEP variable, because of stage-qa errors/warnings:
-8<--
====> Running Q/A tests (stage-qa)
<..>
Warning: you need USES+=gnustep and USE_GNUSTEP+=gui
<..>
Warning: you need USES+=gnustep and USE_GNUSTEP+=base
-->8-
Comment 18 Tobias C. Berner freebsd_committer 2020-03-14 21:32:50 UTC
Moin moin 

Sorry, I committed desktop@'s version [1] of the upgrade, without realizing (read checking) whether there was an open PR

mfg Tobias

[1] https://reviews.freebsd.org/D22411
[2] https://svnweb.freebsd.org/changeset/ports/528448
Comment 19 commit-hook freebsd_committer 2020-03-14 21:57:08 UTC
A commit references this bug:

Author: tcberner
Date: Sat Mar 14 21:56:19 UTC 2020
New revision: 528450
URL: https://svnweb.freebsd.org/changeset/ports/528450

Log:
  deskutils/simpleagenda: unbreak after r528448

  Pointy hat:	tcberner
  PR:		239167
  Submitted by:	lightside <lightside@gmx.com>

Changes:
  head/deskutils/simpleagenda/Makefile
Comment 20 Tobias C. Berner freebsd_committer 2020-03-14 22:21:12 UTC
I'll reintegrate the performance upgrade into a later commit.
Comment 21 commit-hook freebsd_committer 2020-03-14 22:30:14 UTC
A commit references this bug:

Author: tcberner
Date: Sat Mar 14 22:29:36 UTC 2020
New revision: 528458
URL: https://svnweb.freebsd.org/changeset/ports/528458

Log:
  x11-fonts/fontconfig: improve port

  This reintegrates work done by lightside and swills into the upgrade to 2.13.1:

  - add upstream performance improving patches
  - add nls option
  - drop unnecessary CONFIGURE_ENV

  PR:		239167
  Submitted by:	lightside <lightside@gmx.com>, swills

Changes:
  head/x11-fonts/fontconfig/Makefile
  head/x11-fonts/fontconfig/distinfo
  head/x11-fonts/fontconfig/files/patch-2.13.1.diff
  head/x11-fonts/fontconfig/pkg-plist
Comment 22 Tobias C. Berner freebsd_committer 2020-03-14 22:32:27 UTC
I'll keep the PR open for a while if there is fallout due to the missed exp-run.
Comment 23 lightside 2020-03-15 08:10:57 UTC
Thanks for attention to this PR and related patches.
Comment 24 Li-Wen Hsu freebsd_committer 2020-03-18 20:47:22 UTC
It seems all font ports will have leftover after uninstalling in poudriere:

=>> Checking for extra files and directories
=>> Error: Files or directories left over:
%%FONTSDIR%%/.uuid
@dir %%FONTSDIR%%
@dir share/fonts
share/fonts/.uuid

These directories and files seem to be created after fontconfig processing the fonts.  We probably want to register them to fontconfig.
Comment 25 lightside 2020-03-22 02:04:29 UTC
Created attachment 212601 [details]
Proposed patch (since 528458 revision)

Hello, Li-Wen Hsu.

(In reply to comment #24)
> It seems all font ports will have leftover after uninstalling in poudriere
> <..>
I did some search in /usr/local/share/fonts directory:
-8<--
% cd /usr/local/share/fonts && find . -type f -name .uuid
./util/.uuid
./webfonts/.uuid
./100dpi/.uuid
./75dpi/.uuid
./cyrillic/.uuid
./misc/.uuid
./encodings/large/.uuid
./encodings/.uuid
./dejavu/.uuid
./TTF/.uuid
./OTF/.uuid
./Type1/.uuid
<..>
./.uuid
<..>
-->8-

and this is true, that there are ".uuid" files in it and font's subdirectories. I didn't notice this, because these hidden files were created after fc-cache usage.

Probably possible to create uninstall script or some @unexec pkg-plist entry, which uses following command after fontconfig's deinstall:
cd /usr/local/share/fonts && find . -type f -name .uuid -delete && find * -type d -empty -delete

But mentioned command may delete user's created empty directories in ${PREFIX}/share/fonts directory also.

Or somehow register removal of .uuid file(s) for %%FONTSDIR%% of concrete font's port (and probably x11-fonts/encodings port also). While x11-fonts/fontconfig port may check ${PREFIX}/share/fonts/.uuid file after deinstall.

Attached patch for first variant, just in case.
Comment 26 lightside 2020-03-22 02:15:32 UTC
Created attachment 212602 [details]
Proposed patch (since 528458 revision)

(In reply to comment #25)
I guess, also possible to update MASTER_SITES:
-8<--
% curl -LI http://www.freedesktop.org/software/fontconfig/release/
HTTP/1.1 302 Found
Date: Sun, 22 Mar 2020 02:10:44 GMT
Server: Apache/2.4.38 (Debian)
Location: https://www.freedesktop.org/software/fontconfig/release/
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Sun, 22 Mar 2020 02:10:45 GMT
Server: Apache/2.4.38 (Debian)
Content-Type: text/html;charset=UTF-8
-->8-
Comment 27 lightside 2020-03-22 02:21:16 UTC
(In reply to comment #26)
Or some other command to check:
-8<--
% curl -LI http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.bz2
HTTP/1.1 302 Found
Date: Sun, 22 Mar 2020 02:19:01 GMT
Server: Apache/2.4.38 (Debian)
Location: https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.bz2
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Sun, 22 Mar 2020 02:19:02 GMT
Server: Apache/2.4.38 (Debian)
Last-Modified: Thu, 30 Aug 2018 08:27:20 GMT
ETag: "1a4cf7-574a2d7fd3c3a"
Accept-Ranges: bytes
Content-Length: 1723639
Content-Type: application/x-bzip2
-->8-
Comment 28 lightside 2020-03-22 02:32:43 UTC
Created attachment 212603 [details]
Patch for 2.13.92 version (since 528458 revision)

Probably this is not for this PR, but as I said in comment #16, currently latest 2.13.92 (RC) release doesn't require uuid library dependency and doesn't create .uuid files in ${PREFIX}/share/fonts directories.

Attached obsoleted patch, if someone may want to check, just in case.
Comment 29 Tobias C. Berner freebsd_committer 2020-03-22 05:33:08 UTC
Comment on attachment 212602 [details]
Proposed patch (since 528458 revision)

Moin moin

Thanks for the patch; but, shouldn't the unexec be rather added to the fonts themselves? Maybe via Uses/fonts.mk


mfg Tobias
Comment 30 lightside 2020-03-22 12:15:50 UTC
Hello, Tobias C. Berner.

(In reply to comment #29)
> Thanks for the patch; but, shouldn't the unexec be rather added to the fonts
> themselves? Maybe via Uses/fonts.mk
I guess, this may be counterproductive to bump PORTREVISION for all available fonts (and x11-fonts/encodings port), which may force to download such packages again for users. Such version of the patch may need some time to create/test, but feel free to propose your own version if available.

Personally, I thought about following strategy before your proposal:
1. Apply patch in attachment #212602 [details]
2. Wait about 2 weeks for next fontconfig release; also may give some time for users to update current fontconfig to latest PORTREVISION
3. Apply patches for next fontconfig release without uuid library dependency
Comment 31 Tobias C. Berner freebsd_committer 2020-03-22 12:48:14 UTC
(In reply to lightside from comment #30)

If I unserstand you correctly, you propose the following 
1) Create 'fontconfig-2.13,1_2' which cleans up after itself on deinstall (i.e. removes all uiid directories)
2) Once released, update the port to 'fontconfig-2.xx,1' and get rid of the fix again.

The issue with this idea would be, that not everyone would have updated to the "self-cleaning" version of step 1) before step 2).

Maybe the easiest solution is just to also add a pkg-message which is shown when upgrading to the next version, telling the user to remove the stale uuid files when upgrading 2).

(The cleanest solution would probably still be to handle it for every font, but as this state with the libuuid dependency will be very short-lived, this seems to be very over-kill to me. So I kind of prefer your approach).


mfg Tobias
Comment 32 Tobias C. Berner freebsd_committer 2020-03-22 14:28:13 UTC
Moin moin 

As discussed with lightside in IRC desktop@ would like to upgrade fontconfig to the RC 2.13.92. Arch linux for example also ships an RC [1]

This will remove the dependency on libbuuid again.

See patch https://bugs.freebsd.org/bugzilla/attachment.cgi?id=212603 by lightside for this.


[1] https://www.archlinux.org/packages/extra/x86_64/fontconfig/
Comment 33 Tobias C. Berner freebsd_committer 2020-03-22 14:29:32 UTC
Created attachment 212612 [details]
v1
Comment 34 Tobias C. Berner freebsd_committer 2020-03-22 14:31:04 UTC
Hi there

desktop@ would like to ask for an exp-run to upgrade fontonfig to 2.13.92.
The patch "v1" additionally includes an UPDATING and pkg-message with cleanup instructions.

It can also be found here:
https://people.freebsd.org/~tcberner/patches/fontconfig-2.13.92.v1.diff


mfg Tobias
Comment 35 lightside 2020-03-23 14:37:48 UTC
Created attachment 212643 [details]
Patch for 2.13.92 version (since 528919 revision)

- Added upstream patch to files/patch-2.13.92.diff file:
https://cgit.freedesktop.org/fontconfig/commit/?id=6f6b39780215714386606ca1c5457a7106639ff4
- Added UPDATING and x11-fonts/fontconfig/pkg-message files from attachment #212612 [details]

I think, this shouldn't affect current exp-run, if started for previous patch.
Comment 36 lightside 2020-03-23 14:55:57 UTC
Created attachment 212645 [details]
Patch for 2.13.92 version (since 528919 revision)

Fixed typo in UPDATING file for x11-fonts/fontconfig name.
Comment 37 Li-Wen Hsu freebsd_committer 2020-03-31 09:51:17 UTC
any news of the exp-run?
Comment 38 Antoine Brodin freebsd_committer 2020-04-01 21:03:39 UTC
Exp-run looks fine
Comment 39 commit-hook freebsd_committer 2020-04-03 20:02:51 UTC
A commit references this bug:

Author: tcberner
Date: Fri Apr  3 20:02:25 UTC 2020
New revision: 530516
URL: https://svnweb.freebsd.org/changeset/ports/530516

Log:
  x11-fonts/fontconfig: update to 2.13.92

  Fontconfig 2.13.1 generated .uuid files in the fonts directory which where
  not properly registered to the packages. To clean them up, please execute the
  following command:

          find %%LOCALBASE%%/share/fonts -type f -name .uuid -delete

  By switching to this RC, the dependency on libuuid can be droped again, and the
  issue of registering uuid is moot.

  PR:		239167
  Exp-run by:	antoine
  Submitted by:	lightside <lightside@gmx.com>
  MFH:		2020Q2

Changes:
  head/UPDATING
  head/x11-fonts/fontconfig/Makefile
  head/x11-fonts/fontconfig/distinfo
  head/x11-fonts/fontconfig/files/patch-2.13.1.diff
  head/x11-fonts/fontconfig/files/patch-2.13.92.diff
  head/x11-fonts/fontconfig/pkg-messsage
  head/x11-fonts/fontconfig/pkg-plist
  head/x11-fonts/fontconfig-reference/pkg-plist
Comment 40 Tobias C. Berner freebsd_committer 2020-04-03 20:03:39 UTC
Thanks for the exp-run, and especially big thanks to lightside for the patches.

I leave this open till the mfh lands.

mfg Tobias
Comment 41 commit-hook freebsd_committer 2020-04-03 20:15:54 UTC
A commit references this bug:

Author: tcberner
Date: Fri Apr  3 20:09:48 UTC 2020
New revision: 530517
URL: https://svnweb.freebsd.org/changeset/ports/530517

Log:
  MFH: r530516

  x11-fonts/fontconfig: update to 2.13.92

  Fontconfig 2.13.1 generated .uuid files in the fonts directory which where
  not properly registered to the packages. To clean them up, please execute the
  following command:

          find %%LOCALBASE%%/share/fonts -type f -name .uuid -delete

  By switching to this RC, the dependency on libuuid can be droped again, and the
  issue of registering uuid is moot.

  PR:		239167
  Exp-run by:	antoine
  Submitted by:	lightside <lightside@gmx.com>

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2020Q2/
  branches/2020Q2/UPDATING
  branches/2020Q2/x11-fonts/fontconfig/Makefile
  branches/2020Q2/x11-fonts/fontconfig/distinfo
  branches/2020Q2/x11-fonts/fontconfig/files/patch-2.13.1.diff
  branches/2020Q2/x11-fonts/fontconfig/files/patch-2.13.92.diff
  branches/2020Q2/x11-fonts/fontconfig/pkg-messsage
  branches/2020Q2/x11-fonts/fontconfig/pkg-plist
  branches/2020Q2/x11-fonts/fontconfig-reference/pkg-plist