Skip to content
Snippets Groups Projects
Commit 40499826 authored by Clemens Terasa's avatar Clemens Terasa
Browse files

netpbm: Add a netpbm recipe

In order to get image manipulating tools for ppm and other parts we need
the netpbm package to convert image files.

It is a bit tricky to build this as the build system is not really
standard and has some bugs.
Finally i figured out a working configuration and installation.
parent 40cdf41d
No related branches found
No related tags found
1 merge request!29netpbm: Add a netpbm recipe
From db8eb226e3c5c811bd09b9656e9df054cc985645 Mon Sep 17 00:00:00 2001
From: Clemens Terasa <clemens.terasa@garz-fricke.com>
Date: Fri, 25 Sep 2020 07:57:34 +0200
Subject: [PATCH] pamx: Fix pkg-config X11 query
The query for the pkg-config was not working as expected. This was
probably not an issue for X11 systems, however it deos create problems
with non-x11 builds.
Fix it similar to https://sourceforge.net/p/netpbm/code/3682/
---
other/pamx/Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/other/pamx/Makefile b/other/pamx/Makefile
index 4e06e0f..c9fc9f8 100644
--- a/other/pamx/Makefile
+++ b/other/pamx/Makefile
@@ -9,7 +9,10 @@ include $(BUILDDIR)/config.mk
EXTERN_INCLUDE =
-ifeq ($(shell pkg-config x11 --modversion --silence-errors),)
+TEST_PKGCONFIG_X11 := \
+ if pkg-config x11 --exists; then echo exists; fi
+
+ifeq ($(shell $(TEST_PKGCONFIG_X11)),)
# Pkg-config has never heard of X11, or doesn't even exist
ifneq ($(X11LIB),NONE)
@@ -46,7 +49,7 @@ all: $(BINARIES)
include $(SRCDIR)/common.mk
-ifeq ($(shell pkg-config x11 --libs),)
+ifeq ($(shell $(TEST_PKGCONFIG_X11)),)
X11_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB))
else
X11_LIBOPTS = $(shell pkg-config x11 --libs)
From 258b47372d3e275a2d3cfa7d80d476fbcb92b5a9 Mon Sep 17 00:00:00 2001
From: Clemens Terasa <clemens.terasa@garz-fricke.com>
Date: Fri, 25 Sep 2020 08:11:08 +0200
Subject: [PATCH] ximtoppm: Fix string copy
Fix a string duplication issue previously done wrong.
The implementation createt warnings for security reasons with
-Wformat-security. This is due to a anti-pattern heaving a variable
string as format specifier of a printf-family function.
Instead use a strdup variant.
See commit https://sourceforge.net/p/netpbm/code/3939/
---
converter/ppm/ximtoppm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c
index dc04b36..4fbfe75 100644
--- a/converter/ppm/ximtoppm.c
+++ b/converter/ppm/ximtoppm.c
@@ -116,9 +116,10 @@ ReadXimHeader(FILE * const in_fp,
*/
header->bits_channel = atoi(a_head.bits_per_channel);
header->alpha_flag = atoi(a_head.alpha_channel);
- pm_asprintf(&header->author, a_head.author);
- pm_asprintf(&header->date, a_head.date);
- pm_asprintf(&header->program, a_head.program);
+ header->author = pm_strdup(a_head.author);
+ header->date = pm_strdup(a_head.date);
+ header->program = pm_strdup(a_head.program);
+
/* Do double checking for bakwards compatibility */
if (header->npics == 0)
header->npics = 1;
This diff is collapsed.
#!/bin/sh
#
# This replaces 'endiangen' for OpenEmbedded. OE builds can rely on
# the GNU endian.h, however this generates __ names, (unless __USE_BSD
# is set) so we need to deal with this. Match the output of endiangen.
cat <<EOF
#ifndef OE_ENDIAN_H
#define OE_ENDIAN_H 1
#include <ctype.h>
#include <endian.h>
#ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN __LITTLE_ENDIAN
#endif
#ifndef BIG_ENDIAN
# define BIG_ENDIAN __BIG_ENDIAN
#endif
#ifndef PDP_ENDIAN
# define PDP_ENDIAN __PDP_ENDIAN
#endif
#ifndef BYTE_ORDER
# define BYTE_ORDER __BYTE_ORDER
#endif
#ifndef BITS_PER_WORD
# include <bits/wordsize.h>
# define BITS_PER_WORD __WORDSIZE
#endif
#endif
EOF
#!/bin/sh
printf "/* This was generated by the program 'typegen' */\n"
printf "#ifndef INTTYPES_H_NETPBM\n"
printf "#define INTTYPES_H_NETPBM\n"
printf "typedef unsigned int uint32_t;\n"
printf "typedef unsigned int uint_fast32_t;\n"
printf "typedef signed int int32_t;\n"
printf "typedef signed int int_fast32_t;\n"
printf "#endif\n"
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# The following license files were not able to be identified and are
# represented as "Unknown" below, you will need to check them yourself:
# doc/copyright_summary
# doc/GPL_LICENSE.txt
# doc/COPYRIGHT.PATENT
# converter/ppm/ppmtompeg/COPYRIGHT
# converter/pbm/pbmtoppa/LICENSE
# converter/other/pnmtopalm/LICENSE
# converter/other/cameratopam/COPYRIGHT
# lib/util/LICENSE.txt
# other/pamx/COPYRIGHT
#
# NOTE: multiple licenses have been detected; they have been separated with &
# in the LICENSE value for now since it is a reasonable assumption that all
# of the licenses apply. If instead there is a choice between the multiple
# licenses then you should change the value to separate the licenses with |
# instead of &. If there is any doubt, check the accompanying documentation
# to determine which situation is applicable.
LICENSE = "Unknown & GPLv2"
LIC_FILES_CHKSUM = "file://doc/copyright_summary;md5=0a5d51ab9c96cf1d16a4fc492adc4618 \
file://doc/GPL_LICENSE.txt;md5=079b27cd65c86dbc1b6997ffde902735 \
file://doc/COPYRIGHT.PATENT;md5=12058e0fe45009031ca66cdc09c838a5 \
file://converter/ppm/ppmtompeg/COPYRIGHT;md5=524ff2e7d68c9b2b9be44fa6dc43b6a9 \
file://converter/pbm/pbmtoppa/LICENSE;md5=e6d8a8731b55aec86c981b6474ff0888 \
file://converter/other/pnmtopalm/LICENSE;md5=6d644cf37a0fd379433b17c0fefc4c32 \
file://converter/other/jbig/libjbig/COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
file://converter/other/cameratopam/COPYRIGHT;md5=b599b5fdcb221af54d1ae96023826a79 \
file://lib/util/LICENSE.txt;md5=b0535eb75eda9ffea63e232ae46f4f4b \
file://other/pamx/COPYRIGHT;md5=70075b407c887a3c57e794e2dbffeb1b"
inherit pkgconfig
SRC_URI = "https://sourceforge.net/projects/netpbm/files/super_stable/${PV}/netpbm-${PV}.tgz \
file://config.mk \
file://oeendiangen \
file://oetypegen \
file://0001-pamx-Fix-pkg-config-X11-query.patch \
file://0002-ximtoppm-Fix-string-copy.patch \
"
SRCREV="3964"
SRC_URI[md5sum] = "c566fc35d34f3de4d8e41a578bc3a898"
SRC_URI[sha1sum] = "c0b69d0c4bb48ede501a2b459a749df049a72431"
SRC_URI[sha256sum] = "a79b86a9ff28bac4fa46688a6cb6e537be0129d23fc74ec71a941b0791679942"
SRC_URI[sha384sum] = "24c3455dbc258ec660dc413e17bac1775714f3f05431ee9eba75dc131db504833e1d4d649ebaf060f838ea6092851a3c"
SRC_URI[sha512sum] = "c66c4a00dc58bd170de35ee1e0c87fea45ca869c2ea05e13487ce1708d7735f5610a6a366ee6fbf4dbd01947b5e21f6217c963893a614a41796629133fd886f7"
# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation
#DEPENDS = "libx11"
DEPENDS = "jpeg libpng tiff zlib"
# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the
# recipe automatically - you will need to examine the Makefile yourself and ensure
# that the appropriate arguments are passed in.
PARALLEL_MAKE = ""
EXTRA_OEMAKE = "'ENDIANGEN=${S}/buildtools/oeendiangen' 'TYPEGEN=${S}/buildtools/oetypegen' 'STRIPFLAG=' 'S=${S}' TARGET_LD='${LD}'"
do_configure_prepend () {
install -m755 ${WORKDIR}/oeendiangen ${S}/buildtools/
install -m755 ${WORKDIR}/oetypegen ${S}/buildtools/
install -m755 ${WORKDIR}/config.mk ${S}/
}
do_compile () {
# You will almost certainly need to add additional arguments here
# cd converter/other
# oe_runmake pngtopam
oe_runmake
}
do_install () {
# NOTE: unable to determine what to put here - there is a Makefile but no
# target named "install", so you will need to define this yourself
mkdir -p ${D}${bindir}
find ${S} \( -name "lib*" -o -name manweb -o -name "*.csh" -o -name makeman -o -path ${S}/buildtools -o -path ${S}/test -o -path ${S}/converter/ppm/ppmtompeg/tst \) -prune -o -type f -executable -exec install -m755 {} ${D}${bindir} \;
mkdir -p ${D}${libdir}
find ${S}/lib -name "lib*\.so*" -exec cp -P {} ${D}${libdir} \;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment