2010-09-27 18:34:11 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Netpbm < Formula
|
2010-09-27 18:34:11 +00:00
|
|
|
homepage 'http://netpbm.sourceforge.net'
|
2012-09-16 23:13:37 +00:00
|
|
|
url 'http://sourceforge.net/projects/netpbm/files/super_stable/10.35.86/netpbm-10.35.86.tgz'
|
|
|
|
sha1 '45b5dacdd844dfd9f2b02a1ba0e59e6a3bddb885'
|
2012-02-21 06:04:21 +00:00
|
|
|
|
2011-08-08 11:34:04 +00:00
|
|
|
head 'http://netpbm.svn.sourceforge.net/svnroot/netpbm/trunk'
|
2010-09-27 18:34:11 +00:00
|
|
|
|
2012-09-16 23:14:01 +00:00
|
|
|
devel do
|
|
|
|
url 'svn+http://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced/',
|
|
|
|
:revision => 1724
|
|
|
|
version '10.59.02'
|
|
|
|
end
|
|
|
|
|
2010-09-27 18:34:11 +00:00
|
|
|
depends_on "libtiff"
|
|
|
|
depends_on "jasper"
|
2012-06-07 01:35:12 +00:00
|
|
|
depends_on :libpng
|
2010-09-27 18:34:11 +00:00
|
|
|
|
2012-09-16 23:14:01 +00:00
|
|
|
def patches; { :p0 => %W[
|
|
|
|
https://trac.macports.org/export/95870/trunk/dports/graphics/netpbm/files/patch-clang-sse-workaround.diff
|
|
|
|
https://trac.macports.org/export/95870/trunk/dports/graphics/netpbm/files/patch-converter-other-giftopnm.c-strcaseeq.diff
|
|
|
|
]}
|
|
|
|
end unless build.stable?
|
|
|
|
|
2010-09-27 18:34:11 +00:00
|
|
|
def install
|
2012-09-16 23:14:01 +00:00
|
|
|
if build.stable?
|
2011-08-08 11:34:04 +00:00
|
|
|
system "cp", "Makefile.config.in", "Makefile.config"
|
|
|
|
config = "Makefile.config"
|
2012-09-16 23:14:01 +00:00
|
|
|
else
|
|
|
|
system "cp", "config.mk.in", "config.mk"
|
|
|
|
config = "config.mk"
|
2011-08-08 11:34:04 +00:00
|
|
|
end
|
2010-09-27 18:34:11 +00:00
|
|
|
|
2011-08-08 11:34:04 +00:00
|
|
|
inreplace config do |s|
|
2010-09-27 18:34:11 +00:00
|
|
|
s.remove_make_var! "CC"
|
|
|
|
s.change_make_var! "CFLAGS_SHLIB", "-fno-common"
|
|
|
|
s.change_make_var! "NETPBMLIBTYPE", "dylib"
|
|
|
|
s.change_make_var! "NETPBMLIBSUFFIX", "dylib"
|
|
|
|
s.change_make_var! "LDSHLIB", "--shared -o $(SONAME)"
|
|
|
|
s.change_make_var! "TIFFLIB", "-ltiff"
|
|
|
|
s.change_make_var! "JPEGLIB", "-ljpeg"
|
|
|
|
s.change_make_var! "PNGLIB", "-lpng"
|
|
|
|
s.change_make_var! "ZLIB", "-lz"
|
|
|
|
s.change_make_var! "JASPERLIB", "-ljasper"
|
|
|
|
s.change_make_var! "JASPERHDR_DIR", "#{HOMEBREW_PREFIX}/include/jasper"
|
|
|
|
end
|
|
|
|
|
|
|
|
ENV.deparallelize
|
|
|
|
system "make"
|
2012-02-24 20:50:21 +00:00
|
|
|
system "make", "package", "pkgdir=#{buildpath}/stage"
|
|
|
|
cd 'stage' do
|
2010-09-27 18:34:11 +00:00
|
|
|
prefix.install %w{ bin include lib misc }
|
2012-01-05 18:24:46 +00:00
|
|
|
# do man pages explicitly; otherwise a junk file is installed in man/web
|
|
|
|
man1.install Dir['man/man1/*.1']
|
|
|
|
man5.install Dir['man/man5/*.5']
|
2010-09-27 18:34:11 +00:00
|
|
|
lib.install Dir['link/*.a']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|