pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

textproc/tinyxml2 shared vs. static libraries



Hi,

Is it on purpose that textproc/tinyxml2 builds static libraries only?
This change has been introduced with version 9.0.0 with no motivation
in the commit message, so it might have been an oversight at that time:
https://github.com/NetBSD/pkgsrc/commit/5aeb3acb3e55b2bdde5ebea5340b5c63a53a4a22

This is currently preventing me from building a shared module because of the
infamous libtool error (which btw also hurts me with -lgcc, but that's a
completly different issue):
```
*** Warning: linker path does not have real file for library -ltinyxml2.
[bla bla]
*** Last file checked: /usr/pkg-2024Q4/lib/libtinyxml2.a
[bla bla]
*** Therefore, libtool will create a static module
[bla bla]
```

So, just in case enabling shared libraries is not an issue, here is a
quick patch. It should probably bump PKGREVISION, but I'm not sure
about the right way to do so.

Also, the patch is fixing a minor glitch regarding PKGCONFIG_OVERRIDE
not looking at the right place for tinyxml2.pc.in, which can be fixed
independently.

Cheers,
Anthony

? textproc/tinyxml2/work
Index: textproc/tinyxml2/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/tinyxml2/Makefile,v
retrieving revision 1.8
diff -u -u -r1.8 Makefile
--- textproc/tinyxml2/Makefile	31 Dec 2023 21:36:45 -0000	1.8
+++ textproc/tinyxml2/Makefile	20 Mar 2025 13:47:54 -0000
@@ -12,7 +12,9 @@
 
 USE_LANGUAGES=	c c++
 
-PKGCONFIG_OVERRIDE=	tinyxml2.pc.in
+CMAKE_CONFIGURE_ARGS+=	-Dtinyxml2_SHARED_LIBS=ON
+
+PKGCONFIG_OVERRIDE=	cmake/tinyxml2.pc.in
 
 .include "../../devel/cmake/build.mk"
 .include "../../mk/bsd.pkg.mk"
Index: textproc/tinyxml2/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/tinyxml2/PLIST,v
retrieving revision 1.2
diff -u -u -r1.2 PLIST
--- textproc/tinyxml2/PLIST	27 Apr 2023 08:19:09 -0000	1.2
+++ textproc/tinyxml2/PLIST	20 Mar 2025 13:47:54 -0000
@@ -1,8 +1,10 @@
-@comment $NetBSD: PLIST,v 1.2 2023/04/27 08:19:09 wiz Exp $
+@comment $NetBSD$
 include/tinyxml2.h
 lib/cmake/tinyxml2/tinyxml2-config-version.cmake
 lib/cmake/tinyxml2/tinyxml2-config.cmake
-lib/cmake/tinyxml2/tinyxml2-static-targets-noconfig.cmake
-lib/cmake/tinyxml2/tinyxml2-static-targets.cmake
-lib/libtinyxml2.a
+lib/cmake/tinyxml2/tinyxml2-shared-targets-noconfig.cmake
+lib/cmake/tinyxml2/tinyxml2-shared-targets.cmake
+lib/libtinyxml2.so
+lib/libtinyxml2.so.10
+lib/libtinyxml2.so.${PKGVERSION}
 lib/pkgconfig/tinyxml2.pc
Index: textproc/tinyxml2/buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/tinyxml2/buildlink3.mk,v
retrieving revision 1.3
diff -u -u -r1.3 buildlink3.mk
--- textproc/tinyxml2/buildlink3.mk	27 Apr 2023 08:19:58 -0000	1.3
+++ textproc/tinyxml2/buildlink3.mk	20 Mar 2025 13:47:54 -0000
@@ -9,7 +9,6 @@
 BUILDLINK_ABI_DEPENDS.tinyxml2+=	tinyxml2>=9.0.0
 BUILDLINK_PKGSRCDIR.tinyxml2?=		../../textproc/tinyxml2
 
-BUILDLINK_DEPMETHOD.tinyxml2?=		build
 .endif	# TINYXML2_BUILDLINK3_MK
 
 BUILDLINK_TREE+=	-tinyxml2


Home | Main Index | Thread Index | Old Index