1 | # $Id: Portfile 76615 2011-03-02 16:24:50Z mas@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name netpbm |
---|
6 | version 10.47.26 |
---|
7 | revision 0 |
---|
8 | svn.revision 1402 |
---|
9 | categories graphics |
---|
10 | maintainers mas openmaintainer |
---|
11 | description Image manipulation |
---|
12 | long_description \ |
---|
13 | A whole bunch of utilities for primitive manipulation \ |
---|
14 | of graphic images. Wide array of converters from one \ |
---|
15 | graphics format to another. E.g. from g3 fax format to \ |
---|
16 | jpeg. Many basic graphics editing tools such as \ |
---|
17 | magnifying and cropping. |
---|
18 | |
---|
19 | homepage http://netpbm.sourceforge.net/ |
---|
20 | master_sites sourceforge:netpbm |
---|
21 | platforms darwin freebsd linux |
---|
22 | # Parallel building is not reliable in netpbm 10.26.x. |
---|
23 | # This has been fixed for the next major release of netpbm. |
---|
24 | # See http://trac.macports.org/ticket/17516#comment:7 |
---|
25 | # If you're thinking about enabling parallel build in the Portfile, |
---|
26 | # please make sure to test it on OS X 10.4 as well! Thanks! |
---|
27 | use_parallel_build no |
---|
28 | |
---|
29 | depends_build path:bin/perl:perl5 |
---|
30 | |
---|
31 | depends_lib port:zlib port:jpeg port:tiff \ |
---|
32 | port:libpng port:jasper \ |
---|
33 | port:libxml2 |
---|
34 | |
---|
35 | fetch.type svn |
---|
36 | svn.url http://${name}.svn.sourceforge.net/svnroot/${name}/stable |
---|
37 | worksrcdir stable |
---|
38 | |
---|
39 | patchfiles patch-pm_config.in.h.diff \ |
---|
40 | patch-lib-Makefile.diff |
---|
41 | |
---|
42 | post-patch { |
---|
43 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/pm_config.in.h |
---|
44 | } |
---|
45 | |
---|
46 | configure.optflags -O3 |
---|
47 | |
---|
48 | configure { |
---|
49 | # netpbm uses a "configure" script that simply helps building |
---|
50 | # config.mk manually. During automated install using macports, |
---|
51 | # we do that for our user. |
---|
52 | file copy ${worksrcpath}/config.mk.in ${worksrcpath}/config.mk |
---|
53 | reinplace "s|^CC =.*\$|CC = ${configure.cc}|" ${worksrcpath}/config.mk |
---|
54 | if {[variant_isset universal]} { |
---|
55 | reinplace "s|^#CFLAGS =.*\$|CFLAGS = ${configure.cppflags} ${configure.cflags} ${configure.universal_cflags}|" ${worksrcpath}/config.mk |
---|
56 | reinplace "s|^#LDFLAGS +=.*\$|LDFLAGS = ${configure.ldflags} ${configure.universal_ldflags}|g" ${worksrcpath}/config.mk |
---|
57 | } else { |
---|
58 | reinplace "s|^#CFLAGS =.*\$|CFLAGS = ${configure.cppflags} ${configure.cflags} ${configure.cc_archflags}|" ${worksrcpath}/config.mk |
---|
59 | reinplace "s|^#LDFLAGS +=.*\$|LDFLAGS = ${configure.ldflags} ${configure.ld_archflags}|g" ${worksrcpath}/config.mk |
---|
60 | } |
---|
61 | reinplace "s|^CFLAGS_SHLIB =.*\$|CFLAGS_SHLIB = -fno-common|" ${worksrcpath}/config.mk |
---|
62 | reinplace "s|^TIFFLIB =.*\$|TIFFLIB = -ltiff|" ${worksrcpath}/config.mk |
---|
63 | reinplace "s|^JPEGLIB =.*\$|JPEGLIB = -ljpeg|" ${worksrcpath}/config.mk |
---|
64 | reinplace "s|^PNGLIB =.*\$|PNGLIB = -lpng|" ${worksrcpath}/config.mk |
---|
65 | reinplace "s|^ZLIB =.*\$|ZLIB = -lz|" ${worksrcpath}/config.mk |
---|
66 | reinplace "s|^JASPERHDR_DIR =.*\$|JASPERHDR_DIR = ${prefix}/include|" ${worksrcpath}/config.mk |
---|
67 | } |
---|
68 | |
---|
69 | platform darwin { |
---|
70 | post-configure { |
---|
71 | set ldshlib "${configure.ldflags} -dynamiclib -install_name ${prefix}/lib/libnetpbm.\$(MAJ).dylib -compatibility_version \$(MAJ) -current_version ${version}" |
---|
72 | if {[variant_isset universal]} { |
---|
73 | set ldshlib "${ldshlib} ${configure.universal_ldflags}" |
---|
74 | } else { |
---|
75 | set ldshlib "${ldshlib} ${configure.ld_archflags}" |
---|
76 | } |
---|
77 | reinplace "s|^NETPBMLIBTYPE =.*\$|NETPBMLIBTYPE = dylib|" ${worksrcpath}/config.mk |
---|
78 | reinplace "s|^NETPBMLIBSUFFIX =.*\$|NETPBMLIBSUFFIX = dylib|" ${worksrcpath}/config.mk |
---|
79 | reinplace "s|^LDSHLIB =.*\$|LDSHLIB = ${ldshlib}|" ${worksrcpath}/config.mk |
---|
80 | reinplace "s|^JASPERLIB =.*\$|JASPERLIB = -ljasper|" ${worksrcpath}/config.mk |
---|
81 | } |
---|
82 | } |
---|
83 | |
---|
84 | platform linux { |
---|
85 | post-configure { |
---|
86 | set ldshlib {-shared -Wl,-soname,$(SONAME)} |
---|
87 | reinplace "s|^NETPBMLIBTYPE =.*\$|NETPBMLIBTYPE = unixshared|" ${worksrcpath}/config.mk |
---|
88 | reinplace "s|^NETPBMLIBSUFFIX =.*\$|NETPBMLIBSUFFIX = so|" ${worksrcpath}/config.mk |
---|
89 | reinplace "s|^LDSHLIB =.*\$|LDSHLIB = ${ldshlib}|" ${worksrcpath}/config.mk |
---|
90 | reinplace "s|^JASPERLIB =.*\$|JASPERLIB = -ljasper|" ${worksrcpath}/config.mk |
---|
91 | reinplace "s|^LDRELOC =.*\$|LDRELOC = ld --reloc|" ${worksrcpath}/config.mk |
---|
92 | reinplace "s|^LINKER_CAN_DO_EXPLICIT_LIBRARY =.*\$|LINKER_CAN_DO_EXPLICIT_LIBRARY = Y|" ${worksrcpath}/config.mk |
---|
93 | } |
---|
94 | } |
---|
95 | |
---|
96 | platform freebsd { |
---|
97 | post-configure { |
---|
98 | set ldshlib {glibtool --mode=link gcc} |
---|
99 | reinplace "s|^NETPBMLIBTYPE =.*\$|NETPBMLIBTYPE = unixshared|" ${worksrcpath}/config.mk |
---|
100 | reinplace "s|^NETPBMLIBSUFFIX =.*\$|NETPBMLIBSUFFIX = so|" ${worksrcpath}/config.mk |
---|
101 | reinplace "s|^LDSHLIB =.*\$|LDSHLIB = ${ldshlib}|" ${worksrcpath}/config.mk |
---|
102 | reinplace "s|^JASPERLIB =.*\$|JASPERLIB = ${prefix}/lib/libjasper.la|" ${worksrcpath}/config.mk |
---|
103 | } |
---|
104 | patchfiles-append patch-libopt.c.diff |
---|
105 | depends_build port:libtool |
---|
106 | } |
---|
107 | |
---|
108 | build.args "messages=yes" |
---|
109 | build.target "" |
---|
110 | build.type gnu |
---|
111 | |
---|
112 | destroot.target package |
---|
113 | destroot.destdir pkgdir=${destroot}${prefix} |
---|
114 | |
---|
115 | pre-destroot { |
---|
116 | file delete -force ${destroot}${prefix} |
---|
117 | } |
---|
118 | |
---|
119 | post-destroot { |
---|
120 | xinstall -m 755 -d ${destroot}${prefix}/share/netpbm |
---|
121 | eval move ${destroot}${prefix}/bin/doc.url [glob ${destroot}${prefix}/misc/*] ${destroot}${prefix}/share/netpbm |
---|
122 | move ${destroot}${prefix}/man ${destroot}${prefix}/share/ |
---|
123 | move ${destroot}${prefix}/link/libnetpbm.a ${destroot}${prefix}/lib |
---|
124 | |
---|
125 | eval delete [glob -type f -directory ${destroot}${prefix} *] |
---|
126 | |
---|
127 | foreach old_library {pbm pgm pnm ppm} { |
---|
128 | ln -s libnetpbm.dylib ${destroot}${prefix}/lib/lib${old_library}.dylib |
---|
129 | } |
---|
130 | } |
---|
131 | |
---|
132 | # work around bug in Apple's gcc build 4061 |
---|
133 | platform darwin 8 { |
---|
134 | pre-configure { |
---|
135 | set fl [open "| ${configure.cc} --version"] |
---|
136 | set data [read $fl] |
---|
137 | close $fl |
---|
138 | if {[regexp "build 4061" ${data}]} { |
---|
139 | ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} does not work with gcc version \"${data}\"." |
---|
140 | return -code error "incompatible gcc version" |
---|
141 | } |
---|
142 | } |
---|
143 | } |
---|
144 | |
---|
145 | livecheck.type regex |
---|
146 | livecheck.url http://${name}.svn.sourceforge.net/viewvc/${name}/stable/ |
---|
147 | livecheck.regex {Release ([0-9.]+)} |
---|