Bug 185263 - ports: graphics/gts libm is not linked when pkg-config is used
Summary: ports: graphics/gts libm is not linked when pkg-config is used
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-29 09:30 UTC by Tatsuki Makino
Modified: 2014-01-18 19:50 UTC (History)
0 users

See Also:


Attachments
file.diff (543 bytes, patch)
2013-12-29 09:30 UTC, Tatsuki Makino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tatsuki Makino 2013-12-29 09:30:00 UTC
-lm is not included in result of pkg-config --libs gts.
Some functions of libm become undefined reference.

Fix: fix gts.pc.in or use latest version source.

Patch attached with submission follows:
How-To-Repeat: % cc -xc /dev/null `pkg-config --libs gts`
/usr/lib/crt1.o(.text+0x9d): In function `_start1':
: undefined reference to `main'
/usr/local/lib/libgts.so: undefined reference to `log'
/usr/local/lib/libgts.so: undefined reference to `ceil'
/usr/local/lib/libgts.so: undefined reference to `cos'
/usr/local/lib/libgts.so: undefined reference to `sin'
/usr/local/lib/libgts.so: undefined reference to `atan2'
/usr/local/lib/libgts.so: undefined reference to `exp'
Exit 1
%
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-29 09:30:12 UTC
Maintainer of graphics/gts,

Please note that PR ports/185263 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/185263

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-29 09:30:13 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Erik Greenwald 2014-01-13 17:35:50 UTC
This looks like a good update to me, I see no problem with applying it.

A couple notes to the committer, it needs to be applied in the .../graphics/gts/ directory and it adds a files/patch-gts.pc.in file.

Thanks!

 -Erik
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2014-01-14 20:36:13 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-01-18 16:39:49 UTC
Author: rakuco
Date: Sat Jan 18 16:39:41 2014
New Revision: 340194
URL: http://svnweb.freebsd.org/changeset/ports/340194
QAT: https://qat.redports.org/buildarchive/r340194/

Log:
  - Pass -lm when using gts' pkg-config file. [1]
    This is also done in the package's upstream darcs repository.
  - Support staging.
  - Set LICENSE.
  - Use the new OPTIONS/LIB_DEPENDS syntax.
  
  PR:		ports/185263 [1]
  Submitted by:	Tatsuki Makino <tatsuki_makino@hotmail.com>
  Approved by:	Erik Greenwald <erik@elfga.com> (maintainer)
  MFH:		2014Q1

Added:
  head/graphics/gts/files/patch-gts.pc.in   (contents, props changed)
Modified:
  head/graphics/gts/Makefile

Modified: head/graphics/gts/Makefile
==============================================================================
--- head/graphics/gts/Makefile	Sat Jan 18 16:35:12 2014	(r340193)
+++ head/graphics/gts/Makefile	Sat Jan 18 16:39:41 2014	(r340194)
@@ -3,34 +3,31 @@
 
 PORTNAME=	gts
 PORTVERSION=	0.7.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 MASTER_SITES=	SF
 
 MAINTAINER=	erik@bz.bzflag.bz
 COMMENT=	GNU Triangulated Surface Library
 
+LICENSE=	LGPL20
+
 USES=		pkgconfig
 USE_GNOME=	glib20
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 
 OPTIONS_DEFINE=	NETPBM
-NETPBM_DESC=	Build with libnetpbm support
+OPTIONS_SUB=	yes
+
+NETPBM_DESC=		Build with libnetpbm support
+NETPBM_LIB_DEPENDS=	libnetpbm.so:${PORTSDIR}/graphics/netpbm
 
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
 
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MNETPBM}
-LIB_DEPENDS+=	netpbm.1:${PORTSDIR}/graphics/netpbm
-PLIST_SUB=	NETPBM=""
-.else
-PLIST_SUB=	NETPBM="@comment "
-.endif
-
 post-extract:
 .if ! ${PORT_OPTIONS:MNETPBM}
 	@${REINPLACE_CMD} -e 's|netpbm="true"|netpbm="false"|' \

