Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2023 11:42:13 GMT
From:      "Jason E. Hale" <jhale@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 2aebc6c0b909 - 2023Q3 - misc/nut: Fix linking when FLTK option is on
Message-ID:  <202308211142.37LBgDXL047376@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2023Q3 has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2aebc6c0b9097bacd6c054a98cd8adfef76810b2

commit 2aebc6c0b9097bacd6c054a98cd8adfef76810b2
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2023-08-21 11:08:22 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2023-08-21 11:40:38 +0000

    misc/nut: Fix linking when FLTK option is on
    
    While here, use more options helpers and add a few missing XORG deps.
    
    Reported by:    Andrew Xiang <andrewxiang@gmail.com> via jbeich
    
    (cherry picked from commit 52382727a5c20bcfb142cbadced9a4b913abbdd4)
---
 misc/nut/Makefile              | 20 +++++++-------------
 misc/nut/files/patch-anameal.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/misc/nut/Makefile b/misc/nut/Makefile
index 0a87d4b6a913..04935a8cd992 100644
--- a/misc/nut/Makefile
+++ b/misc/nut/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	nut
 PORTVERSION=	20.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	misc
 MASTER_SITES=	SF
 PKGNAMEPREFIX=	health-
@@ -26,16 +26,10 @@ FLTK_LIB_DEPENDS=	libfreetype.so:print/freetype2 \
 			libfontconfig.so:x11-fonts/fontconfig \
 			libfltk_images.so:x11-toolkits/fltk
 FLTK_USES=		xorg
-FLTK_USE=		XORG=x11,xau,xcb,xdmcp,xext,xft,xinerama,xpm,xrender
+FLTK_USE=		XORG=x11,xau,xcb,xcursor,xdmcp,xext,xfixes,xft,xinerama,xpm,xrender
 FLTK_MAKE_ENV=		HAVE_FLTK=1 FLTK_NUT="fltk/Nut"
 FLTK_MAKE_ENV_OFF=	HAVE_FLTK=0 FLTK_NUT=""
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MFLTK}
-DESKTOP_ENTRIES="Nut" "" "nuticon" "Nut" \
-		"Science;Biology;MedicalSoftware;" false
-.endif
+FLTK_DESKTOP_ENTRIES=	"Nut" "" "nuticon" "Nut" "Science;Biology;MedicalSoftware;" false
 
 post-patch:
 	@${FIND} ${WRKSRC} -name "Makefile" | ${XARGS} ${REINPLACE_CMD} -e \
@@ -48,10 +42,6 @@ post-patch:
 		 s|$$(OPT)||'
 
 do-install:
-.if ${PORT_OPTIONS:MFLTK}
-	${INSTALL_PROGRAM} ${WRKSRC}/fltk/Nut ${STAGEDIR}${PREFIX}/bin
-	${INSTALL_DATA} ${WRKSRC}/nuticon.xpm ${STAGEDIR}${PREFIX}/share/pixmaps
-.endif
 	${INSTALL_PROGRAM} ${WRKSRC}/nut ${STAGEDIR}${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/nut.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
 	@${MKDIR} ${STAGEDIR}${DATADIR}
@@ -59,4 +49,8 @@ do-install:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
 
+do-install-FLTK-on:
+	${INSTALL_PROGRAM} ${WRKSRC}/fltk/Nut ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/nuticon.xpm ${STAGEDIR}${PREFIX}/share/pixmaps
+
 .include <bsd.port.mk>
diff --git a/misc/nut/files/patch-anameal.c b/misc/nut/files/patch-anameal.c
new file mode 100644
index 000000000000..10bfd40f6e47
--- /dev/null
+++ b/misc/nut/files/patch-anameal.c
@@ -0,0 +1,28 @@
+Fix linker error when FLTK option is enabled.
+
+ld: error: duplicate symbol: foodwork
+>>> defined at anameal.c
+>>>            ../anameal.o:(foodwork)
+>>> defined at PersonalOptions.cc
+>>>            PersonalOptions.o:(.bss+0x0)
+
+--- anameal.c.orig	2023-08-21 10:50:52 UTC
++++ anameal.c
+@@ -29,7 +29,7 @@
+ #include <strings.h>
+ #include <time.h>
+ 
+-struct food *foodwork;
++struct food *foodwork_cli;
+ int max;
+ 
+ void analyze_meals(struct meal *meal_ptr_origin, int specialheader)
+@@ -43,7 +43,7 @@ float prodefic, thispct, totaldefic, serving_ratio;
+ float deficpct[DV_COUNT], food_abacus[MAX_FOOD], serving_ratio_abacus[MAX_FOOD];
+ int deficnut[DV_COUNT];
+ float prodefic, thispct, totaldefic, serving_ratio;
+-foodwork = &food_work;
++foodwork_cli = &food_work;
+ options.temp_meal_root = meal_ptr_origin;
+ mealcount = meal_count(meal_ptr_origin);
+ max = mealcount;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308211142.37LBgDXL047376>