Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

png: add libpng port #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: ./phoenix-rtos-ports/build.subr: openBinaryFile: does not exist (No such file or directory) SC1091

source "${PREFIX_PROJECT}/phoenix-rtos-ports/build.subr"

Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ ports=(
"picocom"
"fs_mark"
"coremark"
"png"
)


Expand Down
53 changes: 53 additions & 0 deletions png/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash

set -e


extract_sources() {
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
}


exec_configure() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
exec_configure references arguments, but none are ever passed. SC2120

(cd "${PREFIX_PORT_SRC}" &&
"${PREFIX_PORT_SRC}/configure" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
--host="${HOST%phoenix}linux" --bindir="${PREFIX_PROG}" --sbindir="${PREFIX_PROG}" \
--libdir="${PREFIX_A}" --includedir="${PREFIX_H}" \
--prefix="${PREFIX_PORT_INSTALL}" --datarootdir="${PREFIX_A}" "${@}" \
--disable-shared --enable-static --enable-silent-rules
)
}


build_libpng() {
appname="libpng"
version="1.6.44"

b_log "png: building ${appname}"

archive_filename="${appname}-${version}.tar.gz"
PREFIX_PORT_SRC="${PREFIX_PORT_BUILD}/${appname}/${version}"
b_port_download "http://prdownloads.sourceforge.net/libpng/" "${archive_filename}"

extract_sources

echo "${appname}/${version}"
b_port_apply_patches "${PREFIX_PORT_SRC}" "${appname}/${version}"

if [ ! -f "${PREFIX_PORT_SRC}/config.status" ]; then
exec_configure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Use exec_configure "$@" if function's $1 should mean script's $1. SC2119

fi

make -C "${PREFIX_PORT_SRC}" PREFIX="${PREFIX_PORT_BUILD}"
make -C "${PREFIX_PORT_SRC}" PREFIX="${PREFIX_PORT_BUILD}" install
}


build_libpng


rm -rf "$TMP_DIR"
12 changes: 12 additions & 0 deletions png/patches/libpng/1.6.44/01-Makefile.am.patch
Original file line number Diff line number Diff line change
@@ -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 $@
Loading