From 840b35ceb85af26531f753905d61b79f2ad17bd2 Mon Sep 17 00:00:00 2001 From: Adam Greloch Date: Mon, 21 Oct 2024 08:57:38 +0200 Subject: [PATCH] libpng: add libpng port JIRA: RTOS-955 --- build.sh | 1 + libpng/build.sh | 32 +++++++++++++++++++++++++++++ libpng/patches/01-Makefile.am.patch | 12 +++++++++++ 3 files changed, 45 insertions(+) create mode 100755 libpng/build.sh create mode 100644 libpng/patches/01-Makefile.am.patch diff --git a/build.sh b/build.sh index 8b68b537..1b967716 100755 --- a/build.sh +++ b/build.sh @@ -65,6 +65,7 @@ ports=( "coremark" "coreMQTT" "lsb_vsx" + "libpng" ) diff --git a/libpng/build.sh b/libpng/build.sh new file mode 100755 index 00000000..327b7b76 --- /dev/null +++ b/libpng/build.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -e + +appname="libpng" +version="1.6.44" +archive_filename="${appname}-${version}.tar.gz" + +PREFIX_PORT_SRC="${PREFIX_PORT_BUILD}/${appname}-${version}/" + +b_port_download "http://prdownloads.sourceforge.net/libpng/" "${archive_filename}" + +if [ ! -d "${PREFIX_PORT_SRC}" ]; then + echo "Extracting sources from ${archive_filename}" + mkdir -p "${PREFIX_PORT_SRC}" + tar -axf "${PREFIX_PORT}/${archive_filename}" --strip-components 1 -C "${PREFIX_PORT_SRC}" +fi + +b_port_apply_patches "${PREFIX_PORT_SRC}" + +if [ ! -f "${PREFIX_PORT_SRC}/config.status" ]; then + (cd "${PREFIX_PORT_SRC}" && autoreconf -vfi && + "${PREFIX_PORT_SRC}/configure" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \ + --host="${HOST}" --bindir="${PREFIX_PROG}" --sbindir="${PREFIX_PROG}" \ + --libdir="${PREFIX_A}" --includedir="${PREFIX_H}" --datarootdir="${PREFIX_A}" \ + --disable-shared --enable-static --enable-silent-rules \ + --disable-tests --disable-tools + ) +fi + +make -C "${PREFIX_PORT_SRC}" +make -C "${PREFIX_PORT_SRC}" install diff --git a/libpng/patches/01-Makefile.am.patch b/libpng/patches/01-Makefile.am.patch new file mode 100644 index 00000000..cb34ee76 --- /dev/null +++ b/libpng/patches/01-Makefile.am.patch @@ -0,0 +1,12 @@ +diff -ruN a/Makefile.am b/Makefile.am +--- a/Makefile.am 2024-10-18 10:20:12.884467503 +0200 ++++ b/Makefile.am 2024-10-18 10:19:21.813487165 +0200 +@@ -301,7 +301,7 @@ + rm -f $@ $*.tf[12] + test -d scripts || mkdir scripts || test -d scripts + $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\ +- $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1 ++ $(CFLAGS) $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1 + $(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2 + rm -f $*.tf1 + mv $*.tf2 $@