Added: head/graphics/gts/files/patch-gts.pc.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/gts/files/patch-gts.pc.in	Sat Jan 18 16:39:41 2014	(r340194)
@@ -0,0 +1,10 @@
+--- ./gts.pc.in.orig	2005-01-19 04:48:19.000000000 +0000
++++ ./gts.pc.in	2013-12-29 08:54:18.000000000 +0000
+@@ -6,6 +6,6 @@
+ Name: GTS
+ Description: GNU Triangulated Surface Library
+ Version: @VERSION@
+ Requires: glib-2.0,gthread-2.0,gmodule-2.0
+-Libs: -L${libdir} @LIBS@ -lgts
++Libs: -L${libdir} @LIBS@ -lgts -lm
+ Cflags: -I${includedir}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-01-18 16:40:04 UTC
State Changed
From-To: open->closed

Committed, thanks. I've bumped PORTREVISION since this changes an 
installed file.
Comment 7 dfilter service freebsd_committer freebsd_triage 2014-01-18 19:47:21 UTC
Author: rakuco
Date: Sat Jan 18 19:47:13 2014
New Revision: 340209
URL: http://svnweb.freebsd.org/changeset/ports/340209
QAT: https://qat.redports.org/buildarchive/r340209/

Log:
  MFH: r340194
  
  - Pass -lm when using gts' pkg-config file. [1]
    This is also done in the package's upstream darcs repository.
  - Support staging.
  - Set LICENSE.
  - Use the new OPTIONS/LIB_DEPENDS syntax.
  
  PR:		ports/185263 [1]
  Submitted by:	Tatsuki Makino <tatsuki_makino@hotmail.com>
  Approved by:	Erik Greenwald <erik@elfga.com> (maintainer)
  Approved by:	portmgr (mat)

Added:
  branches/2014Q1/graphics/gts/files/patch-gts.pc.in
     - copied unchanged from r340194, head/graphics/gts/files/patch-gts.pc.in
Modified:
  branches/2014Q1/graphics/gts/Makefile
Directory Properties:
  branches/2014Q1/   (props changed)

Modified: branches/2014Q1/graphics/gts/Makefile
==============================================================================
--- branches/2014Q1/graphics/gts/Makefile	Sat Jan 18 19:44:47 2014	(r340208)
+++ branches/2014Q1/graphics/gts/Makefile	Sat Jan 18 19:47:13 2014	(r340209)
@@ -3,34 +3,31 @@
 
 PORTNAME=	gts
 PORTVERSION=	0.7.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 MASTER_SITES=	SF
 
 MAINTAINER=	erik@bz.bzflag.bz
 COMMENT=	GNU Triangulated Surface Library
 
+LICENSE=	LGPL20
+
 USES=		pkgconfig
 USE_GNOME=	glib20
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 
 OPTIONS_DEFINE=	NETPBM
-NETPBM_DESC=	Build with libnetpbm support
+OPTIONS_SUB=	yes
+
+NETPBM_DESC=		Build with libnetpbm support
+NETPBM_LIB_DEPENDS=	libnetpbm.so:${PORTSDIR}/graphics/netpbm
 
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
 
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MNETPBM}
-LIB_DEPENDS+=	netpbm.1:${PORTSDIR}/graphics/netpbm
-PLIST_SUB=	NETPBM=""
-.else
-PLIST_SUB=	NETPBM="@comment "
-.endif
-
 post-extract:
 .if ! ${PORT_OPTIONS:MNETPBM}
 	@${REINPLACE_CMD} -e 's|netpbm="true"|netpbm="false"|' \

Copied: branches/2014Q1/graphics/gts/files/patch-gts.pc.in (from r340194, head/graphics/gts/files/patch-gts.pc.in)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/graphics/gts/files/patch-gts.pc.in	Sat Jan 18 19:47:13 2014	(r340209, copy of r340194, head/graphics/gts/files/patch-gts.pc.in)
@@ -0,0 +1,10 @@
+--- ./gts.pc.in.orig	2005-01-19 04:48:19.000000000 +0000
++++ ./gts.pc.in	2013-12-29 08:54:18.000000000 +0000
+@@ -6,6 +6,6 @@
+ Name: GTS
+ Description: GNU Triangulated Surface Library
+ Version: @VERSION@
+ Requires: glib-2.0,gthread-2.0,gmodule-2.0
+-Libs: -L${libdir} @LIBS@ -lgts
++Libs: -L${libdir} @LIBS@ -lgts -lm
+ Cflags: -I${includedir}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"