Commit: a776e77339906bb7073fea6213708f6b4e0f4d45
Parent: 74b9dae0d1f66500ef695613f3b8cc090b74c010
Author: Randy Palamar
Date: Thu, 28 Sep 2023 06:25:44 -0600
add libpng from oasis (bumped to v1.6.40)
Diffstat:
6 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -24,6 +24,9 @@
path = pkg/libs/bearssl/src
url = https://www.bearssl.org/git/BearSSL
ignore = all
+[submodule "pkg/libs/libpng/src"]
+ path = pkg/libs/libpng/src
+ url = https://github.com/glennrp/libpng.git
[submodule "pkg/libs/libtls-bearssl/src"]
path = pkg/libs/libtls-bearssl/src
url = https://git.sr.ht/~mcf/libtls-bearssl
diff --git a/pkg/libs/gen.lua b/pkg/libs/gen.lua
@@ -1,4 +1,5 @@
subgen('bearssl')
+subgen('libpng')
subgen('libtermkey')
subgen('libtls-bearssl')
subgen('lpeg')
diff --git a/pkg/libs/libpng/config.h b/pkg/libs/libpng/config.h
@@ -0,0 +1,42 @@
+#define HAVE_DLFCN_H 1
+/* #undef HAVE_FEENABLEEXCEPT */
+#define HAVE_INTTYPES_H 1
+/* #undef HAVE_LIBM */
+#define HAVE_LIBZ 1
+#define HAVE_MEMORY_H 1
+#define HAVE_POW 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_UNISTD_H 1
+#define LT_OBJDIR ".libs/"
+#define PACKAGE "libpng"
+#define PACKAGE_BUGREPORT "png-mng-implement@lists.sourceforge.net"
+#define PACKAGE_NAME "libpng"
+#define PACKAGE_STRING "libpng 1.6.37"
+#define PACKAGE_TARNAME "libpng"
+#define PACKAGE_URL ""
+#define PACKAGE_VERSION "1.6.37"
+/* #undef PNG_ARM_NEON_API_SUPPORTED */
+/* #undef PNG_ARM_NEON_CHECK_SUPPORTED */
+/* #undef PNG_ARM_NEON_OPT */
+/* #undef PNG_INTEL_SSE_OPT */
+/* #undef PNG_MIPS_MSA_API_SUPPORTED */
+/* #undef PNG_MIPS_MSA_CHECK_SUPPORTED */
+/* #undef PNG_MIPS_MSA_OPT */
+/* #undef PNG_POWERPC_VSX_API_SUPPORTED */
+/* #undef PNG_POWERPC_VSX_CHECK_SUPPORTED */
+/* #undef PNG_POWERPC_VSX_OPT */
+#define STDC_HEADERS 1
+/* #undef TM_IN_SYS_TIME */
+#define VERSION "1.6.37"
+/* #undef const */
+#define restrict __restrict
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+/* #undef size_t */
diff --git a/pkg/libs/libpng/gen.lua b/pkg/libs/libpng/gen.lua
@@ -0,0 +1,39 @@
+cflags({
+ '-D HAVE_CONFIG_H',
+ '-I $dir',
+ '-I $outdir/include',
+ '-isystem $builddir/pkg/libs/zlib/include',
+})
+
+build('awk', '$outdir/pnglibconf.tf4', {
+ '$srcdir/pngconf.h',
+ '$srcdir/scripts/pnglibconf.dfa',
+ '$srcdir/pngusr.dfa',
+ '|', '$srcdir/scripts/options.awk',
+}, {expr='-f $srcdir/scripts/options.awk out=/dev/stdout version=search'})
+build('awk', '$outdir/pnglibconf.c', '$outdir/pnglibconf.tf4', {
+ expr='-f $srcdir/scripts/options.awk out=/dev/stdout',
+})
+build('cpp', '$outdir/pnglibconf.tf1', {'$outdir/pnglibconf.c', '||', 'pkg/libs/zlib/headers'})
+build('awk', '$outdir/include/pnglibconf.h', '$outdir/pnglibconf.tf1', {
+ expr='-f $srcdir/scripts/dfn.awk out=/dev/stdout',
+})
+
+pkg.hdrs = {
+ copy('$outdir/include', '$srcdir', {'png.h', 'pngconf.h'}),
+ '$outdir/include/pnglibconf.h',
+ install=true,
+}
+pkg.deps = {'$outdir/include/pnglibconf.h', 'pkg/libs/zlib/headers'}
+
+lib('libpng.a', [[
+ png.c pngerror.c
+ pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c
+ pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
+ @aarch64 arm/(arm_init.c filter_neon.S filter_neon_intrinsics.c palette_neon_intrinsics.c)
+ @x86_64 intel/(intel_init.c filter_sse2_intrinsics.c)
+ $builddir/pkg/libs/zlib/libz.a
+]])
+file('lib/libpng.a', '644', '$outdir/libpng.a')
+
+fetch('git')
diff --git a/pkg/libs/libpng/src b/pkg/libs/libpng/src
@@ -0,0 +1 @@
+Subproject commit f135775ad4e5d4408d2e12ffcc71bb36e6b48551
diff --git a/pkg/libs/libpng/ver b/pkg/libs/libpng/ver
@@ -0,0 +1 @@
+1.6.40 r0