SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "libpng+apng"

# SliTaz package receipt.

PACKAGE="libpng+apng"
SOURCE="libpng"
VERSION="1.6.37"
SERIES="libpng16"
CATEGORY="x-window"
SHORT_DESC="Loads and saves PNG files (with APNG support)."
MAINTAINER="al.bobylev@gmail.com"
LICENSE="zlib/libpng"
WEB_SITE="http://www.libpng.org/pub/png/libpng.html"

TARBALL="$SOURCE-$VERSION.tar.xz"
WGET_URL="$SF_MIRROR/$SOURCE/$TARBALL"

PATCH="$SOURCE-$VERSION-apng.patch.gz"
PATCH_URL="$SF_MIRROR/apng/$SOURCE/$SERIES/$PATCH"

DEPENDS="zlib"
BUILD_DEPENDS="gawk zlib-dev"

HOST_ARCH="i486 arm"

# What is the latest version available today?
current_version()
{
    wget -O - https://sourceforge.net/projects/libpng/files/ 2>/dev/null | \
    sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
    sed '/scope="row/!d;s|.*/libpng[0-9]*/||;s|/.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    [ -s "$SRC/$PATCH" ] || wget -O "$SRC/$PATCH" $PATCH_URL
    #gzip -cd $SRC/$PATCH | patch -p0

    # try to fix apng patch...
    gzip -cd $SRC/$PATCH > patch.apng
    for i in $(seq 267 -1 248); do
        sed -i "s|^\+PNG_EXPORT($i,|+PNG_EXPORT($(($i+2)),|" patch.apng
    done
    patch -p0 < patch.apng
    
    LIBS=-lrt \
    ./configure            \
        --prefix=/usr        \
        --disable-static    \
        $CONFIGURE_ARGS &&
    make -j 1 &&

    case "$ARCH" in
    arm*)
        make DESTDIR=$DESTDIR install ;;
    *)
        make check | tr [A-Z] [a-z] &&
        make DESTDIR=$DESTDIR install ;;
    esac
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib
    cp -a $install/usr/lib/*.so* $fs/usr/lib
}
6047 packages and 205261 files in current database (Tue Jun 11 00:01:12 2024)