Bug 260922 - print/ft2demos: fix build and use meson now, update to 2.11.1
Summary: print/ft2demos: fix build and use meson now, update to 2.11.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Daniel Engberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-04 12:46 UTC by Eric Gullufsen
Modified: 2022-01-18 17:47 UTC (History)
1 user (show)

See Also:


Attachments
Patch file to fix broken ft2demos port (2.81 KB, patch)
2022-01-04 12:46 UTC, Eric Gullufsen
no flags Details | Diff
patch for ft2demos (3.43 KB, patch)
2022-01-04 14:29 UTC, Eric Gullufsen
no flags Details | Diff
Patch file to fix broken ft2demos port (3.38 KB, patch)
2022-01-07 03:52 UTC, Eric Gullufsen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Gullufsen 2022-01-04 12:46:22 UTC
Created attachment 230684 [details]
Patch file to fix broken ft2demos port

Patch for ft2demos

* Convert to meson build system (from GNU Make)
* Use gitlab source which has meson.build

I did patch their meson.build to add -lm for compiling one of the demos (ftgrid), as build was failing otherwise

Compile tested on FreeBSD 14.0-CURRENT #0 main-n251803-33d56e57ece (amd64)
Comment 1 Eric Gullufsen 2022-01-04 14:09:32 UTC
Comment on attachment 230684 [details]
Patch file to fix broken ft2demos port

diff --git a/print/ft2demos/Makefile b/print/ft2demos/Makefile
index cc07936c3d94..02a411654dca 100644
--- a/print/ft2demos/Makefile
+++ b/print/ft2demos/Makefile
@@ -1,10 +1,10 @@
 # Created by: KANOU Hiroki <kanou@khdd.net>
 
 PORTNAME=	ft2demos
-PORTVERSION=	2.10.4
+PORTVERSION=	2.11.1
 CATEGORIES=	print
-MASTER_SITES=	SAVANNAH/freetype/ \
-		SF/freetype/freetype-demos/${PORTVERSION}
+
+MASTER_SITES=https://gitlab.freedesktop.org
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Demo programs for FreeType2
@@ -12,16 +12,20 @@ COMMENT=	Demo programs for FreeType2
 LICENSE=	BSD3CLAUSE GPLv2
 LICENSE_COMB=	dual
 
-BROKEN=		Doesn't build with FreeType 2.11.0
-
 BUILD_DEPENDS=	${NONEXISTENT}:print/freetype2:build
 LIB_DEPENDS=	libfreetype.so:print/freetype2 \
 		libpng.so:graphics/png
 
-USES=		gmake tar:xz xorg
-USE_XORG=	x11
+USES= tar:xz xorg
+USE_XORG= x11
 
-MAKE_ARGS=	EXES="${FT_PROGRAMS}" X11_PATH="${LOCALBASE}"
+USE_GITLAB= yes
+GL_PROJECT=freetype-demos
+GL_ACCOUNT=freetype
+GL_COMMIT=07027905d9a47664251b3ee362c5cfad1cddf86f
+
+USES=		meson tar:xz xorg
+USE_XORG=	x11
 
 PLIST_FILES=	${FT_PROGRAMS:S,^,bin/,}
 
@@ -29,10 +33,11 @@ FT_PROGRAMS=	ftbench ftchkwd ftdiff ftdump ftgamma ftgrid ftlint ftmemchk \
 		ftmulti ftpatchk ftstring fttimer ftvalid ftview
 
 post-extract:
-	${LN} -sf `${MAKE} -C ${.CURDIR}/../../print/freetype2 -V WRKSRC` ${WRKDIR}/freetype2
+	${LN} -sf `${MAKE} -C ${.CURDIR}/../../print/freetype2 -V WRKSRC` \
+	${WRKDIR}/${GL_PROJECT}-${GL_COMMIT}/subprojects/freetype2
 
 do-install:
