diff options
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | compile.patch | 41 | ||||
-rw-r--r-- | pythia.patch | 55 |
3 files changed, 69 insertions, 41 deletions
@@ -1,4 +1,4 @@ -# Maintainer: JP-Ellis <josh@jpellis.me> +# Maintainer: ReneganRonin <renegan.ronin@gmail.com> pkgname=madgraph-pythia8-interface pkgver=1.0 @@ -15,16 +15,16 @@ depends=( ) source=( "http://madgraph.phys.ucl.ac.be/Downloads/MG5aMC_PY8_interface/MG5aMC_PY8_interface_V${pkgver}.tar.gz" - "python2.patch" + "compile.patch" "pythia.patch" ) -sha256sums=('dd1a96f598176c3eb5f91bc189eaac1405afebf23f7fcfd055135d788dc69e3d' - '632adc73e951df4341709adeafd3a7c72da1752f8af61037eae2b87a08ca9a64' - 'e506dad2224ed639a83537b21eadeda0ee244e9b5d5ee2770e536564f1e41491') +sha256sums=('7c4aecc1e933d24629ec2723ca3d65a3619e12a9e1f9f9bc6cda6e462f4de478' + '03d4ee5104689c5ef4092bc07f834d6829b734e3d0ee1d613b1ad0048860534f' + '5ff65a3a48b403410b135f18a7edb9e48b352fd531f33bc5cf6b09522217e0b2') prepare() { - msg2 "Fixing python references for python2" - patch -p 1 < python2.patch + msg2 "Fixing compile.py" + patch -p 1 < compile.patch msg2 "Fixing Pythia location" patch -p 1 < pythia.patch diff --git a/compile.patch b/compile.patch new file mode 100644 index 000000000000..a04af1133c72 --- /dev/null +++ b/compile.patch @@ -0,0 +1,41 @@ +--- a/compile.py 2021-04-07 08:29:14.860019874 +0800 ++++ b/compile.py 2021-04-07 08:36:43.660024924 +0800 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/env python + + import subprocess + import sys +@@ -103,19 +103,19 @@ + + # Now proceed with the installation + +-if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc')): +- print( "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ +- pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc')) +- sys.exit(error_exit_code) +-shutil.copy(pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc'), +- pjoin(local_path,'Makefile.inc')) +-if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','examples','Makefile')): +- print( "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ +- pjoin(pythia8_path,'share','Pythia8','examples','Makefile')) +- sys.exit(error_exit_code) +-shutil.copy(pjoin(pythia8_path,'share','Pythia8','examples','Makefile'), +- pjoin(local_path,'Makefile')) +- ++if not os.path.exists(pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc')): ++ print "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ ++ pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc') ++ sys.exit(error_exit_code) ++shutil.copy(pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc'), ++ pjoin(local_path,'Makefile.inc')) ++if not os.path.exists(pjoin(pythia8_path,'share','pythia8','examples','Makefile')): ++ print "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ ++ pjoin(pythia8_path,'share','pythia8','examples','Makefile') ++ sys.exit(error_exit_code) ++shutil.copy(pjoin(pythia8_path,'share','pythia8','examples','Makefile'), ++ pjoin(local_path,'Makefile')) ++ + if _use_original_PY8_makefile: + shutil.move(pjoin(local_path,'MG5aMC_PY8_interface.cc'),pjoin(local_path,'main89.cc')) + p = subprocess.Popen(['make','main89'], stdout=subprocess.PIPE, diff --git a/pythia.patch b/pythia.patch index 7604319a7ce6..b5fbe8de8e50 100644 --- a/pythia.patch +++ b/pythia.patch @@ -1,47 +1,34 @@ --- a/get_pythia8_version.py +++ b/get_pythia8_version.py -@@ -29,14 +29,14 @@ +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/env python + + import sys + import os +@@ -29,17 +29,17 @@ version = None def get_version_from_xml(): - if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')): +- print( "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n '%s'\n storing the version number"% \ +- pjoin(local_path,'share','Pythia8','xmldoc','Version.xml')) +- return None + if not os.path.exists(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')): - print "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n '%s'\n storing the version number"% \ -- pjoin(local_path,'share','Pythia8','xmldoc','Version.xml') ++ print "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n '%s'\n storing the version number"% \ + pjoin(local_path,'share','pythia8','xmldoc','Version.xml') - return None ++ return None versionfinder = re.compile('^\s*\<parmfix\s*name\=\"Pythia:versionNumber\"\s*default=\"(?P<version>[\d\.]+)\"\>') - for line in open(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')): +- match = versionfinder.match(line) +- if match: +- version = match.group('version') + for line in open(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')): - match = versionfinder.match(line) - if match: - version = match.group('version') - ---- a/compile.py -+++ b/compile.py -@@ -103,17 +103,17 @@ - - # Now proceed with the installation - --if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc')): -+if not os.path.exists(pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc')): - print "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ -- pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc') -+ pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc') - sys.exit(error_exit_code) --shutil.copy(pjoin(pythia8_path,'share','Pythia8','examples','Makefile.inc'), -+shutil.copy(pjoin(pythia8_path,'share','pythia8','examples','Makefile.inc'), - pjoin(local_path,'Makefile.inc')) --if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','examples','Makefile')): -+if not os.path.exists(pjoin(pythia8_path,'share','pythia8','examples','Makefile')): - print "Error in MG5aMC_PY8_interface installer. Could not find file:\n %s"%\ -- pjoin(pythia8_path,'share','Pythia8','examples','Makefile') -+ pjoin(pythia8_path,'share','pythia8','examples','Makefile') - sys.exit(error_exit_code) --shutil.copy(pjoin(pythia8_path,'share','Pythia8','examples','Makefile'), -+shutil.copy(pjoin(pythia8_path,'share','pythia8','examples','Makefile'), - pjoin(local_path,'Makefile')) - - if _use_original_PY8_makefile: ++ match = versionfinder.match(line) ++ if match: ++ version = match.group('version') + return version + return None + |