pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/graphics/png png: Fix libpng-config --libs and --ldfla...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0a3797c4b829
branches:  trunk
changeset: 452859:0a3797c4b829
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Tue May 18 10:05:18 2021 +0000

description:
png: Fix libpng-config --libs and --ldflags output.

They should include the full list of libraries and linker flags, similar
to pkg-config and other *-config scripts.  Bump PKGREVISION.

diffstat:

 graphics/png/Makefile                       |   8 +++---
 graphics/png/distinfo                       |   3 +-
 graphics/png/patches/patch-libpng-config.in |  33 +++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 5 deletions(-)

diffs (75 lines):

diff -r df1e9cba4d15 -r 0a3797c4b829 graphics/png/Makefile
--- a/graphics/png/Makefile     Tue May 18 07:13:54 2021 +0000
+++ b/graphics/png/Makefile     Tue May 18 10:05:18 2021 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.199 2020/04/14 12:35:05 wiz Exp $
+# $NetBSD: Makefile,v 1.200 2021/05/18 10:05:18 jperkin Exp $
 
 DISTNAME=      libpng-1.6.37
 PKGNAME=       ${DISTNAME:S/lib//}
+PKGREVISION=   1
 CATEGORIES=    graphics
 MASTER_SITES=  https://ftp-osl.osuosl.org/pub/libpng/src/archive/xz/libpng16/
 MASTER_SITES+= ${MASTER_SITE_SOURCEFORGE:=libpng/}
@@ -34,9 +35,8 @@
 
 SUBST_CLASSES+=                rpathfix
 SUBST_FILES.rpathfix=  libpng-config.in
-SUBST_MESSAGE.rpathfix=        Adding rpath to libpng-config
-SUBST_SED.rpathfix=    -e 's/-L$${libdir}/${COMPILER_RPATH_FLAG}$${libdir} -L$${libdir}/g'
-SUBST_STAGE.rpathfix=  pre-configure
+SUBST_VARS.rpathfix=   COMPILER_RPATH_FLAG
+SUBST_STAGE.rpathfix=  post-build
 
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r df1e9cba4d15 -r 0a3797c4b829 graphics/png/distinfo
--- a/graphics/png/distinfo     Tue May 18 07:13:54 2021 +0000
+++ b/graphics/png/distinfo     Tue May 18 10:05:18 2021 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.142 2019/04/17 07:05:20 wiz Exp $
+$NetBSD: distinfo,v 1.143 2021/05/18 10:05:18 jperkin Exp $
 
 SHA1 (libpng-1.6.37.tar.xz) = 3ab93fabbf4c27e1c4724371df408d9a1bd3f656
 RMD160 (libpng-1.6.37.tar.xz) = 7d68b596480e994aeccb2794df48a3613f1de9c4
 SHA512 (libpng-1.6.37.tar.xz) = 59e8c1059013497ae616a14c3abbe239322d3873c6ded0912403fc62fb260561768230b6ab997e2cccc3b868c09f539fd13635616b9fa0dd6279a3f63ec7e074
 Size (libpng-1.6.37.tar.xz) = 1012272 bytes
+SHA1 (patch-libpng-config.in) = 04f8d6af31114017ce9d1280e62f1768c35c289d
 SHA1 (patch-pngpriv.h) = 3da29edb5d89ab26b9787a71b87c3fd8f451ea39
diff -r df1e9cba4d15 -r 0a3797c4b829 graphics/png/patches/patch-libpng-config.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/png/patches/patch-libpng-config.in       Tue May 18 10:05:18 2021 +0000
@@ -0,0 +1,33 @@
+$NetBSD: patch-libpng-config.in,v 1.1 2021/05/18 10:05:18 jperkin Exp $
+
+Make --libs behave the same as --ldflags and include all libs.
+
+--- libpng-config.in.orig      2019-04-14 18:10:32.000000000 +0000
++++ libpng-config.in
+@@ -19,7 +19,7 @@ includedir="@includedir@/libpng@PNGLIB_M
+ libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
+ all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ @LIBS@"
+ I_opts="-I${includedir}"
+-L_opts="-L${libdir}"
++L_opts="@COMPILER_RPATH_FLAG@${libdir} -L${libdir}"
+ R_opts=""
+ cppflags=""
+ ccopts=""
+@@ -88,7 +88,7 @@ while test $# -gt 0; do
+         ;;
+ 
+     --libs)
+-        echo ${libs}
++        echo ${ldopts} ${L_opts} ${R_opts} ${all_libs}
+         ;;
+ 
+     --I_opts)
+@@ -108,7 +108,7 @@ while test $# -gt 0; do
+         ;;
+ 
+     --ldflags)
+-        echo ${ldopts} ${L_opts} ${R_opts} ${libs}
++        echo ${ldopts} ${L_opts} ${R_opts} ${all_libs}
+         ;;
+ 
+     --static)



Home | Main Index | Thread Index | Old Index