pkgsrc-WIP-changes archive

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

png-32: compat32 package for libpng



Module Name:	pkgsrc-wip
Committed By:	Naveen Narayanan <zerous@nocebo.space>
Pushed By:	zerous
Date:		Sun Jun 30 18:16:38 2019 +0200
Changeset:	7340d942144f38767bb14924a0f8cd6db59ddba4

Added Files:
	png-32/DESCR
	png-32/Makefile
	png-32/PLIST
	png-32/buildlink3.mk
	png-32/distinfo
	png-32/hacks.mk
	png-32/patches/patch-pngpriv.h

Log Message:
png-32:	compat32 package for libpng

Libpng was written as a companion to the PNG specification, as a
way to reduce the amount of time and effort it takes to support
the PNG file format in application programs.

This package is intended to crosscompile Libpng for i386.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7340d942144f38767bb14924a0f8cd6db59ddba4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 png-32/DESCR                   | 10 +++++++++
 png-32/Makefile                | 49 ++++++++++++++++++++++++++++++++++++++++++
 png-32/PLIST                   | 17 +++++++++++++++
 png-32/buildlink3.mk           | 27 +++++++++++++++++++++++
 png-32/distinfo                |  7 ++++++
 png-32/hacks.mk                | 18 ++++++++++++++++
 png-32/patches/patch-pngpriv.h | 15 +++++++++++++
 7 files changed, 143 insertions(+)

