Bug 251512 - print/freetype2: Convert to CMake and rearrange Makefile
Summary: print/freetype2: Convert to CMake and rearrange Makefile
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on: 252337 252112 252114 252115
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-01 21:03 UTC by daniel.engberg.lists
Modified: 2021-01-01 21:20 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+
antoine: exp-run-


Attachments
Patch for freetype2 (6.87 KB, patch)
2020-12-01 21:03 UTC, daniel.engberg.lists
no flags Details | Diff
Patch for freetype2 v2 (6.83 KB, patch)
2020-12-10 22:05 UTC, daniel.engberg.lists
no flags Details | Diff
Patch for freetype2 v3 (8.89 KB, patch)
2020-12-21 21:43 UTC, daniel.engberg.lists
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description daniel.engberg.lists 2020-12-01 21:03:06 UTC
Created attachment 220147 [details]
Patch for freetype2

* Convert to CMake, reduces patching and builds faster
* Clean up MASTER_SITES and use SAVANNAH alias
* Rearrange Makefile to make it easier to read and follow

This change removes freetype-config which isn't a default option and majority of distros does not ship it and static library.

Compile tested on FreeBSD 13.0-CURRENT #0 r367711 (amd64)
Poudriere testport OK 12.2-RELEASE (amd64)
Comment 1 Tobias C. Berner freebsd_committer 2020-12-10 17:54:09 UTC
Moin moin 

Thank you very much this is very appreciated.

All the
CMAKE_ARGS+=-DFOO=true -DBAR=false

could be

CMAKE_ON=FOO
CMAKE_OFF=BAR

which I consider more readable and cleaner :)


is LCD_FILTERING_CFLAGS used ad all?


mfg Tobias
Comment 2 daniel.engberg.lists 2020-12-10 22:05:14 UTC
Created attachment 220441 [details]
Patch for freetype2 v2

Use CMAKE_OFF and _ON as suggested by tcberner@
Comment 3 daniel.engberg.lists 2020-12-10 22:06:07 UTC
As for the option it still seems valid as far as I can tell?
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/devel/ftoption.h#n116
Comment 4 Tobias C. Berner freebsd_committer 2020-12-19 19:33:35 UTC
Moin moin 

dekstop@ would like to ask for an exp-run of the patch.


mfg Tobias
Comment 6 daniel.engberg.lists 2020-12-21 21:43:43 UTC
Created attachment 220792 [details]
Patch for freetype2 v3

Patch CMake(Lists.txt) to mimic GNU Autotools

CMake adds libbz2 to Requires.private in freetype2.pc which makes pkgconf assume there's a pc file available however we don't provide one for base and therefore fails to locate libbz2.

*** Old (autotools) ***

prefix=/usr/local
exec_prefix=/usr/local
libdir=/usr/local/lib
includedir=/usr/local/include

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

*** CMake patched (v3) ***

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: 23.4.17
Requires:
Requires.private: zlib, libpng
Libs: -L${libdir} -lfreetype
Libs.private: -lbz2
Cflags: -I${includedir}/freetype2

Compile tested on FreeBSD 13.0-CURRENT r368713 (amd64) with fontconfig
Poudriere testport OK 12.2-RELEASE (amd64) with fontconfig
Poudriere testport OK 11.4-RELEASE (amd64) with fontconfig

Sorry for the breakage!
Comment 8 Antoine Brodin freebsd_committer 2020-12-24 10:07:53 UTC
Removing freetype-config is a bad move,  having it optional is also strange it should be mandatory.
Comment 9 daniel.engberg.lists 2020-12-24 10:54:49 UTC
It's been deprecated for over 2 years now ( https://www.freetype.org/freetype2/docs/tutorial/step1.html ) and the majority of distroes have moved on. I (now) have have patches for all mentioned ports. Is there a "simple" way to test users (forward dependencies) using Poudriere?
Comment 10 Antoine Brodin freebsd_committer 2020-12-24 11:30:54 UTC
pkg rquery "%B %o" | grep libfreetype.so.6 | sed "s|.* \(.*\)|\1@all|" > list

poudriere bulk -f list