0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-12-15 07:29:46 +00:00
2024-04-03 00:50:36 +02:00

55 lines
1.9 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libpng"
PKG_VERSION="1.6.43"
PKG_SHA256="6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c"
if [ "${DISTRO}" = "Lakka" ]; then
PKG_VERSION="1.7.0beta89"
PKG_SHA256="1fad2475a24174f5b4ad237b8b899a2c0583237f108c2288a6e2ac5c3537147a"
fi
PKG_LICENSE="LibPNG2"
PKG_SITE="http://www.libpng.org/"
PKG_URL="${SOURCEFORGE_SRC}/libpng/${PKG_NAME}-${PKG_VERSION}.tar.xz"
PKG_DEPENDS_HOST="zlib:host"
PKG_DEPENDS_TARGET="toolchain zlib"
PKG_LONGDESC="An extensible file format for the lossless, portable, well-compressed storage of raster images."
PKG_TOOLCHAIN="configure"
PKG_BUILD_FLAGS="+pic +pic:host"
PKG_CONFIGURE_OPTS_TARGET="ac_cv_lib_z_zlibVersion=yes \
--enable-static \
--disable-shared"
PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared"
pre_configure_host() {
export CPPFLAGS="${CPPFLAGS} -I${TOOLCHAIN}/include"
}
pre_configure_target() {
export CPPFLAGS="${CPPFLAGS} -I${SYSROOT_PREFIX}/usr/include"
}
post_makeinstall_target() {
sed -e "s:\([\"'= ]\)/usr:\\1${SYSROOT_PREFIX}/usr:g" \
-e "s:libs=\"-lpng16\":libs=\"-lpng16 -lz\":g" \
-i ${SYSROOT_PREFIX}/usr/bin/libpng*-config
sed -e 's|^Libs: -L${libdir} -lpng16|Libs: -L${libdir} -lpng16 -lz|g' \
-i ${SYSROOT_PREFIX}/usr/lib/pkgconfig/libpng*.pc
# FIXME: when version changes, adjust below
if [ "${DISTRO}" = "Lakka" ]; then
sed -e "s:\([\"'= ]\)/usr:\\1${SYSROOT_PREFIX}/usr:g" \
-e "s:libs=\"-lpng17\":libs=\"-lpng17 -lz\":g" \
-i ${SYSROOT_PREFIX}/usr/bin/libpng*-config
sed -e 's|^Libs: -L${libdir} -lpng17|Libs: -L${libdir} -lpng17 -lz|g' \
-i ${SYSROOT_PREFIX}/usr/lib/pkgconfig/libpng*.pc
fi
rm -rf ${INSTALL}/usr/bin
}