Ticket #11696: libpng-1.2.35.p5.diff

File libpng-1.2.35.p5.diff, 7.7 KB (added by jpflori, 8 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    22
    33== Description ==
    44
    5 libpng is the official PNG reference library. It supports almost all PNG features, is extensible, and has been extensively tested for over 13 years. The home site for development versions (i.e., may be buggy or subject to change or include experimental features) is http://libpng.sourceforge.net/, and the place to go for questions about the library is the png-mng-implement mailing list.
     5libpng is the official PNG reference library. It supports almost all PNG
     6features, is extensible, and has been extensively tested for over 13 years.
     7The home site for development versions (i.e., may be buggy or subject to
     8change or include experimental features) is http://libpng.sourceforge.net/,
     9and the place to go for questions about the library is the png-mng-implement
     10mailing list.
    611
    712Website: http://www.libpng.org/pub/png/libpng.html
    813
     
    2025
    2126== Dependencies ==
    2227
    23 This spkg requires
     28This spkg depends on:
    2429
    2530 * libz
    2631
    27 This spkg provides dependencies for
    28 
    29  * the Sage library
    30  * tachyon
    31  * matplotlib
    32 
    3332== Special Update/Build Instructions ==
    3433
    35  * No changes went into src. There are two different tarballs, but we use the one with configure.
     34 * No changes went into src. There are two different tarballs, but we use the
     35   one with configure.
     36 * On Darwin, the symbolic links libpng.* created by libpng12 may interfere
     37   with a system-wide libPng.dylib.
     38   This system-wide library is likely to be a different version and on top of
     39   that the symbols exported there are prefixed with "_cg" (for "Core Graphics"),
     40   so even if by chance the functionalities of the two libraries were interchangeable,
     41   libraries or applications looking for one and being presented the other won't
     42   find the symbols they expect.
     43   Note the uppercase "P" which could prevent this conflict; unfortunately, the
     44   default filesystem used by Apple is case-insensitive.
     45   Also note there would be no problem if the system-wide library was not looked
     46   for when Sage is being built or run, but that's not the case either;
     47   it is at least looked for by the "ImageIO" framework:
     48   - when Python is built with Mac OS extensions, fixed in #4008;
     49   - when Mercurial is built because it uses $EDITOR, cf. #4678;
     50   - when R is built and it finds -lpng, cf. #4409 and #11696.
     51   As not all of these problems are easily dealt with and new ones may arise,
     52   we chose to delete the $SAGE_LOCAL/lib/libpng.* symlinks on Darwin.
     53   Therefore, some package as matplotlib (cf. #11686) which by default looks for
     54   -lpng are patched to look for -lpng12 (unless pkg-config is installed; in
     55   this case indeed we can use a non-conflicting libpng.pc symlinking to
     56   libpng12.pc).
    3657
    3758== Changelog ==
    3859
     60=== libpng-1.2.35.p5 (Leif Leonhardy, Jean-Pierre Flori, 19 February 2013) ===
     61 * #11696: Correctly build and install libpng.
     62 * Delete symlinks from libpng.* in $SAGE_LOCAL/lib on Darwin only.
     63 * Fix order of additions of flags and do not drop user settings.
     64 * Use $MAKE and quote $UNAME.
     65 * Use SYMBOL_PREFIX trick on Cygwin to build a correct import library.
     66
    3967=== libpng-1.2.35.p4 (Simon King, 10th December 2011) ===
    4068 * #12131: Use --libdir, to make the package work on openSUSE.
    4169
    4270=== libpng-1.2.35.p3 (David Kirkby 1st April 2011) ===
    43  * Remove the erronous file '.#spkg-install' in the root 
    44    directory of the package. 
     71 * Remove the erronous file '.#spkg-install' in the root
     72   directory of the package.
    4573
    4674=== libpng-1.2.35.p2 (Mike Hansen, June 4th, 2010) ===
    4775 * #9146: cygwin: gd doesn't correctly link in libpng with sage-4.4.3.
     
    5583
    5684=== libpng-1.2.35 (Michael Abshoff, April 10th, 2009) ===
    5785 * update to latest upstream due to security issue in libpng (#5696)
    58  
     86
    5987=== libpng-1.2.34 (Michael Abshoff, February 15th, 2009) ===
    6088 * update to latest upstream release (security related)
    61  * delete SAGE_LOCAL/lib/libpng.* to avoid OSX specific issues. This required a set of other fixes.
     89 * delete SAGE_LOCAL/lib/libpng.* to avoid OSX specific issues. This required
     90   a set of other fixes.
    6291 * unset RM
    6392 * check if SAGE_LOCAL is set
    6493
     
    77106
    78107=== libpng-1.2.22.p4 (Michael Abshoff, Jan. 31st, 2008) ===
    79108 * remove loads of ._* files (#2010)
    80 
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ "$SAGE_LOCAL" = "" ]; then
    4    echo "SAGE_LOCAL undefined ... exiting";
    5    echo "Maybe run 'sage -sh'?"
    6    exit 1
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     5    echo >&2 "Maybe run 'sage -sh'?"
     6    exit 1
    77fi
    88
    9 unset RM
     9if [ "$SAGE64" = yes ]; then
     10    CFLAGS="$CFLAGS -m64 -fPIC -g"
     11    LDFLAGS="$LDFLAGS -m64"
     12else
     13    CFLAGS="$CFLAGS -fPIC -g"
     14fi
     15
     16# Pick up Sage's zlib:
     17export CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
     18export LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS"
    1019
    1120cd src
    1221
    13 # Need to detect zlib
    14 if [ "x$SAGE64" = xyes ]; then
    15     CFLAGS="-m64 $CFLAGS -fPIC -g"
    16     LDFLAGS="-m64"; export LDFLAGS
    17 else
    18     CFLAGS="$CFLAGS -fPIC -g"
    19 fi
    20 export CFLAGS
    21 
    22 CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include"
    23 export CPPFLAGS
    24 
    25 
    2622./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" --enable-shared=yes
    2723if [ $? -ne 0 ]; then
    28     echo "Error configuring libpng"
     24    echo >&2 "Error configuring libpng"
    2925    exit 1
    3026fi
    3127
    32 make
     28# Needed to generate a correct import library
     29if [ "$UNAME" = "CYGWIN" ]; then
     30    MAKE="$MAKE SYMBOL_PREFIX= "
     31fi
    3332
     33echo "Building libpng..."
     34$MAKE
    3435if [ $? -ne 0 ]; then
    35     echo "Error building libpng"
     36    echo >&2 "Error building libpng."
    3637    exit 1
    3738fi
    3839
    39 make install
    40 
     40echo "Installing libpng..."
     41$MAKE install
    4142if [ $? -ne 0 ]; then
    42     echo "Error installing libpng"
     43    echo >&2 "Error installing libpng."
    4344    exit 1
    4445fi
    4546
    46 if [ $UNAME = "CYGWIN" ]; then
    47   rm -rf "$SAGE_LOCAL"/lib/libpng12.dll.a
    48   rm -rf "$SAGE_LOCAL"/lib/libpng12.la
    49   cp "$SAGE_LOCAL"/bin/cygpng12-0.dll "$SAGE_LOCAL"/lib/libpng12.dll
    50 
    51   if [ $? -ne 0 ]; then
    52       echo "Error installing libpng"
    53       exit 1
    54   fi
     47# On Darwin, the symbolic links libpng.* created by libpng12 may interfere
     48# with a system-wide libPng.dylib.
     49# This system-wide library is likely to be a different version and on top of
     50# that the symbols exported there are prefixed with "_cg" (for "Core Graphics"),
     51# so even if by chance the functionalities of the two libraries were interchangeable,
     52# libraries or applications looking for one and being presented the other won't
     53# find the symbols they expect.
     54# Note the uppercase "P" which could prevent this conflict; unfortunately, the
     55# default filesystem used by Apple is case-insensitive.
     56# Also note there would be no problem if the system-wide library was not looked
     57# for when Sage is being built or run, but that's not the case either;
     58# it is at least looked for by the "ImageIO" framework:
     59# - when Python is built with Mac OS extensions, fixed in #4008;
     60# - when Mercurial is built because it uses $EDITOR, cf. #4678;
     61# - when R is built and it finds -lpng, cf. #4409 and #11696.
     62# As not all of these problems are easily dealt with and new ones may arise,
     63# we chose to delete the $SAGE_LOCAL/lib/libpng.* symlinks on Darwin.
     64# Therefore, some package as matplotlib (cf. #11686) which by default looks for
     65# -lpng are patched to look for -lpng12 (unless pkg-config is installed; in
     66# this case indeed we can use a non-conflicting libpng.pc symlinking to
     67# libpng12.pc).
     68if [ "$UNAME" = "Darwin" ]; then
     69    echo "Deleting libpng.*..."
     70    rm -rf "$SAGE_LOCAL"/lib/libpng.*
     71    if [ $? -ne 0 ]; then
     72        echo >&2 "Error deleting symlinks."
     73        exit 1
     74    fi
    5575fi
    56 
    57 echo "Deleting libpng.*"
    58 rm -rf "$SAGE_LOCAL"/lib/libpng.*
    59