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  
    44PortSystem 1.0
    55
    66name            freeimage
    7 version         3.12.0
     7version         3.13.1
     8license         FreeImage-1.0 GPL-2
    89categories      graphics
    910maintainers     toby
    1011description     Library for FreeImage, a dependency-less graphics library
    distname FreeImage[strsed ${version} {g/\.//}] 
    2021use_zip         yes
    2122worksrcdir      FreeImage
    2223
    23 checksums       md5 47b259102f776a4bcd7affc00942f3b4 \
    24                 sha1 d9a5efc9590cb45e176c7e5552afef961594a1cb \
    25                 rmd160 421ddbd81343d14561ade844c67c31802ab444ad
     24checksums       md5     a2e20b223a2cf6a5791cc47686364e99 \
     25                sha1    52ba4453aa9682c57104c3420e58f843aaa6ab61 \
     26                rmd160  b3f3e7791ded7d3ce76eb2d9c2a5acb5687a16ee
    2627
    27 patchfiles      patch-Makefile.gnu
     28patchfiles      patch-Makefile.gnu.diff
    2829
    29 configure {
    30     reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/Makefile.gnu
     30post-patch {
     31    # Libraries extension is ".dylib" on Darwin, not ".so"
     32    reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu
    3133
    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
    3336
    34     reinplace "s|__CC__|${configure.cc}|" ${worksrcpath}/Makefile.gnu
    35     reinplace "s|__CFLAGS__|${configure.cflags}|" ${worksrcpath}/Makefile.gnu
     37    # Use libtool(1) instead of ar(1)
     38    reinplace {s/\$(AR) r/libtool -o/} ${worksrcpath}/Makefile.gnu
    3639
    37     reinplace "s|__CXX__|${configure.cxx}|" ${worksrcpath}/Makefile.gnu
    38     reinplace "s|__CXXFLAGS__|${configure.cxxflags}|" ${worksrcpath}/Makefile.gnu
     40    # Do not force installation as root
     41    reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu
    3942}
    4043
     44use_configure   no
     45
     46set CC "${configure.cc} ${configure.cflags}"
     47set CXX "${configure.cxx} ${configure.cxxflags}"
     48set LDFLAGS ${configure.ldflags}
     49set VERLIBNAME libfreeimage.[lindex [split ${version} .] 0].dylib
     50
    4151build.target    FreeImage
    42 build.args      -f Makefile.gnu
     52build.args      -f Makefile.gnu \
     53                PREFIX=${prefix} \
     54                VERLIBNAME=${VERLIBNAME}
     55
     56pre-build {
     57    build.args-append \
     58        CC="${CC}" \
     59        CXX="${CXX}" \
     60        LDFLAGS="${LDFLAGS}"
     61}
     62
     63destroot.args   -f Makefile.gnu \
     64                INCDIR=${destroot}${prefix}/include \
     65                INSTALLDIR=${destroot}${prefix}/lib \
     66                PREFIX=${prefix} \
     67                VERLIBNAME=${VERLIBNAME}
     68
     69post-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}
    4376
    44 destroot.args   -f Makefile.gnu
     77test.run    yes
     78test.cmd    ./TestAPI
     79test.dir    ${worksrcpath}/TestAPI
     80test.target
     81
     82pre-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
     94variant universal {
     95    append CC " ${configure.universal_cflags}"
     96    append CXX " ${configure.universal_cxxflags}"
     97    append LDFLAGS " ${configure.universal_ldflags}"
     98}
    4599
    46100livecheck.type  regex
    47101livecheck.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 -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)
  • 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)