summaryrefslogtreecommitdiff
path: root/sci-physics/rivet/files/rivet-3.1.10-versions.patch
blob: 394a7dde9885e460ce296991890b4562aaf219b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- a/configure.ac	2024-11-28 14:14:00.608290493 +0100
+++ b/configure.ac	2024-11-28 14:19:41.434877928 +0100
@@ -21,9 +21,9 @@
 AC_SUBST(LT_OBJDIR)
 
 ## Compute version code
-let rivet_major=[`echo "$PACKAGE_VERSION" | cut -d. -f1 | sed -e 's/^0*//'`]
-let rivet_minor=[`echo "$PACKAGE_VERSION" | cut -d. -f2 | sed -e 's/^0*//'`]
-let rivet_micro=[`echo "$PACKAGE_VERSION" | cut -d. -f3 | sed -e 's/^0*//' | sed -e 's/[^0-9].*//g'`]
+let rivet_major=[`echo "$PACKAGE_VERSION" | cut -d. -f1 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+let rivet_minor=[`echo "$PACKAGE_VERSION" | cut -d. -f2 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+let rivet_micro=[`echo "$PACKAGE_VERSION" | cut -d. -f3 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
 let PACKAGE_VERSION_CODE=10000*$rivet_major+100*$rivet_minor+$rivet_micro
 
 ## Package-specific #defines
@@ -79,9 +79,9 @@
   AC_MSG_CHECKING([YODA version using yoda-config])
   YODA_VERSION=`$YODACONFIG --version`
   AC_MSG_RESULT([$YODA_VERSION])
-  YODA_VERSION1=[`echo $YODA_VERSION | cut -d. -f1 | sed -e 's/^0*//' | sed -e 's/\([0-9]*\).*/\1/g'`]
-  YODA_VERSION2=[`echo $YODA_VERSION | cut -d. -f2 | sed -e 's/^0*//' | sed -e 's/\([0-9]*\).*/\1/g'`]
-  YODA_VERSION3=[`echo $YODA_VERSION | cut -d. -f3 | sed -e 's/^0*//' | sed -e 's/\([0-9]*\).*/\1/g'`]
+  YODA_VERSION1=[`echo $YODA_VERSION | cut -d. -f1 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+  YODA_VERSION2=[`echo $YODA_VERSION | cut -d. -f2 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+  YODA_VERSION3=[`echo $YODA_VERSION | cut -d. -f3 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
   let YODA_VERSION_INT=YODA_VERSION1*10000+YODA_VERSION2*100+YODA_VERSION3
   if test $YODA_VERSION_INT -lt 10800; then
     AC_MSG_ERROR([YODA version isn't sufficient: at least version 1.8.0 required])
@@ -154,8 +154,8 @@
   fi
   hepmc_version=`./conftest`
   if test x$hepmc_version != x; then
-    let hepmc_major=[`echo "$hepmc_version" | cut -d. -f1 | sed -e 's/^0*//'`]
-    let hepmc_minor=[`echo "$hepmc_version" | cut -d. -f2 | sed -e 's/^0*//'`]
+    let hepmc_major=[`echo "$hepmc_version" | cut -d. -f1 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+    let hepmc_minor=[`echo "$hepmc_version" | cut -d. -f2 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
   fi
   rm -f conftest conftest.cpp conftest.cc conftest.C
   HEPMC_VERSION=$hepmc_major$hepmc_minor
@@ -184,9 +184,9 @@
   fi
   hepmc_version=`./conftest`
   if test x$hepmc_version != x; then
-    let hepmc_major=[`echo "$hepmc_version" | cut -d. -f1 | sed -e 's/^0*//'`]
-    let hepmc_minor=[`echo "$hepmc_version" | cut -d. -f2 | sed -e 's/^0*//'`]
-    let hepmc_third=[`echo "$hepmc_version" | cut -d. -f3 | sed -e 's/^0*//'`]
+    let hepmc_major=[`echo "$hepmc_version" | cut -d. -f1 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+    let hepmc_minor=[`echo "$hepmc_version" | cut -d. -f2 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
+    let hepmc_third=[`echo "$hepmc_version" | cut -d. -f3 | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/'`]
   fi
   rm -f conftest conftest.cpp conftest.cc conftest.C
   HEPMC_VERSION=$hepmc_major$hepmc_minor$hepmc_third
@@ -219,9 +219,9 @@
   AC_MSG_CHECKING([FastJet version using fastjet-config])
   fjversion=`$FJCONFIG --version`
   AC_MSG_RESULT([$fjversion])
-  fjmajor=$(echo $fjversion | cut -f1 -d.)
-  fjminor=$(echo $fjversion | cut -f2 -d.)
-  fjmicro=$(echo $fjversion | cut -f3 -d.)
+  fjmajor=$(echo $fjversion | cut -f1 -d. | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/')
+  fjminor=$(echo $fjversion | cut -f2 -d. | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/')
+  fjmicro=$(echo $fjversion | cut -f3 -d. | sed -e 's/^0*//;s/\([0-9]*\).*/\1/g;s/^$/0/')
   if test "$fjmajor" -lt 3 -o "$fjminor" -lt 2 ; then  #< only works for v3.x
     AC_MSG_ERROR([FastJet version 3.2.0 or later is required])
   fi