View | Details | Raw Unified | Return to bug 217987
Collapse All | Expand All

(-)Makefile (-9 / +13 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	pngquant
4
PORTNAME=	pngquant
5
PORTVERSION=	2.7.2
5
PORTVERSION=	2.9.0
6
DISTVERSIONSUFFIX=	-src
6
DISTVERSIONSUFFIX=	-src
7
CATEGORIES=	graphics
7
CATEGORIES=	graphics
8
MASTER_SITES=	http://pngquant.org/
8
MASTER_SITES=	http://pngquant.org/
Lines 19-28 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVER Link Here
19
19
20
USES=	gmake pkgconfig
20
USES=	gmake pkgconfig
21
HAS_CONFIGURE=	yes
21
HAS_CONFIGURE=	yes
22
MAKE_ARGS+=	CC="${CC}"
23
24
CPPFLAGS+=	$$(libpng-config --I_opts)
25
LDFLAGS+=	$$(libpng-config --ldflags)
26
22
27
PORTDOCS=	CHANGELOG README.md
23
PORTDOCS=	CHANGELOG README.md
28
PLIST_FILES=	bin/pngquant \
24
PLIST_FILES=	bin/pngquant \
Lines 31-38 PLIST_FILES= bin/pngquant \ Link Here
31
OPTIONS_DEFINE=	OPTIMIZED_FLAGS OPENMP LCMS2 DEBUG DOCS
27
OPTIONS_DEFINE=	OPTIMIZED_FLAGS OPENMP LCMS2 DEBUG DOCS
32
OPTIONS_DEFINE_i386=	SSE
28
OPTIONS_DEFINE_i386=	SSE
33
LCMS2_DESC=	Support for ICC profiles via LCMS library
29
LCMS2_DESC=	Support for ICC profiles via LCMS library
30
OPTIMIZED_FLAGS_DESC= Use extra compiler optimizations
34
31
35
DEBUG_CFLAGS_OFF=	-DNDEBUG
32
DEBUG_CONFIGURE_ON=	--enable-debug
36
33
37
LCMS2_CONFIGURE_WITH=	lcms2
34
LCMS2_CONFIGURE_WITH=	lcms2
38
LCMS2_LIB_DEPENDS=	liblcms2.so:graphics/lcms2
35
LCMS2_LIB_DEPENDS=	liblcms2.so:graphics/lcms2
Lines 42-58 OPENMP_CPPFLAGS= -I${LOCALBASE}/include Link Here
42
OPENMP_CONFIGURE_ON=	--with-openmp
39
OPENMP_CONFIGURE_ON=	--with-openmp
43
OPENMP_CONFIGURE_ENV=	C_INCLUDE_PATH=${LOCALBASE}/include
40
OPENMP_CONFIGURE_ENV=	C_INCLUDE_PATH=${LOCALBASE}/include
44
41
45
OPTIMIZED_FLAGS_CFLAGS=	-O3 -fearly-inlining -fstrict-aliasing \
42
OPTIMIZED_FLAGS_CFLAGS=	-O3 -fstrict-aliasing \
46
		-ffast-math -funroll-loops -fomit-frame-pointer \
43
		-ffast-math -funroll-loops -fomit-frame-pointer \
47
		-fexpensive-optimizations -ffinite-math-only \
44
		-fexpensive-optimizations -ffinite-math-only \
48
		-funsafe-loop-optimizations -ftree-vectorize
45
		-funsafe-loop-optimizations -ftree-vectorize
49
46
50
# SSE2 support is always enabled on amd64
47
.include <bsd.port.options.mk>
51
SSE_CFLAGS=	-DUSE_SSE=1 -msse2
48
49
.if ${PORT_OPTIONS:MSSE} || ${ARCH} == amd64
50
CONFIGURE_ARGS+=--enable-sse
51
.else
52
CONFIGURE_ARGS+=--disable-sse
53
.endif
52
54
53
do-install:
55
do-install:
54
	${INSTALL_PROGRAM} ${WRKSRC}/pngquant ${STAGEDIR}${PREFIX}/bin
56
	${INSTALL_PROGRAM} ${WRKSRC}/pngquant ${STAGEDIR}${PREFIX}/bin
55
	${INSTALL_MAN} ${WRKSRC}/pngquant.1 ${STAGEDIR}${MANPREFIX}/man/man1
57
	${INSTALL_MAN} ${WRKSRC}/pngquant.1 ${STAGEDIR}${MANPREFIX}/man/man1
58
59
post-install-DOCS-on:
56
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
60
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
57
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
61
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
58
62
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1476836074
1
TIMESTAMP = 1490049268
2
SHA256 (pngquant-2.7.2-src.tar.gz) = 75801ed048c40cc4bff12773892d16d7ff00c11b9c549845c2133fd3abca17c2
2
SHA256 (pngquant-2.9.0-src.tar.gz) = ed9ae6943a3520c7e14700692ebfbd568dad73790582efaeb4cab93104f21cfc
3
SIZE (pngquant-2.7.2-src.tar.gz) = 91721
3
SIZE (pngquant-2.9.0-src.tar.gz) = 94747
(-)files/patch-configure (-18 / +21 lines)
Lines 1-11 Link Here
1
Index: configure
1
--- configure.orig	2017-03-02 11:48:03 UTC
2
+++ configure
2
@@ -1,4 +1,4 @@
3
@@ -1,4 +1,4 @@
3
-#!/usr/bin/env bash
4
-#!/usr/bin/env bash
4
+#!/bin/sh
5
+#!/bin/sh
5
 
6
 
6
 CONFIG="config.mk"
7
 CONFIG="config.mk"
7
 PREFIX="/usr/local"
8
 PREFIX="/usr/local"
8
@@ -8,7 +8,7 @@ DEBUG=
9
@@ -14,7 +14,7 @@ DEBUG=
9
 SSE=auto
10
 SSE=auto
10
 OPENMP=
11
 OPENMP=
11
 LIBPNG_DIR=.
12
 LIBPNG_DIR=.
Lines 14-20 Index: configure Link Here
14
     COCOA_READER=auto
15
     COCOA_READER=auto
15
     LCMS2=0
16
     LCMS2=0
16
 else
17
 else
17
@@ -38,7 +38,7 @@ for i in "$@"; do
18
@@ -44,7 +44,7 @@ for i in "$@"; do
18
         echo
19
         echo
19
         help "--with-openmp=static          compile with multicore support"
20
         help "--with-openmp=static          compile with multicore support"
20
         help "--with-lcms2/--without-lcms2  compile with color profile support"
21
         help "--with-lcms2/--without-lcms2  compile with color profile support"
Lines 23-29 Index: configure Link Here
23
         help "--with-cocoa/--without-cocoa  use Cocoa framework to read images"
24
         help "--with-cocoa/--without-cocoa  use Cocoa framework to read images"
24
 fi
25
 fi
25
         help "--with-libpng=<dir>           search for libpng in directory"
26
         help "--with-libpng=<dir>           search for libpng in directory"
26
@@ -109,7 +109,7 @@ done
27
@@ -115,7 +115,7 @@ done
27
 
28
 
28
 # If someone runs sudo make install as very first command, and configure later,
29
 # If someone runs sudo make install as very first command, and configure later,
29
 # $CONFIG cannot be overwritten, and must be deleted before continuing.
30
 # $CONFIG cannot be overwritten, and must be deleted before continuing.
Lines 32-38 Index: configure Link Here
32
     echo "Cannot overwrite file $CONFIG! Please delete it."
33
     echo "Cannot overwrite file $CONFIG! Please delete it."
33
     exit 1
34
     exit 1
34
 fi
35
 fi
35
@@ -146,7 +146,7 @@ find_h() {
36
@@ -152,7 +152,7 @@ find_h() {
36
 
37
 
37
 find_pkgconfig() {
38
 find_pkgconfig() {
38
     local LIBNAME=$1
39
     local LIBNAME=$1
Lines 41-47 Index: configure Link Here
41
         cflags "$(pkg-config --cflags "$LIBNAME")"
42
         cflags "$(pkg-config --cflags "$LIBNAME")"
42
         lflags "$(pkg-config --libs "$LIBNAME")"
43
         lflags "$(pkg-config --libs "$LIBNAME")"
43
         status "$LIBNAME" "shared ($(pkg-config --modversion "$LIBNAME"))"
44
         status "$LIBNAME" "shared ($(pkg-config --modversion "$LIBNAME"))"
44
@@ -210,9 +210,13 @@ find_library() {
45
@@ -216,9 +216,13 @@ find_library() {
45
         return 0
46
         return 0
46
     fi
47
     fi
47
 
48
 
Lines 58-77 Index: configure Link Here
58
             return 0
59
             return 0
59
         fi
60
         fi
60
     done
61
     done
61
@@ -262,10 +266,8 @@ fi
62
@@ -272,12 +276,8 @@ fi
62
 
63
 # SSE
63
 # SSE
64
 if [ "$SSE" = 'auto' ]; then
64
 if [ "$SSE" = 'auto' ]; then
65
-    if [[ "$(uname -m)" =~ (amd|x86_)64 ||
65
     SSE=0
66
-          "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then
66
-    if type uname > /dev/null; then
67
-        SSE=1
67
-        if [[ "$(uname -m)" =~ "amd64" || "$(uname -m)" =~ "x86_64" ||
68
-              "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then
69
-            SSE=1
70
-        fi
68
-    fi
71
-    fi
69
+    echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1
72
+    echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1
70
+    grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1
73
+    grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1
71
 fi
74
 fi
72
 
75
 
73
 if [ "$SSE" -eq 1 ]; then
76
 if [ "$SSE" -eq 1 ]; then
74
@@ -288,9 +290,8 @@ if [ -n "$OPENMP" ]; then
77
@@ -300,9 +300,8 @@ if [ -n "$OPENMP" ]; then
75
     else
78
     else
76
         OPENMPFLAGS="-fopenmp"
79
         OPENMPFLAGS="-fopenmp"
77
     fi
80
     fi
Lines 83-89 Index: configure Link Here
83
         cflags "$OPENMPFLAGS"
86
         cflags "$OPENMPFLAGS"
84
         lflags "$OPENMPFLAGS"
87
         lflags "$OPENMPFLAGS"
85
         status "OpenMP" "yes"
88
         status "OpenMP" "yes"
86
@@ -305,11 +306,13 @@ else
89
@@ -317,11 +316,13 @@ else
87
 fi
90
 fi
88
 
91
 
89
 # Cocoa
92
 # Cocoa
Lines 99-105 Index: configure Link Here
99
         COCOA_READER=1
102
         COCOA_READER=1
100
         cflags "-DUSE_COCOA=1"
103
         cflags "-DUSE_COCOA=1"
101
         lflags "-framework Cocoa"
104
         lflags "-framework Cocoa"
102
@@ -320,25 +323,24 @@ if [[ "$OSTYPE" =~ "darwin" ]]; then
105
@@ -332,25 +333,24 @@ if [[ "$OSTYPE" =~ "darwin" ]]; then
103
 fi
106
 fi
104
 
107
 
105
 # pairs of possible *.h and lib*.so locations
108
 # pairs of possible *.h and lib*.so locations
Lines 133-139 Index: configure Link Here
133
 else
136
 else
134
     SOLIBSUFFIX=so
137
     SOLIBSUFFIX=so
135
 fi
138
 fi
136
@@ -350,7 +352,7 @@ HAS_LIBPNG=0
139
@@ -362,7 +362,7 @@ HAS_LIBPNG=0
137
 if echo "#include \"png.h\"
140
 if echo "#include \"png.h\"
138
     int main(){
141
     int main(){
139
     return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
142
     return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
Lines 142-148 Index: configure Link Here
142
     status "libpng" "custom flags"
145
     status "libpng" "custom flags"
143
     HAS_LIBPNG=1
146
     HAS_LIBPNG=1
144
 fi
147
 fi
145
@@ -361,7 +363,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
148
@@ -373,7 +373,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
146
     if [ -n "$PNGH" ]; then
149
     if [ -n "$PNGH" ]; then
147
         PNGH_STRING=$(pngh_string "$PNGH")
150
         PNGH_STRING=$(pngh_string "$PNGH")
148
         PNGH_MAJMIN=$(pngh_majmin "$PNGH")
151
         PNGH_MAJMIN=$(pngh_majmin "$PNGH")
Lines 151-157 Index: configure Link Here
151
             LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a")
154
             LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a")
152
             if [ -n "$LIBPNGA" ]; then
155
             if [ -n "$LIBPNGA" ]; then
153
                 cflags "-I${PNGH%/*}"
156
                 cflags "-I${PNGH%/*}"
154
@@ -377,14 +379,19 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
157
@@ -389,14 +389,19 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
155
     if find_pkgconfig libpng; then
158
     if find_pkgconfig libpng; then
156
         HAS_LIBPNG=1
159
         HAS_LIBPNG=1
157
     else
160
     else
Lines 176-182 Index: configure Link Here
176
                     if [ -n "$LIBPNGSO" ]; then
179
                     if [ -n "$LIBPNGSO" ]; then
177
                         cflags "-I${PNGH%/*}"
180
                         cflags "-I${PNGH%/*}"
178
                         lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}"
181
                         lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}"
179
@@ -398,7 +405,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
182
@@ -410,7 +415,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
180
     fi
183
     fi
181
 fi
184
 fi
182
 if [ "$HAS_LIBPNG" -eq 0 ]; then
185
 if [ "$HAS_LIBPNG" -eq 0 ]; then
(-)files/patch-lib_configure (-8 / +11 lines)
Lines 1-11 Link Here
1
Index: lib/configure
1
--- lib/configure.orig	2017-03-02 11:48:03 UTC
2
+++ lib/configure
2
@@ -1,4 +1,4 @@
3
@@ -1,4 +1,4 @@
3
-#!/usr/bin/env bash
4
-#!/usr/bin/env bash
4
+#!/bin/sh
5
+#!/bin/sh
5
 
6
 
6
 CONFIG="config.mk"
7
 CONFIG="config.mk"
7
 PREFIX="/usr/local"
8
 PREFIX="/usr/local"
8
@@ -80,7 +80,7 @@
9
@@ -79,7 +79,7 @@ done
9
 
10
 
10
 # If someone runs sudo make install as very first command, and configure later,
11
 # If someone runs sudo make install as very first command, and configure later,
11
 # $CONFIG cannot be overwritten, and must be deleted before continuing.
12
 # $CONFIG cannot be overwritten, and must be deleted before continuing.
Lines 14-33 Index: lib/configure Link Here
14
     echo "Cannot overwrite file $CONFIG! Please delete it."
15
     echo "Cannot overwrite file $CONFIG! Please delete it."
15
     exit 1
16
     exit 1
16
 fi
17
 fi
17
@@ -135,10 +135,8 @@
18
@@ -138,12 +138,8 @@ fi
18
 
19
 # SSE
19
 # SSE
20
 if [ "$SSE" = 'auto' ]; then
20
 if [ "$SSE" = 'auto' ]; then
21
-    if [[ "$(uname -m)" =~ (amd|x86_)64 ||
21
     SSE=0
22
-          "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then
22
-    if type uname > /dev/null; then
23
-        SSE=1
23
-        if [[ "$(uname -m)" =~ "amd64" || "$(uname -m)" =~ "x86_64" ||
24
-              "$(grep -E -m1 "^flags" /proc/cpuinfo)" =~ "sse" ]]; then
25
-            SSE=1
26
-        fi
24
-    fi
27
-    fi
25
+    echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1
28
+    echo $(uname -m) | grep -E -q '(amd|x86_)64' && SSE=1
26
+    grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1
29
+    grep -E -m1 -q '^flags.*sse' /proc/cpuinfo 2>/dev/null && SSE=1
27
 fi
30
 fi
28
 
31
 
29
 if [ "$SSE" -eq 1 ]; then
32
 if [ "$SSE" -eq 1 ]; then
30
@@ -161,9 +159,8 @@
33
@@ -166,9 +162,8 @@ if [ -n "$OPENMP" ]; then
31
     else
34
     else
32
         OPENMPFLAGS="-fopenmp"
35
         OPENMPFLAGS="-fopenmp"
33
     fi
36
     fi

Return to bug 217987