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

(-)Makefile (-8 / +20 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	pngquant
4
PORTNAME=	pngquant
5
PORTVERSION=	2.5.2
5
PORTVERSION=	2.7.2
6
PORTREVISION=	1
7
DISTVERSIONSUFFIX=	-src
6
DISTVERSIONSUFFIX=	-src
8
CATEGORIES=	graphics
7
CATEGORIES=	graphics
9
MASTER_SITES=	http://pngquant.org/
8
MASTER_SITES=	http://pngquant.org/
Lines 11-24 MASTER_SITES= http://pngquant.org/ Link Here
11
MAINTAINER=	ak@FreeBSD.org
10
MAINTAINER=	ak@FreeBSD.org
12
COMMENT=	Converts 32-bit RGBA PNGs into 8-bit RGBA-palette PNGs
11
COMMENT=	Converts 32-bit RGBA PNGs into 8-bit RGBA-palette PNGs
13
12
14
LICENSE=	BSD3CLAUSE
13
LICENSE=	GPLv3
15
LICENSE_FILE=	${WRKSRC}/COPYRIGHT
14
LICENSE_FILE=	${WRKSRC}/COPYRIGHT
16
15
17
LIB_DEPENDS=	libpng.so:graphics/png
16
LIB_DEPENDS=	libpng.so:graphics/png
18
17
19
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
18
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
20
19
21
USES=	gmake tar:bzip2
20
USES=	gmake pkgconfig
21
HAS_CONFIGURE=	yes
22
MAKE_ARGS+=	CC="${CC}"
22
MAKE_ARGS+=	CC="${CC}"
23
23
24
CPPFLAGS+=	$$(libpng-config --I_opts)
24
CPPFLAGS+=	$$(libpng-config --I_opts)
Lines 28-35 PORTDOCS= CHANGELOG README.md Link Here
28
PLIST_FILES=	bin/pngquant \
28
PLIST_FILES=	bin/pngquant \
29
				man/man1/pngquant.1.gz
29
				man/man1/pngquant.1.gz
30
30
31
OPTIONS_DEFINE=	OPTIMIZED_FLAGS OPENMP DEBUG DOCS
31
OPTIONS_DEFINE=	OPTIMIZED_FLAGS OPENMP LCMS2 DEBUG DOCS
32
OPTIONS_DEFINE_i386=	SSE
32
OPTIONS_DEFINE_i386=	SSE
33
LCMS2_DESC=	Support for ICC profiles via LCMS library
34
35
DEBUG_CFLAGS_OFF=	-DNDEBUG
36
37
LCMS2_CONFIGURE_WITH=	lcms2
38
LCMS2_LIB_DEPENDS=	liblcms2.so:graphics/lcms2
39
40
OPENMP_LIB_DEPENDS=	libomp.so:devel/openmp
41
OPENMP_CPPFLAGS=	-I${LOCALBASE}/include
33
42
34
OPTIMIZED_FLAGS_CFLAGS=	-O3 -fearly-inlining -fstrict-aliasing \
43
OPTIMIZED_FLAGS_CFLAGS=	-O3 -fearly-inlining -fstrict-aliasing \
35
		-ffast-math -funroll-loops -fomit-frame-pointer \
44
		-ffast-math -funroll-loops -fomit-frame-pointer \
Lines 39-48 OPTIMIZED_FLAGS_CFLAGS= -O3 -fearly-inli Link Here
39
# SSE2 support is always enabled on amd64
48
# SSE2 support is always enabled on amd64
40
SSE_CFLAGS=	-DUSE_SSE=1 -msse2
49
SSE_CFLAGS=	-DUSE_SSE=1 -msse2
41
50
42
OPENMP_CFLAGS=	-fopenmp
51
.include <bsd.port.options.mk>
43
OPENMP_LDFLAGS=	-lgomp -pthread
44
52
45
DEBUG_CFLAGS_OFF=	-DNDEBUG
53
# there is no --without-openmp option
54
.if ${PORT_OPTIONS:MOPENMP}
55
CONFIGURE_ARGS+=	--with-openmp
56
CONFIGURE_ENV+=	C_INCLUDE_PATH=${LOCALBASE}/include
57
.endif
46
58
47
do-install:
59
do-install:
48
	${INSTALL_PROGRAM} ${WRKSRC}/pngquant ${STAGEDIR}${PREFIX}/bin
60
	${INSTALL_PROGRAM} ${WRKSRC}/pngquant ${STAGEDIR}${PREFIX}/bin
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (pngquant-2.5.2-src.tar.bz2) = 5b064596305c6f765a753e96e08224dd71b31c20b72bdaf0f205da16b76a347d
1
TIMESTAMP = 1476836074
2
SIZE (pngquant-2.5.2-src.tar.bz2) = 54611
2
SHA256 (pngquant-2.7.2-src.tar.gz) = 75801ed048c40cc4bff12773892d16d7ff00c11b9c549845c2133fd3abca17c2
3
SIZE (pngquant-2.7.2-src.tar.gz) = 91721
(-)files/patch-configure (-33 / +38 lines)
Lines 1-11 Link Here
1
Index: configure
1
--- configure.orig	2016-06-23 15:50:59 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 @@
9
@@ -8,7 +8,7 @@ DEBUG=
9
 SSE=auto
10
 SSE=auto
10
 OPENMP=
11
 OPENMP=
11
 LIBPNG_DIR=.
12
 LIBPNG_DIR=.
Lines 14-29 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 @@
18
@@ -38,7 +38,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"
21
-if [[ "$OSTYPE" =~ "darwin" ]]; then
22
-if [[ "$OSTYPE" =~ "darwin" ]]; then
22
+if echo "$OSTYPE" | grep -q "darwin"; then
23
+if echo "$OSTYPE" | grep -q "darwin"; then
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
         help "--with-libpng=<dir>           search for libpng in directory"
25
 fi
25
 fi
26
@@ -110,7 +110,7 @@
26
         help "--with-libpng=<dir>           search for libpng in directory"
27
@@ -109,7 +109,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-68 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
@@ -147,7 +147,7 @@
36
@@ -146,7 +146,7 @@ find_h() {
36
 
37
 
37
 find_pkgconfig() {
38
 find_pkgconfig() {
38
     LIBNAME=$1
39
     local LIBNAME=$1
39
-    if pkg-config --exists "$LIBNAME" &> /dev/null; then
40
-    if pkg-config --exists "$LIBNAME" &> /dev/null; then
40
+    if pkg-config --exists "$LIBNAME" >/dev/null 2>&1; then
41
+    if pkg-config --exists "$LIBNAME" >/dev/null; then
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
@@ -191,11 +191,16 @@
45
@@ -210,9 +210,13 @@ find_library() {
45
         return 0
46
         return 0
46
     fi
47
     fi
47
 
48
 
48
-    for i in "${DIRS[@]}"; do
49
-    for i in "${DIRS[@]}"; do
49
-        DIR=($i)
50
-        DIR=($i)
50
-        HPATH=$(find_h "${DIR[0]}" "$HEADERPATTERN")
51
-        if find_dynamic "$LIBNAME" "$HEADERPATTERN" "$DYNAMICPATTERN" "${DIR[0]}" "${DIR[1]}"; then
51
+    # destroys positional parameters
52
+    # destroys positional parameters
52
+    set -- ${DIRS}
53
+    set -- ${DIRS}
53
+    while [ -n "$1" -a -n "$2" ]; do
54
+    while [ -n "$1" -a -n "$2" ]; do
54
+        DIRS_h="$1"
55
+        DIRS_h="$1"
55
+        DIRS_l="$2"
56
+        DIRS_l="$2"
56
+        shift 2
57
+        shift 2
57
+
58
+        if find_dynamic "$LIBNAME" "$HEADERPATTERN" "$DYNAMICPATTERN" "${DIRS_h}" "${DIRS_l}"; then
58
+        HPATH=$(find_h "${DIRS_h}" "$HEADERPATTERN")
59
             return 0
59
         if [ -n "$HPATH" ]; then
60
         fi
60
-            SOPATH=$(find_f "${DIR[1]}" "$DYNAMICPATTERN")
61
     done
61
+            SOPATH=$(find_f "${DIRS_l}" "$DYNAMICPATTERN")
62
@@ -262,10 +266,8 @@ fi
62
             if [ -n "$SOPATH" ]; then
63
                 cflags "-I${HPATH%/*}"
64
                 lflags "-L${SOPATH%/*} -l$DYNAMICLIBNAME"
65
@@ -250,10 +255,8 @@
66
 
63
 
67
 # SSE
64
 # SSE
68
 if [ "$SSE" = 'auto' ]; then
65
 if [ "$SSE" = 'auto' ]; then
Lines 75-81 Index: configure Link Here
75
 fi
72
 fi
76
 
73
 
77
 if [ "$SSE" -eq 1 ]; then
74
 if [ "$SSE" -eq 1 ]; then
78
@@ -276,9 +279,8 @@
75
@@ -288,9 +290,8 @@ if [ -n "$OPENMP" ]; then
79
     else
76
     else
80
         OPENMPFLAGS="-fopenmp"
77
         OPENMPFLAGS="-fopenmp"
81
     fi
78
     fi
Lines 87-93 Index: configure Link Here
87
         cflags "$OPENMPFLAGS"
84
         cflags "$OPENMPFLAGS"
88
         lflags "$OPENMPFLAGS"
85
         lflags "$OPENMPFLAGS"
89
         status "OpenMP" "yes"
86
         status "OpenMP" "yes"
90
@@ -293,11 +295,13 @@
87
@@ -305,11 +306,13 @@ else
91
 fi
88
 fi
92
 
89
 
93
 # Cocoa
90
 # Cocoa
Lines 103-122 Index: configure Link Here
103
         COCOA_READER=1
100
         COCOA_READER=1
104
         cflags "-DUSE_COCOA=1"
101
         cflags "-DUSE_COCOA=1"
105
         lflags "-framework Cocoa"
102
         lflags "-framework Cocoa"
106
@@ -308,19 +312,18 @@
103
@@ -320,25 +323,24 @@ if [[ "$OSTYPE" =~ "darwin" ]]; then
107
 fi
104
 fi
108
 
105
 
109
 # pairs of possible *.h and lib*.so locations
106
 # pairs of possible *.h and lib*.so locations
110
-DIRS=("/usr/local/include /usr/local/lib"
107
-DIRS=()
108
+DIRS=
109
 
110
 if command -v >/dev/null libpng-config; then
111
-    DIRS+=("$(libpng-config --prefix) $(libpng-config --libdir)")
112
+    DIRS="$(libpng-config --prefix) $(libpng-config --libdir)"
113
 fi
114
 
115
-DIRS+=("/usr/local/include /usr/local/lib"
111
-      "/usr/include /usr/lib"
116
-      "/usr/include /usr/lib"
112
-      "/opt/local/include /opt/local/lib" # macports
117
-      "/opt/local/include /opt/local/lib" # macports
113
-      )
118
-      )
114
+DIRS="${PREFIX}/include ${PREFIX}/lib \
119
+DIRS="$DIRS /usr/local/include /usr/local/lib \
115
+      /usr/include /usr/lib \
120
+      /usr/include /usr/lib \
116
+      /opt/local/include /opt/local/lib" # macports
121
+      /opt/local/include /opt/local/lib" # macports
117
 
122
 
118
-if [[ "$OSTYPE" =~ "darwin" ]]; then
123
-if [[ "$OSTYPE" =~ "darwin" ]]; then
119
+if echo "$OSTYPE" | grep -q "darwin"; then
124
+if echo "$OSTYPE" | grep -q "darwin" ; then
120
     SOLIBSUFFIX=dylib
125
     SOLIBSUFFIX=dylib
121
 
126
 
122
     # Search Developer SDK paths, since Apple seems to have dropped the standard Unixy ones
127
     # Search Developer SDK paths, since Apple seems to have dropped the standard Unixy ones
Lines 129-144 Index: configure Link Here
129
 else
134
 else
130
     SOLIBSUFFIX=so
135
     SOLIBSUFFIX=so
131
 fi
136
 fi
132
@@ -332,7 +335,7 @@
137
@@ -350,7 +352,7 @@ HAS_LIBPNG=0
133
 if echo "#include \"png.h\"
138
 if echo "#include \"png.h\"
134
     int main(){
139
     int main(){
135
     return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
140
     return !png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
136
-}" | "$CC" -xc -std=c99 -o /dev/null $CFLAGS $LDFLAGS - &> /dev/null; then
141
-}" | "$CC" -xc -std=c99 -o /dev/null $CFLAGS $LDFLAGS - &> /dev/null; then
137
+}" | "$CC" -xc -std=c99 -o /dev/null $CFLAGS $LDFLAGS - >/dev/null 2>&1; then
142
+}" | "$CC" -xc -std=c99 -o /dev/null $CFLAGS $LDFLAGS - >/dev/null 2>&1; then
138
     status "libpng" "custom flags"
143
     status "libpng" "custom flags"
139
     SUCCESS=1
144
     HAS_LIBPNG=1
140
 fi
145
 fi
141
@@ -343,7 +346,7 @@
146
@@ -361,7 +363,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
142
     if [ -n "$PNGH" ]; then
147
     if [ -n "$PNGH" ]; then
143
         PNGH_STRING=$(pngh_string "$PNGH")
148
         PNGH_STRING=$(pngh_string "$PNGH")
144
         PNGH_MAJMIN=$(pngh_majmin "$PNGH")
149
         PNGH_MAJMIN=$(pngh_majmin "$PNGH")
Lines 147-155 Index: configure Link Here
147
             LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a")
152
             LIBPNGA=$(find_f "$LIBPNG_DIR" "libpng${PNGH_MAJMIN}.a")
148
             if [ -n "$LIBPNGA" ]; then
153
             if [ -n "$LIBPNGA" ]; then
149
                 cflags "-I${PNGH%/*}"
154
                 cflags "-I${PNGH%/*}"
150
@@ -359,14 +362,19 @@
155
@@ -377,14 +379,19 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
151
     if find_pkgconfig libpng; then
156
     if find_pkgconfig libpng; then
152
         SUCCESS=1
157
         HAS_LIBPNG=1
153
     else
158
     else
154
-        for i in "${DIRS[@]}"; do
159
-        for i in "${DIRS[@]}"; do
155
-            DIR=($i)
160
-            DIR=($i)
Lines 172-183 Index: configure Link Here
172
                     if [ -n "$LIBPNGSO" ]; then
177
                     if [ -n "$LIBPNGSO" ]; then
173
                         cflags "-I${PNGH%/*}"
178
                         cflags "-I${PNGH%/*}"
174
                         lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}"
179
                         lflags "-L${LIBPNGSO%/*} -lpng${PNGH_MAJMIN}"
175
@@ -380,7 +388,7 @@
180
@@ -398,7 +405,7 @@ if [ "$HAS_LIBPNG" -eq 0 ]; then
176
     fi
181
     fi
177
 fi
182
 fi
178
 if [ "$SUCCESS" -eq 0 ]; then
183
 if [ "$HAS_LIBPNG" -eq 0 ]; then
179
-    if [[ "$OSTYPE" =~ "darwin" ]]; then
184
-    if [[ "$OSTYPE" =~ "darwin" ]]; then
180
+    if echo "$OSTYPE" | grep -q "darwin"; then
185
+    if echo "$OSTYPE" | grep -q "darwin"; then
181
         LIBPNG_CMD='`brew install libpng`'
186
         LIBPNG_CMD='`brew install libpng`'
182
     else
187
     else
183
         LIBPNG_CMD='`apt-get install libpng-dev` or `yum install libpng-devel`'
188
         LIBPNG_CMD='`apt-get install libpng16-dev` or `apt-get install libpng-dev` or `yum install libpng-devel`'

Return to bug 213617