diff options
-rw-r--r-- | dist/patchtest.patch | 5 | ||||
-rw-r--r-- | dist/stdarg.patch | 13 | ||||
-rwxr-xr-x | src/build.sh | 16 |
3 files changed, 34 insertions, 0 deletions
diff --git a/dist/patchtest.patch b/dist/patchtest.patch new file mode 100644 index 0000000..2ec828b --- /dev/null +++ b/dist/patchtest.patch @@ -0,0 +1,5 @@ +diff --new-file -ru Lorene.orig/.patch_tmp Lorene/.patch_tmp +--- Lorene.orig/.patch_tmp 1969-12-31 18:00:00.000000000 -0600 ++++ Lorene/.patch_tmp 2010-06-24 19:43:15.000000000 -0500 +@@ -0,0 +1 @@ ++ diff --git a/dist/stdarg.patch b/dist/stdarg.patch new file mode 100644 index 0000000..f64eeca --- /dev/null +++ b/dist/stdarg.patch @@ -0,0 +1,13 @@ +diff -ru gsl-1.16-orig/test/results.c gsl-1.16/test/results.c +--- gsl-1.16-orig/test/results.c 2013-07-17 13:04:26.000000000 -0700 ++++ gsl-1.16/test/results.c 2015-04-28 13:24:11.901318472 -0700 +@@ -29,7 +29,7 @@ + #ifdef STDC_HEADERS + #include <stdarg.h> + #else +-#include <varargs.h> ++#include <stdarg.h> + #endif + #endif + +Only in gsl-1.16/test: results.c~ diff --git a/src/build.sh b/src/build.sh index 442cc16..26b4dd8 100755 --- a/src/build.sh +++ b/src/build.sh @@ -43,6 +43,22 @@ mkdir ${BUILD_DIR} ${INSTALL_DIR} echo "GSL: Unpacking archive..." pushd ${BUILD_DIR} ${TAR?} xzf ${SRCDIR}/../dist/${NAME}.tar.gz +pushd ${NAME} +${PATCH?} -p1 < ${SRCDIR}/../dist/stdarg.patch +# Some (ancient but still used) versions of patch don't support the +# patch format used here but also don't report an error using the exit +# code. So we use this patch to test for this +${PATCH?} -p1 < ${SRCDIR}/../dist/patchtest.patch +if [ ! -e .patch_tmp ]; then + echo 'BEGIN ERROR' + echo 'The version of patch is too old to understand this patch format.' + echo 'Please set the PATCH environment variable to a more recent ' + echo 'version of the patch command.' + echo 'END ERROR' + exit 1 +fi +rm -f .patch_tmp +popd echo "GSL: Configuring..." cd ${NAME} |