Ticket #20078: freeimage.diff

File freeimage.diff, 5.5 KB (added by tobypeterson, 15 years ago)
  • files/patch-Makefile.gnu

     
     1--- Makefile.gnu.orig   2009-06-24 17:19:47.000000000 -0700
     2+++ Makefile.gnu        2009-06-24 17:57:28.000000000 -0700
     3@@ -3,10 +3,14 @@
     4 # This file can be generated by ./gensrclist.sh
     5 include Makefile.srcs
     6 
     7+CC = __CC__
     8+CXX = __CXX__
     9+LDFLAGS = __LDFLAGS__
     10+
     11 # General configuration variables:
     12-DESTDIR ?= /
     13-INCDIR ?= $(DESTDIR)/usr/include
     14-INSTALLDIR ?= $(DESTDIR)/usr/lib
     15+DESTDIR ?=
     16+INCDIR ?= $(DESTDIR)__PREFIX__/include
     17+INSTALLDIR ?= $(DESTDIR)__PREFIX__/lib
     18 
     19 # Converts cr/lf to just lf
     20 DOS2UNIX = dos2unix
     21@@ -15,9 +19,9 @@
     22 
     23 MODULES = $(SRCS:.c=.o)
     24 MODULES := $(MODULES:.cpp=.o)
     25-CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
     26+CFLAGS ?= __CFLAGS__ -fPIC -fexceptions -fvisibility=hidden
     27 CFLAGS += $(INCLUDE)
     28-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
     29+CXXFLAGS ?= __CXXFLAGS__ -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
     30 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  = freeimage
     36 STATICLIB = lib$(TARGET).a
     37-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
     38-LIBNAME        = lib$(TARGET).so
     39-VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
     40+SHAREDLIB = lib$(TARGET).$(VER_MAJOR).$(VER_MINOR).dylib
     41+LIBNAME        = lib$(TARGET).dylib
     42+VERLIBNAME = lib$(TARGET).$(VER_MAJOR).dylib
     43 HEADER = Source/FreeImage.h
     44 
     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)
  • files/patch-Makefile.osx-Leopard.diff

     
    1 --- Makefile.osx.orig   2007-08-25 17:00:38.000000000 +0200
    2 +++ Makefile.osx        2008-02-15 15:41:15.000000000 +0100
    3 @@ -14,14 +14,14 @@
    4  COMPILERFLAGS_I386 = -arch i386
    5  COMPILERPPFLAGS = -Wno-ctor-dtor-privacy
    6  INCLUDE +=
    7 -INCLUDE_PPC = -isysroot /Developer/SDKs/MacOSX10.3.9.sdk
    8 +INCLUDE_PPC = -isysroot /Developer/SDKs/MacOSX10.4u.sdk
    9  INCLUDE_I386 = -isysroot /Developer/SDKs/MacOSX10.4u.sdk
    10  CFLAGS_PPC = $(COMPILERFLAGS) $(COMPILERFLAGS_PPC) $(INCLUDE) $(INCLUDE_PPC)
    11  CFLAGS_I386 = $(COMPILERFLAGS) $(COMPILERFLAGS_I386) $(INCLUDE) $(INCLUDE_I386)
    12  CPPFLAGS_PPC = $(COMPILERPPFLAGS) $(CFLAGS_PPC)
    13  CPPFLAGS_I386 = $(COMPILERPPFLAGS) $(CFLAGS_I386)
    14 -LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.3.9.sdk
    15 -LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
    16 +LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
    17 +LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
    18  LIBTOOL = libtool
    19  LIPO = lipo
    20  
  • Portfile

     
    44PortSystem 1.0
    55
    66name                    freeimage
    7 version                 3.10.0
     7version                 3.12.0
    88categories              graphics
    99maintainers             ryand-ruby@zenspider.com
    1010description             Library for FreeImage, a dependency-less graphics library
     
    1919use_zip                 yes
    2020worksrcdir              FreeImage
    2121
    22 checksums               md5 2e57135e26bb487cc8e13ee7b7e0a595 \
    23                         sha1 9590563e8abade9494fc6db6f6127fa3db42b8e1 \
    24                         rmd160 9f501e099bca567b2ffedd0f9f00ad6b58021b09
     22checksums               md5 47b259102f776a4bcd7affc00942f3b4 \
     23                        sha1 d9a5efc9590cb45e176c7e5552afef961594a1cb \
     24                        rmd160 421ddbd81343d14561ade844c67c31802ab444ad
    2525
    26 use_configure           no
     26patchfiles                      patch-Makefile.gnu
    2727
    28 destroot.pre_args       -f Makefile.osx ${destroot.target}
    29 destroot.destdir        PREFIX=${destroot}${prefix}
     28configure {
     29        reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/Makefile.gnu
    3030
    31 default_variants +universal
    32 variant universal {}
    33 pre-fetch {
    34         if {![variant_isset universal]} {
    35                 return -code error "${name} is only available in a universal version"
    36         }
    37 }
     31        reinplace "s|__LDFLAGS__|${configure.ldflags}|" ${worksrcpath}/Makefile.gnu
    3832
    39 platform darwin 9 {
    40     patchfiles-append   patch-Makefile.osx-Leopard.diff
     33        reinplace "s|__CC__|${configure.cc}|" ${worksrcpath}/Makefile.gnu
     34        reinplace "s|__CFLAGS__|${configure.cflags}|" ${worksrcpath}/Makefile.gnu
     35
     36        reinplace "s|__CXX__|${configure.cxx}|" ${worksrcpath}/Makefile.gnu
     37        reinplace "s|__CXXFLAGS__|${configure.cxxflags}|" ${worksrcpath}/Makefile.gnu
    4138}
    4239
     40build.target            FreeImage
     41build.args                      -f Makefile.gnu
     42
     43destroot.args           -f Makefile.gnu
     44
    4345livecheck.regex         <title>Source Distribution (.*) released.*</title>