diffs:
diff --git a/png-32/DESCR b/png-32/DESCR
new file mode 100644
index 0000000000..317f5aa368
--- /dev/null
+++ b/png-32/DESCR
@@ -0,0 +1,10 @@
+Libpng was written as a companion to the PNG specification, as a
+way to reduce the amount of time and effort it takes to support
+the PNG file format in application programs.  Most users will not
+have to modify the library significantly; advanced users may want
+to modify it more.  The library was coded for both users.  All
+attempts were made to make it as complete as possible, while
+keeping the code easy to understand.  Currently, this library
+only supports C.  Support for other languages is being considered.
+
+This package is intended to crosscompile Libpng for i386.
diff --git a/png-32/Makefile b/png-32/Makefile
new file mode 100644
index 0000000000..471a09ebf6
--- /dev/null
+++ b/png-32/Makefile
@@ -0,0 +1,49 @@
+# $NetBSD: Makefile,v 1.198 2019/04/17 07:05:20 wiz Exp $
+
+DISTNAME=	libpng-1.6.37
+ABI?=		32
+PKGNAME=	compat${ABI}_${DISTNAME:S/lib//}
+LIBABISUFFIX?=	/32
+CATEGORIES=	graphics
+MASTER_SITES=	https://ftp-osl.osuosl.org/pub/libpng/src/archive/xz/libpng16/
+MASTER_SITES+=	${MASTER_SITE_SOURCEFORGE:=libpng/}
+MASTER_SITES+=	ftp://ftp.fu-berlin.de/unix/graphics/png/src/libpng16/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	wiz%NetBSD.org@localhost
+HOMEPAGE=	http://www.libpng.org/pub/png/libpng.html
+COMMENT=	Library for manipulating PNG images
+LICENSE=	zlib
+
+CFLAGS+=		-m32
+USE_LIBTOOL=		yes
+GNU_CONFIGURE=		yes
+# do not create libpng.la
+CONFIGURE_ARGS+=	--libdir=${PREFIX}/lib${LIBABISUFFIX}
+CONFIGURE_ARGS+=	--disable-unversioned-links
+CONFIGURE_ARGS+=	--bindir=${PREFIX}/lib/${LIBABISUFFIX}
+CONFIGURE_ARGS+=	--includedir=${PREFIX}/lib/${LIBABISUFFIX}
+GNU_CONFIGURE_MANDIR=	${PREFIX}/lib/${LIBABISUFFIX}
+# but do install png.h outside include/libpng$VERSION for now
+# until pkgsrc is fixed to use libpng-config or the pc file everywhere
+INSTALL_TARGET=		install install-header-links
+
+PKGCONFIG_OVERRIDE=	scripts/libpng.pc.in libpng.pc.in
+TEST_TARGET=		check
+
+CPPFLAGS+=	-DPNG_USER_CHUNK_CACHE_MAX=128 -DPNG_USER_CHUNK_MALLOC_MAX=8000000
+
+.include "../../mk/bsd.prefs.mk"
+# keep this in sync with the same code in buildlink3.mk
+.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"
+CPPFLAGS+=	-DPNG_NO_ASSEMBLER_CODE
+.endif
+
+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
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/png-32/PLIST b/png-32/PLIST
new file mode 100644
index 0000000000..e999d6ca39
--- /dev/null
+++ b/png-32/PLIST
@@ -0,0 +1,17 @@
+@comment $NetBSD$
+lib/32/libpng-config
+lib/32/libpng16-config
+lib/32/libpng16.la
+lib/32/libpng16/png.h
+lib/32/libpng16/pngconf.h
+lib/32/libpng16/pnglibconf.h
+lib/32/man3/libpng.3
+lib/32/man3/libpngpf.3
+lib/32/man5/png.5
+lib/32/pkgconfig/libpng.pc
+lib/32/pkgconfig/libpng16.pc
+lib/32/png-fix-itxt
+lib/32/png.h
+lib/32/pngconf.h
+lib/32/pngfix
+lib/32/pnglibconf.h
diff --git a/png-32/buildlink3.mk b/png-32/buildlink3.mk
new file mode 100644
index 0000000000..248ce76efe
--- /dev/null
+++ b/png-32/buildlink3.mk
@@ -0,0 +1,27 @@
+# $NetBSD: buildlink3.mk,v 1.27 2013/02/16 11:16:06 wiz Exp $
+
+BUILDLINK_TREE+=	png
+
+.if !defined(PNG_BUILDLINK3_MK)
+PNG_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.png+=	png>=1.2.4
+BUILDLINK_ABI_DEPENDS.png+=	png>=1.6.0nb1
+BUILDLINK_PKGSRCDIR.png?=	../../graphics/png
+
+# keep this in sync with the same code in Makefile
+.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"
+CPPFLAGS+=	-DPNG_NO_ASSEMBLER_CODE
+.endif
+
+# Some software directly tries to link against -lpng instead of
+# using pkg-config or libpng-config to find the proper arguments
+# instead of installing symlinks. Work around this with buildlink
+# magic: packages outside pkgsrc will need to be converted to
+# one of the proper methods or fail.
+BUILDLINK_TRANSFORM+=	l:png:png16
+
+.include "../../devel/zlib/buildlink3.mk"
+.endif # PNG_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-png
diff --git a/png-32/distinfo b/png-32/distinfo
new file mode 100644
index 0000000000..b51231e30f
--- /dev/null
+++ b/png-32/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.142 2019/04/17 07:05:20 wiz 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-pngpriv.h) = 3da29edb5d89ab26b9787a71b87c3fd8f451ea39
diff --git a/png-32/hacks.mk b/png-32/hacks.mk
new file mode 100644
index 0000000000..81486c5ab6
--- /dev/null
+++ b/png-32/hacks.mk
@@ -0,0 +1,18 @@
+# $NetBSD: hacks.mk,v 1.4 2014/12/15 11:46:35 jperkin Exp $
+
+.if !defined(PNG_HACKS_MK)
+PNG_HACKS_MK=	defined
+
+.include "../../mk/compiler.mk"
+
+### gcc-4.5.3 in NetBSD/arm 6.1 causes SEGV in some png functions.
+### -O works around, and there is a report that -O2 -fno-ipa-sra is enough.
+### See PR/47798 for details.
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-arm) && !empty(CC_VERSION:Mgcc-4.5.*)
+# XXX: is there any good way to replace the default -O2 with multiple args?
+#PKG_HACKS+=		optimisation
+#BUILDLINK_TRANSFORM+=	opt:-O[2-9]*:-O2 -fno-ipa-sra
+CFLAGS+=-O2 -fno-ipa-sra
+.endif
+
+.endif	# PNG_HACKS_MK
diff --git a/png-32/patches/patch-pngpriv.h b/png-32/patches/patch-pngpriv.h
new file mode 100644
index 0000000000..9f9886052b
--- /dev/null
+++ b/png-32/patches/patch-pngpriv.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-pngpriv.h,v 1.1 2017/07/05 04:59:16 maya Exp $
+
+Don't typedef types when included by assembler files
+
+--- pngpriv.h.orig	2017-06-28 18:46:03.000000000 +0000
++++ pngpriv.h
+@@ -464,7 +464,7 @@
+    static_cast<type>(static_cast<void*>(value))
+ #  define png_aligncastconst(type, value) \
+    static_cast<type>(static_cast<const void*>(value))
+-#else
++#elif !defined(__ASSEMBLER__)
+ #  define png_voidcast(type, value) (value)
+ #  ifdef _WIN64
+ #     ifdef __GNUC__


Home | Main Index | Thread Index | Old Index