changeset 3274:e7cb2340feff

Add gnu units * src/units.mk: New file. * src/units-1-fixes.patch: New file. * index.html: Added units package information. * mk-dist: add units to make target.
author John Donoghue <john.donoghue@ieee.org>
date Mon, 21 Oct 2013 14:39:17 -0400
parents 217bd706c68d
children 3d985d5d48ec
files index.html mk-dist src/units-1-fixes.patch src/units.mk
diffstat 4 files changed, 64 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/index.html	Fri Oct 18 22:36:37 2013 -0400
+++ b/index.html	Mon Oct 21 14:39:17 2013 -0400
@@ -2287,6 +2287,11 @@
         <td id="tre-website"><a href="http://laurikari.net/tre/">TRE</a></td>
     </tr>
     <tr>
+        <td id="units-package">units</td>
+        <td id="units-version">2.02</td>
+        <td id="units-website"><a href="http://www.gnu.org/software/units/units.html">GNU Units</a></td>
+    </tr>
+    <tr>
         <td id="uuid-package">uuid</td>
         <td id="uuid-version">3.17</td>
         <td id="uuid-website"><a href="http://www.mingw.org/">MingWG Windows API</a></td>
--- a/mk-dist	Fri Oct 18 22:36:37 2013 -0400
+++ b/mk-dist	Mon Oct 21 14:39:17 2013 -0400
@@ -59,7 +59,7 @@
 mkdir -p $OCTAVE_DIST_DIR
 
 echo "building octave and dependencies..."
-make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs
+make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp units JOBS=$jobs
 
 echo "generating lists of files to exclude..."
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/units-1-fixes.patch	Mon Oct 21 14:39:17 2013 -0400
@@ -0,0 +1,34 @@
+--- a/units.c.orig	2013-10-21 11:47:34 -0400
++++ b/units.c	2013-10-21 12:18:24 -0400
+@@ -1166,23 +1166,23 @@
+ int
+ setenv(const char *name, const char *val, int overwrite)
+ {
+-  char *environ;
++  char *environ1;
+ 
+   if (!overwrite && getenv(name) != NULL)
+     return 0;
+-  environ = (char *) malloc(strlen(name) + strlen(val) + 2);
+-  if (!environ)
++  environ1 = (char *) malloc(strlen(name) + strlen(val) + 2);
++  if (!environ1)
+     return 1;
+-  strcpy(environ, name);
+-  strcat(environ, "=");
+-  strcat(environ, val);
++  strcpy(environ1, name);
++  strcat(environ1, "=");
++  strcat(environ1, val);
+ 
+   /* putenv() doesn't copy its argument, so don't free environ */
+ 
+ #if defined _WIN32 && defined _MSC_VER
+-  return _putenv(environ);
++  return _putenv(environ1);
+ #else
+-  return putenv(environ);
++  return putenv(environ1);
+ #endif
+ }
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/units.mk	Mon Oct 21 14:39:17 2013 -0400
@@ -0,0 +1,24 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := units
+$(PKG)_IGNORE   :=
+$(PKG)_CHECKSUM := e460371dc97034d17ce452e6b64991f7fd2d1409
+$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL      := http://ftp.gnu.org/gnu/$(PKG)/$($(PKG)_FILE)
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
+    echo $($(PKG)_VERSION)
+endef
+
+define $(PKG)_BUILD
+    cd '$(1)' && ./configure \
+        --prefix='$(HOST_PREFIX)' \
+        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) 
+
+    $(MAKE) -C '$(1)' -j '$(JOBS)' 
+    $(MAKE) -C '$(1)' -j 1 install
+endef