From 77fb651e016f49a21b02dd31bd7dedbb57ebdabf Mon Sep 17 00:00:00 2001 From: haralmha <47558670+haralmha@users.noreply.github.com> Date: Mon, 16 May 2022 10:41:21 +0200 Subject: frontier-client: adapt pacparser_setmyip function to new pacparser release (#29936) --- .../builtin/packages/frontier-client/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'var') 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') -- cgit v1.2.3-70-g09d2