[135560] trunk/dports/science/chemical-mime-data

devans at macports.org devans at macports.org
Sun Apr 26 07:23:35 PDT 2015


Revision: 135560
          https://trac.macports.org/changeset/135560
Author:   devans at macports.org
Date:     2015-04-26 07:23:35 -0700 (Sun, 26 Apr 2015)
Log Message:
-----------
chemical-mime-data: reconfigure using upstream autogen.sh for intltool 0.51 compatibility.

Modified Paths:
--------------
    trunk/dports/science/chemical-mime-data/Portfile

Added Paths:
-----------
    trunk/dports/science/chemical-mime-data/files/
    trunk/dports/science/chemical-mime-data/files/autogen.sh

Modified: trunk/dports/science/chemical-mime-data/Portfile
===================================================================
--- trunk/dports/science/chemical-mime-data/Portfile	2015-04-26 14:16:59 UTC (rev 135559)
+++ trunk/dports/science/chemical-mime-data/Portfile	2015-04-26 14:23:35 UTC (rev 135560)
@@ -29,16 +29,22 @@
                     port:intltool \
                     port:gettext \
                     port:ImageMagick \
-                    port:libxslt
+                    port:libxslt \
+                    port:autoconf \
+                    port:automake \
+                    port:libtool
 
 depends_lib         port:gtk3 \
                     port:shared-mime-info
 
-# autoreconf to reconfigure with our intltool.m4
+# reconfigure using upstream autogen.sh for intltool 0.51 compatibility
 
-use_autoreconf      yes
-autoreconf.args     -fvi
+post-patch {
+    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
+}
 
+configure.cmd       ./autogen.sh && ./configure
+
 configure.args      --disable-update-database \
                     --without-gnome-mime
 

Added: trunk/dports/science/chemical-mime-data/files/autogen.sh
===================================================================
--- trunk/dports/science/chemical-mime-data/files/autogen.sh	                        (rev 0)
+++ trunk/dports/science/chemical-mime-data/files/autogen.sh	2015-04-26 14:23:35 UTC (rev 135560)
@@ -0,0 +1,114 @@
+#!/bin/sh
+#
+# Document  $Id: autogen.sh 58 2006-12-30 15:40:20Z dleidert $
+# Summary   Auto-generate the package source.
+#
+# Copyright (C) 2004-2006 Egon Willighagen.
+# Copyright (C) 2004-2006 Daniel Leidert <daniel.leidert at wgdd.de>.
+#
+# This file is free software. The copyright owner gives unlimited
+# permission to copy, distribute and modify it.
+
+set -e
+
+## all initial declarations, overwrite them using e.g. 'ACLOCAL=aclocal-1.7 AUTOMAKE=automake-1.7 ./autogen.sh'
+ACLOCAL=${ACLOCAL:-aclocal}
+AUTOCONF=${AUTOCONF:-autoconf}
+AUTOMAKE=${AUTOMAKE:-automake}
+INTLTOOLIZE=${INTLTOOLIZE:-intltoolize}
+
+## check, if all binaries exist and fail with error 1 if not
+if [ -z `which $ACLOCAL` ] ; then echo "Error. ACLOCAL=$ACLOCAL not found." >&2 && exit 1 ; fi
+if [ -z `which $AUTOCONF` ] ; then echo "Error. AUTOCONF=$AUTOCONF not found." >&2 && exit 1 ; fi
+if [ -z `which $AUTOMAKE` ] ; then echo "Error. AUTOMAKE=$AUTOMAKE not found." >&2 && exit 1 ; fi
+if [ -z `which $INTLTOOLIZE` ] ; then echo "Error. INTLTOOLIZE=$INTLTOOLIZE not found." >&2 && exit 1 ; fi
+
+## find where automake is installed and get the version
+AUTOMAKE_PATH=${AUTOMAKE_PATH:-`which $AUTOMAKE | sed 's|\/bin\/automake.*||'`}
+AUTOMAKE_VERSION=`$AUTOMAKE --version | grep automake | awk '{print $4}' | awk -F. '{print $1"."$2}'`
+
+## automake files we need to have inside our source
+if [ $AUTOMAKE_VERSION = "1.7" ] ; then
+        AUTOMAKE_FILES="missing mkinstalldirs install-sh"
+else
+        AUTOMAKE_FILES="missing install-sh"
+fi
+
+## our help output - if autogen.sh was called with -h|--help or unknown option
+autogen_help() {
+	echo
+	echo "autogen.sh usage:"
+	echo
+	echo "  Produces all files necessary to build the chemical-mime-data project files."
+	echo "  The files are linked by default, if you run ./autogen.sh without an option."
+	echo
+	echo "    -c, --copy      Copy files instead to link them."
+	echo "    -h, --help      Print this message."
+	echo
+	echo "  You can overwrite the automatically determined location of aclocal, automake,"
+	echo "  autoconf and intltoolize using:"
+	echo
+	echo "    ACLOCAL=/foo/bin/aclocal-1.8 AUTOMAKE=automake-1.8 ./autogen.sh"
+	echo
+}
+
+## check if $AUTOMAKE_FILES were copied to our source
+## link/copy them if not - necessary for e.g. gettext, which seems to always need mkinstalldirs
+autogen_if_missing() {
+	case "$1" in
+		copy)
+			command="cp"
+		;;
+		link)
+			command="ln -s"
+		;;
+		*)
+			echo "Error. autogen_if_missing() was called with unknown parameter $1." >&2
+		;;
+	esac
+	
+	for file in $AUTOMAKE_FILES ; do
+		if [ ! -e "$file" ] ; then
+			$command -f $AUTOMAKE_PATH/share/automake-$AUTOMAKE_VERSION/$file .
+		fi
+	done
+}
+
+## link/copy the necessary files to our source to prepare for a build
+autogen() {
+	case "$1" in
+		copy)
+			copyoption="-c"
+		;;
+		link)
+		;;
+		*)
+			echo "Error. autogen() was called with unknown parameter $1." >&2
+		;;
+	esac
+	$INTLTOOLIZE -f $copyoption
+	$ACLOCAL
+	$AUTOMAKE --gnu -a $copyoption
+	autogen_if_missing $1
+	$AUTOCONF
+}
+
+## the main function
+case "$1" in
+	-h | --help)
+		autogen_help
+		exit 0
+	;;
+	-c | --copy)
+		autogen copy
+	;;
+	*)
+		autogen link
+	;;
+esac
+
+## ready to rumble
+echo "Run ./configure with the appropriate options, then make and enjoy."
+
+exit 0
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150426/2f3baaa1/attachment.html>


More information about the macports-changes mailing list