2009-12-06 11:07:42 +00:00
|
|
|
require 'formula'
|
2009-11-16 16:09:45 +00:00
|
|
|
|
2011-10-24 21:19:36 +00:00
|
|
|
class FreeimageHttpDownloadStrategy < CurlDownloadStrategy
|
2009-11-16 16:09:45 +00:00
|
|
|
def stage
|
|
|
|
# need to convert newlines or patch chokes
|
2011-10-24 21:19:36 +00:00
|
|
|
safe_system '/usr/bin/unzip', '-aaqq', @tarball_path
|
2009-11-16 16:09:45 +00:00
|
|
|
chdir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Freeimage < Formula
|
2012-08-09 05:35:06 +00:00
|
|
|
homepage 'http://sf.net/projects/freeimage'
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.15.4/FreeImage3154.zip',
|
2010-04-07 05:58:35 +00:00
|
|
|
:using => FreeimageHttpDownloadStrategy
|
2012-12-03 20:12:15 +00:00
|
|
|
version '3.15.4'
|
|
|
|
sha1 '1d30057a127b2016cf9b4f0f8f2ba92547670f96'
|
2009-11-16 16:09:45 +00:00
|
|
|
|
2012-08-09 05:35:06 +00:00
|
|
|
option :universal
|
2012-03-24 17:33:57 +00:00
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-08-09 05:35:06 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2012-05-15 18:31:21 +00:00
|
|
|
system "make", "-f", "Makefile.gnu"
|
|
|
|
system "make", "-f", "Makefile.gnu", "install", "PREFIX=#{prefix}"
|
|
|
|
system "make", "-f", "Makefile.fip"
|
|
|
|
system "make", "-f", "Makefile.fip", "install", "PREFIX=#{prefix}"
|
2009-11-16 16:09:45 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
2012-09-26 22:04:46 +00:00
|
|
|
diff --git a/Makefile.fip b/Makefile.fip
|
|
|
|
index f4336d2..15e8c00 100644
|
|
|
|
--- a/Makefile.fip
|
|
|
|
+++ b/Makefile.fip
|
|
|
|
@@ -5,8 +5,9 @@ include fipMakefile.srcs
|
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
# General configuration variables:
|
|
|
|
DESTDIR ?= /
|
|
|
|
-INCDIR ?= $(DESTDIR)/usr/include
|
|
|
|
-INSTALLDIR ?= $(DESTDIR)/usr/lib
|
|
|
|
+PREFIX ?= /usr/local
|
|
|
|
+INCDIR ?= $(DESTDIR)$(PREFIX)/include
|
|
|
|
+INSTALLDIR ?= $(DESTDIR)$(PREFIX)/lib
|
2012-09-26 22:04:46 +00:00
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
# Converts cr/lf to just lf
|
|
|
|
DOS2UNIX = dos2unix
|
2012-09-26 22:04:46 +00:00
|
|
|
@@ -27,8 +28,8 @@ endif
|
|
|
|
|
|
|
|
TARGET = freeimageplus
|
2009-11-16 16:09:45 +00:00
|
|
|
STATICLIB = lib$(TARGET).a
|
|
|
|
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
|
|
|
|
-LIBNAME = lib$(TARGET).so
|
2012-09-26 22:04:46 +00:00
|
|
|
+SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).dylib
|
2009-11-16 16:09:45 +00:00
|
|
|
+LIBNAME = lib$(TARGET).dylib
|
2012-09-26 22:04:46 +00:00
|
|
|
VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
|
2009-11-16 16:09:45 +00:00
|
|
|
HEADER = Source/FreeImage.h
|
2012-09-26 22:04:46 +00:00
|
|
|
HEADERFIP = Wrapper/FreeImagePlus/FreeImagePlus.h
|
|
|
|
@@ -40,7 +41,7 @@ all: dist
|
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
dist: FreeImage
|
|
|
|
cp *.a Dist
|
|
|
|
- cp *.so Dist
|
|
|
|
+ cp *.dylib Dist
|
|
|
|
cp Source/FreeImage.h Dist
|
2012-09-26 22:04:46 +00:00
|
|
|
cp Wrapper/FreeImagePlus/FreeImagePlus.h Dist
|
|
|
|
|
|
|
|
@@ -59,14 +60,15 @@ $(STATICLIB): $(MODULES)
|
2011-10-24 21:19:36 +00:00
|
|
|
$(AR) r $@ $(MODULES)
|
2012-09-26 22:04:46 +00:00
|
|
|
|
2011-10-24 21:19:36 +00:00
|
|
|
$(SHAREDLIB): $(MODULES)
|
|
|
|
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
|
2012-03-24 17:33:57 +00:00
|
|
|
+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
|
2011-10-24 21:19:36 +00:00
|
|
|
|
|
|
|
install:
|
|
|
|
install -d $(INCDIR) $(INSTALLDIR)
|
|
|
|
- install -m 644 -o root -g root $(HEADER) $(INCDIR)
|
2012-09-26 22:04:46 +00:00
|
|
|
- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
|
2011-10-24 21:19:36 +00:00
|
|
|
- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
|
|
|
|
- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
|
|
|
|
+ install -m 644 $(HEADER) $(INCDIR)
|
2012-09-26 22:04:46 +00:00
|
|
|
+ install -m 644 $(HEADERFIP) $(INCDIR)
|
2011-10-24 21:19:36 +00:00
|
|
|
+ install -m 644 $(STATICLIB) $(INSTALLDIR)
|
|
|
|
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
|
2012-09-26 22:04:46 +00:00
|
|
|
+ ln -s $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
|
2011-10-24 21:19:36 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
|
2012-09-26 22:04:46 +00:00
|
|
|
diff --git a/Makefile.gnu b/Makefile.gnu
|
|
|
|
index 0c967b8..e50ed7f 100644
|
|
|
|
--- a/Makefile.gnu
|
|
|
|
+++ b/Makefile.gnu
|
|
|
|
@@ -5,8 +5,9 @@ include Makefile.srcs
|
2011-10-24 21:19:36 +00:00
|
|
|
|
|
|
|
# General configuration variables:
|
|
|
|
DESTDIR ?= /
|
|
|
|
-INCDIR ?= $(DESTDIR)/usr/include
|
|
|
|
-INSTALLDIR ?= $(DESTDIR)/usr/lib
|
|
|
|
+PREFIX ?= /usr/local
|
|
|
|
+INCDIR ?= $(DESTDIR)$(PREFIX)/include
|
|
|
|
+INSTALLDIR ?= $(DESTDIR)$(PREFIX)/lib
|
|
|
|
|
|
|
|
# Converts cr/lf to just lf
|
|
|
|
DOS2UNIX = dos2unix
|
2012-09-26 22:04:46 +00:00
|
|
|
@@ -27,8 +28,8 @@ endif
|
|
|
|
|
|
|
|
TARGET = freeimage
|
2011-10-24 21:19:36 +00:00
|
|
|
STATICLIB = lib$(TARGET).a
|
2012-09-26 22:04:46 +00:00
|
|
|
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
|
2011-10-24 21:19:36 +00:00
|
|
|
-LIBNAME = lib$(TARGET).so
|
2012-09-26 22:04:46 +00:00
|
|
|
+SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).dylib
|
2011-10-24 21:19:36 +00:00
|
|
|
+LIBNAME = lib$(TARGET).dylib
|
|
|
|
VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
|
|
|
|
HEADER = Source/FreeImage.h
|
2012-09-26 22:04:46 +00:00
|
|
|
|
|
|
|
@@ -40,7 +41,7 @@ all: dist
|
2011-10-24 21:19:36 +00:00
|
|
|
|
|
|
|
dist: FreeImage
|
|
|
|
cp *.a Dist
|
|
|
|
- cp *.so Dist
|
|
|
|
+ cp *.dylib Dist
|
|
|
|
cp Source/FreeImage.h Dist
|
|
|
|
|
2012-09-26 22:04:46 +00:00
|
|
|
dos2unix:
|
|
|
|
@@ -58,13 +59,13 @@ $(STATICLIB): $(MODULES)
|
2011-10-24 21:19:36 +00:00
|
|
|
$(AR) r $@ $(MODULES)
|
2012-09-26 22:04:46 +00:00
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
$(SHAREDLIB): $(MODULES)
|
2011-10-24 21:19:36 +00:00
|
|
|
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
|
2012-03-24 17:33:57 +00:00
|
|
|
+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
|
2012-09-26 22:04:46 +00:00
|
|
|
|
2009-11-16 16:09:45 +00:00
|
|
|
install:
|
|
|
|
install -d $(INCDIR) $(INSTALLDIR)
|
|
|
|
- install -m 644 -o root -g root $(HEADER) $(INCDIR)
|
|
|
|
- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
|
|
|
|
- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
|
|
|
|
+ install -m 644 $(HEADER) $(INCDIR)
|
|
|
|
+ install -m 644 $(STATICLIB) $(INSTALLDIR)
|
|
|
|
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
|
2012-09-26 22:04:46 +00:00
|
|
|
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
|
|
|
|
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
|
|
|
|
# ldconfig
|
2012-12-03 20:12:15 +00:00
|
|
|
diff --git a/Source/OpenEXR/IlmImf/ImfAutoArray.h b/Source/OpenEXR/IlmImf/ImfAutoArray.h
|
|
|
|
index edb8b10..3ecf3e0 100755
|
|
|
|
--- a/Source/OpenEXR/IlmImf/ImfAutoArray.h
|
|
|
|
+++ b/Source/OpenEXR/IlmImf/ImfAutoArray.h
|
|
|
|
@@ -44,6 +44,7 @@
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
+#include <cstring>
|
|
|
|
#include "OpenEXRConfig.h"
|
|
|
|
|
|
|
|
namespace Imf {
|