changeset 2904:8db54bdc9a6d draft

Add package netpbm.
author Martin Lambers <marlam@marlam.de>
date Thu, 06 Dec 2012 13:24:20 +0100
parents d659c9b121b0
children ea66935f1af6
files index.html src/netpbm-1-portability-fixes.patch src/netpbm.mk
diffstat 3 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/index.html
+++ b/index.html
@@ -1654,6 +1654,11 @@
         <td id="netcdf-website"><a href="http://www.unidata.ucar.edu/software/netcdf/">NetCDF</a></td>
     </tr>
     <tr>
+        <td id="netpbm-package">netpbm</td>
+        <td id="netpbm-version">10.35.87</td>
+        <td id="netpbm-website"><a href="http://netpbm.sourceforge.net/">Netpbm</a></td>
+    </tr>
+    <tr>
         <td id="nettle-package">nettle</td>
         <td id="nettle-version">2.5</td>
         <td id="nettle-website"><a href="http://www.lysator.liu.se/~nisse/nettle/">nettle</a></td>
new file mode 100644
--- /dev/null
+++ b/src/netpbm-1-portability-fixes.patch
@@ -0,0 +1,22 @@
+This file is part of MXE.
+See index.html for further information.
+
+--- a/urt/rle_open_f.c	2012-12-06 11:19:45.850521658 +0100
++++ b/urt/rle_open_f.c	2012-12-06 11:19:57.794521308 +0100
+@@ -15,14 +15,14 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ 
++#include "rle.h"
++
+ #ifndef NO_OPEN_PIPES
+ /* Need to have a SIGCLD signal catcher. */
+ #include <signal.h>
+ #include <sys/wait.h>
+ #include <errno.h>
+ 
+-#include "rle.h"
+-
+ /* Count outstanding children.  Assume no more than 100 possible. */
+ #define MAX_CHILDREN 100
+ static int catching_children = 0;
new file mode 100644
--- /dev/null
+++ b/src/netpbm.mk
@@ -0,0 +1,43 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := netpbm
+$(PKG)_IGNORE   :=
+$(PKG)_CHECKSUM := faf4f4e65ede1a22ed38d84596e68446b7970a8b
+$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tgz
+$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/netpbm/super_stable/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS     := gcc
+
+define $(PKG)_UPDATE
+    /bin/false
+endef
+
+# The Netpbm package has its own weird build system...
+# Parallel builds don't work, so we use -j1 explicitly.
+
+define $(PKG)_BUILD
+    # Create a suitable configuration
+    cp '$(1)/Makefile.config.in' '$(1)/Makefile.config'
+    echo 'DEFAULT_TARGET=nonmerge'          >> '$(1)/Makefile.config'
+    echo 'CC=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
+    echo 'LD=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
+    echo 'LINKERISCOMPILER=Y'               >> '$(1)/Makefile.config'
+    echo 'LINKER_CAN_DO_EXPLICIT_LIBRARY=Y' >> '$(1)/Makefile.config'
+    echo 'AR=$(TARGET)-ar'                  >> '$(1)/Makefile.config'
+    echo 'RANLIB=$(TARGET)-ranlib'          >> '$(1)/Makefile.config'
+    echo 'OMIT_NETWORK=y'                   >> '$(1)/Makefile.config'
+    echo 'DONT_HAVE_PROCESS_MGMT=Y'         >> '$(1)/Makefile.config'
+    echo 'NETPBMLIBTYPE=unixstatic'         >> '$(1)/Makefile.config'
+    echo 'NETPBMLIBSUFFIX=a'                >> '$(1)/Makefile.config'
+    # Build only the library
+    $(MAKE) -C '$(1)' -j1 PROG_SUBDIRS=
+    # Package everything into a package directory. Use '-i' to ignore
+    # failures that happen because we did not build all the tools.
+    $(MAKE) -C '$(1)' -j1 -i package pkgdir='$(1)/mxe-pkgdir'
+    # Install only the library from that package directory
+    $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
+    $(INSTALL) -m644 '$(1)/mxe-pkgdir/include/'* '$(PREFIX)/$(TARGET)/include'
+    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
+    $(INSTALL) -m644 '$(1)/mxe-pkgdir/link/libnetpbm.a' '$(PREFIX)/$(TARGET)/lib/'
+endef