Bug 290368 - print/freetype2: fix freetype2.pc
Summary: print/freetype2: fix freetype2.pc
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-19 17:44 UTC by Thierry Thomas
Modified: 2025-11-15 11:59 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (desktop)


Attachments
fix freetype2.pc where bzip2.pc is missing (1.55 KB, patch)
2025-10-19 17:44 UTC, Thierry Thomas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Thomas freebsd_committer freebsd_triage 2025-10-19 17:44:01 UTC
Created attachment 264725 [details]
fix freetype2.pc where bzip2.pc is missing

Since 2.14.1 (PR 289576), when a package has been built on a machine with bzip2.pc, this package cannot be used on a machine without it:

$ pkg-config freetype2 --libs
Package bzip2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `bzip2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'bzip2', required by 'freetype2', not found

With the attached patch, the problem is solved:

$ pkg-config freetype2 --libs
-L/usr/local/lib -lfreetype
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2025-10-19 18:26:11 UTC
Looks like there's something else going on with your box?

fetch "https://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/freetype2-2.14.1.pkg"
tar xf freetype2-2.14.1.pkg
tar: Removing leading '/' from member names
cat usr/local/libdata/pkgconfig/freetype2.pc
....
Requires:
Requires.private: zlib, libpng, libbrotlidec
Libs: -L${libdir} -lfreetype
Libs.private: -lbz2
Cflags: -I${includedir}/freetype2

pkg-config freetype2 --libs
-L/usr/local/lib -lfreetype
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2025-10-19 20:08:49 UTC
Try the same commands for FreeBSD-16:

$ fetch "https://pkg.freebsd.org/FreeBSD:16:amd64/latest/All/freetype2-2.14.1.pkg" 
$ tar xvf freetype2-2.14.1.pkg
$ cat usr/local/libdata/pkgconfig/freetype2.pc

prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: FreeType 2
URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
Version: 26.4.20
Requires: 
Requires.private: zlib, bzip2, libpng, libbrotlidec
Libs: -L${libdir} -lfreetype
Libs.private: 
Cflags: -I${includedir}/freetype2

More precisely:
$ grep Requires.private usr/local/libdata/pkgconfig/freetype2.pc
Requires.private: zlib, bzip2, libpng, libbrotlidec
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2025-10-19 20:10:57 UTC
(In reply to Thierry Thomas from comment #2)
16 provides a pc file so I don't really see how you'd end up with your scenario unless you're mixing and matching build hosts and ports/packages which is to my knowledge not supported.
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2025-10-19 20:23:34 UTC
Just two 16-CURRENT of different dates: on one machine (the package builder) bzip2.pc exists, and you installs the package on another machine slightly older.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2025-11-15 11:59:15 UTC
I'm closing this as its unsupported workflow/setup