summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorharalmha <47558670+haralmha@users.noreply.github.com>2022-05-16 10:41:21 +0200
committerGitHub <noreply@github.com>2022-05-16 10:41:21 +0200
commit77fb651e016f49a21b02dd31bd7dedbb57ebdabf (patch)
treefaf296964b40f3394299250b5a80a4477612d349
parent35ed7973e2d072628c473c9178adf45febf0adba (diff)
downloadspack-77fb651e016f49a21b02dd31bd7dedbb57ebdabf.tar.gz
spack-77fb651e016f49a21b02dd31bd7dedbb57ebdabf.tar.bz2
spack-77fb651e016f49a21b02dd31bd7dedbb57ebdabf.tar.xz
spack-77fb651e016f49a21b02dd31bd7dedbb57ebdabf.zip
frontier-client: adapt pacparser_setmyip function to new pacparser release (#29936)
-rw-r--r--var/spack/repos/builtin/packages/frontier-client/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/frontier-client/package.py b/var/spack/repos/builtin/packages/frontier-client/package.py
index 260bcdf0f4..65cfe31aad 100644
--- a/var/spack/repos/builtin/packages/frontier-client/package.py
+++ b/var/spack/repos/builtin/packages/frontier-client/package.py
@@ -26,6 +26,26 @@ class FrontierClient(MakefilePackage):
patch('frontier-client.patch', level=0)
+ # pacparser changed the function return type from void to
+ # int from v1.3.9, whereas frontier-client has not tagged
+ # any new versions in a while. Therefore, the patch below
+ # serves as a (temporary) fix. See
+ # https://github.com/spack/spack/pull/29936
+ @when('^pacparser@1.3.9:')
+ def patch(self):
+ filter_file('static void (*pp_setmyip)(const char *);',
+ 'static int (*pp_setmyip)(const char *);',
+ 'client/pacparser-dlopen.c', string=True)
+ filter_file('void pacparser_setmyip(const char *ip)',
+ 'int pacparser_setmyip(const char *ip)',
+ 'client/pacparser-dlopen.c', string=True)
+ filter_file(r' if\(\!pp_dlhandle\)\n return;',
+ r' if\(\!pp_dlhandle\)\n return 0;',
+ 'client/pacparser-dlopen.c')
+ filter_file(' (*pp_setmyip)(ip);',
+ ' return (*pp_setmyip)(ip);',
+ 'client/pacparser-dlopen.c', string=True)
+
def edit(self, spec, prefix):
makefile = FileFilter('client/Makefile')
makefile.filter('EXPAT_DIR}/lib', 'EXPAT_DIR}/lib64')