summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2021-01-30 11:54:43 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2021-01-30 11:54:43 +0000
commitbaa42c91f3f88489f300b804b7f6b28801b0d94e (patch)
tree44aebb5c69f25fa81b04493472f0d6aa78c6ea04
parentscience/py-phonopy: Update 2.9.0 -> 2.9.1 (diff)
graphics/png: add SIMD option
It's enabled by default on aarch64, amd64 and powerpc64le, which should have optimizations that are enabled in their baselines (NEON, SSE2 and VSX respectively). PR: 251173 Approved by: antoine@ (maintainer)
-rw-r--r--graphics/png/Makefile13
-rw-r--r--graphics/png/files/patch-configure11
2 files changed, 23 insertions, 1 deletions
diff --git a/graphics/png/Makefile b/graphics/png/Makefile
index 1b6f387804a2..e8bd6d3be2fe 100644
--- a/graphics/png/Makefile
+++ b/graphics/png/Makefile
@@ -3,6 +3,7 @@
PORTNAME= png
PORTVERSION= 1.6.37
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= SF/lib${PORTNAME}/lib${PORTNAME}16/${PORTVERSION} \
ftp://ftp.simplesystems.org/pub/lib${PORTNAME}/${PORTNAME}/src/lib${PORTNAME}16/
@@ -26,12 +27,22 @@ INSTALL_TARGET= install-strip
TEST_TARGET= check-TESTS
USE_LDCONFIG= yes
-OPTIONS_DEFINE= APNG
+OPTIONS_DEFINE= APNG SIMD
OPTIONS_DEFAULT=APNG
+OPTIONS_DEFAULT_aarch64= SIMD
+OPTIONS_DEFAULT_amd64= SIMD
+OPTIONS_DEFAULT_powerpc64le= SIMD
APNG_DESC=Enable Animated PNG support
+SIMD_CONFIGURE_OFF= --enable-hardware-optimizations=no
+SIMD_CONFIGURE_ON= --enable-hardware-optimizations=yes
.include <bsd.port.options.mk>
+.if ${ARCH} == powerpc64 && ${PORT_OPTIONS:MSIMD}
+USES+= compiler:c11
+CFLAGS+= -maltivec -mvsx
+.endif
+
.if ${PORT_OPTIONS:MAPNG} || make(makesum)
PATCHFILES= ${DISTNAME}-apng.patch.gz
.endif
diff --git a/graphics/png/files/patch-configure b/graphics/png/files/patch-configure
new file mode 100644
index 000000000000..0bf0bec66031
--- /dev/null
+++ b/graphics/png/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig 2021-01-21 14:33:24 UTC
++++ configure
+@@ -13533,7 +13533,7 @@ $as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h
+ $as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h
+
+ ;;
+- i?86|x86_64)
++ i?86|x86_64|amd64)
+ enable_intel_sse=yes
+
+ $as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h