-	@(cd ${WRKSRC}/bin/.libs && \
+	@(cd ${WRKSRC}/_build && \
 		${INSTALL_PROGRAM} ${FT_PROGRAMS} ${STAGEDIR}${PREFIX}/bin)
 
 .include <bsd.port.mk>
diff --git a/print/ft2demos/distinfo b/print/ft2demos/distinfo
index d2b1796799fb..1f573d4c8c9c 100644
--- a/print/ft2demos/distinfo
+++ b/print/ft2demos/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1603568666
-SHA256 (ft2demos-2.10.4.tar.xz) = 3f873ebe4fb387da3859149459f9be95320ce1fd56b50f8fdb9d2a8492887083
-SIZE (ft2demos-2.10.4.tar.xz) = 236712
+TIMESTAMP = 1641293484
+SHA256 (freetype-freetype-demos-07027905d9a47664251b3ee362c5cfad1cddf86f_GL0.tar.gz) = 61c872dde5aa69fc0a27019950c301cd3db7f11a776e4eb9859311d2fc0d3d5e
+SIZE (freetype-freetype-demos-07027905d9a47664251b3ee362c5cfad1cddf86f_GL0.tar.gz) = 342190
diff --git a/print/ft2demos/files/patch-Makefile b/print/ft2demos/files/patch-Makefile
deleted file mode 100644
index d4fdf71abe9c..000000000000
--- a/print/ft2demos/files/patch-Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
---- Makefile.orig	2017-03-29 16:20:30 UTC
-+++ Makefile
-@@ -136,11 +136,9 @@ else
-   # Enable C99 for gcc to avoid warnings.
-   # Note that clang++ aborts with an error if we use `-std=C99',
-   # so check for `++' in $(CC) also.
--  ifneq ($(findstring -pedantic,$(COMPILE)),)
-     ifeq ($(findstring ++,$(CC)),)
-       COMPILE += -std=c99
-     endif
--  endif
- 
-   FTLIB := $(LIB_DIR)/$(LIBRARY).$A
- 
diff --git a/print/ft2demos/files/patch-meson.build b/print/ft2demos/files/patch-meson.build
new file mode 100644
index 000000000000..69d0d5831227
--- /dev/null
+++ b/print/ft2demos/files/patch-meson.build
@@ -0,0 +1,11 @@
+--- meson.build.orig	2021-12-02 03:37:39.000000000 -0900
++++ meson.build	2022-01-04 02:25:43.961204000 -0900
+@@ -112,7 +112,7 @@
+ 
+ executable('ftgrid',
+   'src/ftgrid.c',
+-  dependencies: libfreetype2_dep,
++  dependencies: [libfreetype2_dep, math_dep],
+   include_directories: graph_include_dir,
+   link_with: [ftcommon_lib, output_lib],
+   install: true)
Comment 2 Eric Gullufsen 2022-01-04 14:29:50 UTC
Created attachment 230693 [details]
patch for ft2demos

I had forgotten to include removal of now unused files/patch-Makefile in my patch - since not using gmake don't need.

Also I erroneously added this as a comment before I knew how to obsolete attachments (new here). 

Thanks,
-Eric
Comment 3 Eric Gullufsen 2022-01-07 03:52:04 UTC
Created attachment 230776 [details]
Patch file to fix broken ft2demos port

Makefile was a bit sloppy, cleaned up (align values, remove duplicate USES line)

re-Tested build and use of built ftview on

FreeBSD 14.0-CURRENT #1 main-n252221-81ec547fbd3

Thanks!
-Eric
Comment 4 Eric Gullufsen 2022-01-08 01:54:55 UTC
*I meant my edits had been a little sloppy so cleaned them up in new patch.
Comment 5 Eric Gullufsen 2022-01-08 22:52:42 UTC
Poudriere testport OK 14.0-CURRENT (amd64)
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2022-01-10 19:37:08 UTC
Poudriere testport OK 12.2-RELEASE (amd64)
Poudriere testport OK 13.0-RELEASE (i386)

Great work!
I'll give this a go on my aarch64 box and commit afterwards unless it fails.
Comment 7 Eric Gullufsen 2022-01-11 18:03:51 UTC
Sweet! Thank you!
-Eric
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-01-16 13:55:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6e009d045607bf5a838613fa0593ae41cae63c8b

commit 6e009d045607bf5a838613fa0593ae41cae63c8b
Author:     Eric Gullufsen <ricky@rickysquid.org>
AuthorDate: 2022-01-16 13:50:01 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-01-16 13:50:14 +0000

    print/ft2demos: Update to 2.11.1 and unbreak

    Convert to meson build system (from GNU Make)
    Use gitlab source which has meson.build

    PR:             260922

 print/ft2demos/Makefile                      | 20 +++++++++++---------
 print/ft2demos/distinfo                      |  6 +++---
 print/ft2demos/files/patch-Makefile (gone)   | 14 --------------
 print/ft2demos/files/patch-meson.build (new) | 11 +++++++++++
 4 files changed, 25 insertions(+), 26 deletions(-)
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2022-01-16 13:56:59 UTC
Committed, thanks for your contribution!
Comment 10 Eric Gullufsen 2022-01-18 17:47:36 UTC
Super cool - thank you so much!
-Eric