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.
This commit is contained in:
Naveen Narayanan 2019-06-30 18:16:38 +02:00
parent 51586fedb6
commit 7340d94214
7 changed files with 143 additions and 0 deletions

10
png-32/DESCR Normal file
View File

@ -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.

49
png-32/Makefile Normal file
View File

@ -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
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"

17
png-32/PLIST Normal file
View File

@ -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

27
png-32/buildlink3.mk Normal file
View File

@ -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

7
png-32/distinfo Normal file
View File

@ -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

18
png-32/hacks.mk Normal file
View File

@ -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

View File

@ -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__