Ticket #23276: freeimage-3.13.1.diff
File freeimage-3.13.1.diff, 7.5 KB (added by nox@…, 15 years ago) |
---|
-
dports/graphics/freeimage/Portfile
diff --git a/dports/graphics/freeimage/Portfile b/dports/graphics/freeimage/Portfile index bbf2a5a..39462c9 100644
a b 4 4 PortSystem 1.0 5 5 6 6 name freeimage 7 version 3.12.0 7 version 3.13.1 8 license FreeImage-1.0 GPL-2 8 9 categories graphics 9 10 maintainers toby 10 11 description Library for FreeImage, a dependency-less graphics library … … distname FreeImage[strsed ${version} {g/\.//}] 20 21 use_zip yes 21 22 worksrcdir FreeImage 22 23 23 checksums md5 47b259102f776a4bcd7affc00942f3b4\24 sha1 d9a5efc9590cb45e176c7e5552afef961594a1cb\25 rmd160 421ddbd81343d14561ade844c67c31802ab444ad24 checksums md5 a2e20b223a2cf6a5791cc47686364e99 \ 25 sha1 52ba4453aa9682c57104c3420e58f843aaa6ab61 \ 26 rmd160 b3f3e7791ded7d3ce76eb2d9c2a5acb5687a16ee 26 27 27 patchfiles patch-Makefile.gnu 28 patchfiles patch-Makefile.gnu.diff 28 29 29 configure { 30 reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/Makefile.gnu 30 post-patch { 31 # Libraries extension is ".dylib" on Darwin, not ".so" 32 reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu 31 33 32 reinplace "s|__LDFLAGS__|${configure.ldflags}|" ${worksrcpath}/Makefile.gnu 34 # A dash separate the library name from its version on Darwin 35 reinplace /^SHAREDLIB/s/-/./ ${worksrcpath}/Makefile.gnu 33 36 34 reinplace "s|__CC__|${configure.cc}|" ${worksrcpath}/Makefile.gnu35 reinplace "s|__CFLAGS__|${configure.cflags}|"${worksrcpath}/Makefile.gnu37 # Use libtool(1) instead of ar(1) 38 reinplace {s/\$(AR) r/libtool -o/} ${worksrcpath}/Makefile.gnu 36 39 37 reinplace "s|__CXX__|${configure.cxx}|" ${worksrcpath}/Makefile.gnu38 reinplace "s|__CXXFLAGS__|${configure.cxxflags}|"${worksrcpath}/Makefile.gnu40 # Do not force installation as root 41 reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu 39 42 } 40 43 44 use_configure no 45 46 set CC "${configure.cc} ${configure.cflags}" 47 set CXX "${configure.cxx} ${configure.cxxflags}" 48 set LDFLAGS ${configure.ldflags} 49 set VERLIBNAME libfreeimage.[lindex [split ${version} .] 0].dylib 50 41 51 build.target FreeImage 42 build.args -f Makefile.gnu 52 build.args -f Makefile.gnu \ 53 PREFIX=${prefix} \ 54 VERLIBNAME=${VERLIBNAME} 55 56 pre-build { 57 build.args-append \ 58 CC="${CC}" \ 59 CXX="${CXX}" \ 60 LDFLAGS="${LDFLAGS}" 61 } 62 63 destroot.args -f Makefile.gnu \ 64 INCDIR=${destroot}${prefix}/include \ 65 INSTALLDIR=${destroot}${prefix}/lib \ 66 PREFIX=${prefix} \ 67 VERLIBNAME=${VERLIBNAME} 68 69 post-destroot { 70 set docdir ${prefix}/share/doc/${name} 71 xinstall -d ${destroot}${docdir} 72 xinstall -m 644 -W ${worksrcpath} Whatsnew.txt license-fi.txt \ 73 license-gpl.txt ${destroot}${docdir} 74 copy ${worksrcpath}/Examples ${destroot}${docdir}/examples 75 } 43 76 44 destroot.args -f Makefile.gnu 77 test.run yes 78 test.cmd ./TestAPI 79 test.dir ${worksrcpath}/TestAPI 80 test.target 81 82 pre-test { 83 # Use correct compiler and flags when compiling test 84 reinplace s:g++:${CXX}: ${test.dir}/Makefile 85 86 # Use headers and libraries in source directories as Dist is not used 87 reinplace s:-I../Dist/:-I../Source/: ${test.dir}/Makefile 88 reinplace s:Dist/:: ${test.dir}/Makefile 89 90 # Build the test 91 system "make -C ${test.dir}" 92 } 93 94 variant universal { 95 append CC " ${configure.universal_cflags}" 96 append CXX " ${configure.universal_cxxflags}" 97 append LDFLAGS " ${configure.universal_ldflags}" 98 } 45 99 46 100 livecheck.type regex 47 101 livecheck.regex {FreeImage (\d+(?:\.\d+)*) released} -
deleted file dports/graphics/freeimage/files/patch-Makefile.gnu
diff --git a/dports/graphics/freeimage/files/patch-Makefile.gnu b/dports/graphics/freeimage/files/patch-Makefile.gnu deleted file mode 100644 index 8a84068..0000000
+ - 1 --- Makefile.gnu.orig 2009-06-24 17:19:47.000000000 -07002 +++ Makefile.gnu 2009-06-24 17:57:28.000000000 -07003 @@ -3,10 +3,14 @@4 # This file can be generated by ./gensrclist.sh5 include Makefile.srcs6 7 +CC = __CC__8 +CXX = __CXX__9 +LDFLAGS = __LDFLAGS__10 +11 # General configuration variables:12 -DESTDIR ?= /13 -INCDIR ?= $(DESTDIR)/usr/include14 -INSTALLDIR ?= $(DESTDIR)/usr/lib15 +DESTDIR ?=16 +INCDIR ?= $(DESTDIR)__PREFIX__/include17 +INSTALLDIR ?= $(DESTDIR)__PREFIX__/lib18 19 # Converts cr/lf to just lf20 DOS2UNIX = dos2unix21 @@ -15,9 +19,9 @@22 23 MODULES = $(SRCS:.c=.o)24 MODULES := $(MODULES:.cpp=.o)25 -CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden26 +CFLAGS ?= __CFLAGS__ -fPIC -fexceptions -fvisibility=hidden27 CFLAGS += $(INCLUDE)28 -CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy29 +CXXFLAGS ?= __CXXFLAGS__ -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy30 CXXFLAGS += $(INCLUDE)31 32 ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)33 @@ -27,9 +31,9 @@34 35 TARGET = freeimage36 STATICLIB = lib$(TARGET).a37 -SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so38 -LIBNAME = lib$(TARGET).so39 -VERLIBNAME = $(LIBNAME).$(VER_MAJOR)40 +SHAREDLIB = lib$(TARGET).$(VER_MAJOR).$(VER_MINOR).dylib41 +LIBNAME = lib$(TARGET).dylib42 +VERLIBNAME = lib$(TARGET).$(VER_MAJOR).dylib43 HEADER = Source/FreeImage.h44 45 46 @@ -55,16 +59,18 @@47 $(CXX) $(CXXFLAGS) -c $< -o $@48 49 $(STATICLIB): $(MODULES)50 - $(AR) r $@ $(MODULES)51 + /usr/bin/libtool -o $@ $(MODULES)52 53 $(SHAREDLIB): $(MODULES)54 - $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)55 + $(CC) -dynamiclib -install_name $(INSTALLDIR)/$(VERLIBNAME) -compatibility_version $(VER_MAJOR) -current_version $(VER_MAJOR).$(VER_MINOR) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)56 57 install:58 install -d $(INCDIR) $(INSTALLDIR)59 - install -m 644 -o root -g root $(HEADER) $(INCDIR)60 - install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)61 - install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)62 + install -m 644 $(HEADER) $(INCDIR)63 + install -m 644 $(STATICLIB) $(INSTALLDIR)64 + install -m 755 $(SHAREDLIB) $(INSTALLDIR)65 + ln -s $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)66 + ln -s $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)67 68 clean:69 rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) -
new file dports/graphics/freeimage/files/patch-Makefile.gnu.diff
diff --git a/dports/graphics/freeimage/files/patch-Makefile.gnu.diff b/dports/graphics/freeimage/files/patch-Makefile.gnu.diff new file mode 100644 index 0000000..e856daa
- + 1 --- Makefile.gnu.orig 2010-01-13 16:32:29.000000000 +0100 2 +++ Makefile.gnu 2010-01-13 17:17:12.000000000 +0100 3 @@ -58,13 +58,15 @@ 4 $(AR) r $@ $(MODULES) 5 6 $(SHAREDLIB): $(MODULES) 7 - $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) 8 + $(CC) -dynamiclib -install_name $(PREFIX)/lib/$(VERLIBNAME) -compatibility_version $(VER_MAJOR) -current_version $(VER_MAJOR).$(VER_MINOR) -o $@ $(MODULES) $(LIBRARIES) 9 10 install: 11 install -d $(INCDIR) $(INSTALLDIR) 12 install -m 644 -o root -g root $(HEADER) $(INCDIR) 13 install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) 14 install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) 15 + ln -sf $(PREFIX)/lib/$(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) 16 + ln -sf $(PREFIX)/lib/$(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME) 17 18 clean: 19 rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)