forked from pool/petsc
* Changes PETSC_ARCH definition to %_arch instead of linux-gnu-c-opt; this is in line with upstream's recommendation and what Fedora does and should be ok for openSUSE not that we no longer use hpc macros.
* Modify petsc-fix-libdir.patch to use sysconfig.get_config_vars('platlibdir') instead of sys.platlibdir for compatibility with python 3.6 (fix FTBFS on 15.6 and older).
* Actually bail out before running make when configuring fails.
OBS-URL: https://build.opensuse.org/package/show/science/petsc?expand=0&rev=147
87 lines
3.9 KiB
Diff
87 lines
3.9 KiB
Diff
From 4be95fa6ec208e7ffe3ca7adbec4e148238c19e1 Mon Sep 17 00:00:00 2001
|
|
From: Atri Bhattacharya <badshah400@gmail.org>
|
|
Date: Wed, 2 Apr 2025 00:51:53 +0530
|
|
Subject: [PATCH] libdir
|
|
|
|
---
|
|
config/PETSc/Configure.py | 6 ++++--
|
|
config/install.py | 14 ++++++++------
|
|
2 files changed, 12 insertions(+), 8 deletions(-)
|
|
|
|
Index: petsc-3.23.0/config/PETSc/Configure.py
|
|
===================================================================
|
|
--- petsc-3.23.0.orig/config/PETSc/Configure.py
|
|
+++ petsc-3.23.0/config/PETSc/Configure.py
|
|
@@ -2,9 +2,12 @@ import config.base
|
|
|
|
import os
|
|
import sys
|
|
+import sysconfig
|
|
import re
|
|
import pickle
|
|
|
|
+LIB = sysconfig.get_config_var('platlibdir') or 'lib'
|
|
+
|
|
class Configure(config.base.Configure):
|
|
def __init__(self, framework):
|
|
config.base.Configure.__init__(self, framework)
|
|
@@ -173,7 +176,7 @@ class Configure(config.base.Configure):
|
|
cflags_inc.append('-I' + os.path.join(self.petscdir.dir, 'include'))
|
|
fd.write('exec_prefix=${prefix}\n')
|
|
fd.write('includedir=${prefix}/include\n')
|
|
- fd.write('libdir=${prefix}/lib\n')
|
|
+ fd.write('libdir={:s}/{:s}\n'.format('${prefix}', LIB))
|
|
|
|
with self.setCompilers.Language('C'):
|
|
fd.write('ccompiler='+self.setCompilers.getCompiler()+'\n')
|
|
@@ -449,7 +452,7 @@ prepend-path PATH "%s"
|
|
self.addMakeMacro('PETSC_FC_INCLUDES',self.headers.toStringNoDupes(allincludes,modinc(allincludes)))
|
|
self.addMakeMacro('PETSC_FC_INCLUDES_INSTALL',self.headers.toStringNoDupes(allincludes_install,modinc(allincludes_install)))
|
|
|
|
- LIB_DIR = os.path.join(self.installdir.dir,'lib')
|
|
+ LIB_DIR = os.path.join(self.installdir.dir,LIB)
|
|
self.addDefine('LIB_DIR','"'+LIB_DIR+'"')
|
|
# Use build dir here for 'make check' to work before 'make install'
|
|
PREINSTALL_LIB_DIR = os.path.join(self.petscdir.dir,self.arch.arch,'lib')
|
|
Index: petsc-3.23.0/config/install.py
|
|
===================================================================
|
|
--- petsc-3.23.0.orig/config/install.py
|
|
+++ petsc-3.23.0/config/install.py
|
|
@@ -1,6 +1,8 @@
|
|
#!/usr/bin/env python3
|
|
from __future__ import print_function
|
|
-import os, re, shutil, sys
|
|
+import os, re, shutil, sys, sysconfig
|
|
+
|
|
+LIB = sysconfig.get_config_var('platlibdir') or 'lib'
|
|
|
|
if 'PETSC_DIR' in os.environ:
|
|
PETSC_DIR = os.environ['PETSC_DIR']
|
|
@@ -77,12 +79,12 @@ class Installer(script.Script):
|
|
self.archBinDir = os.path.join(self.rootDir, self.arch, 'bin')
|
|
self.archLibDir = os.path.join(self.rootDir, self.arch, 'lib')
|
|
self.destIncludeDir = os.path.join(self.destDir, 'include')
|
|
- self.destConfDir = os.path.join(self.destDir, 'lib','petsc','conf')
|
|
- self.destLibDir = os.path.join(self.destDir, 'lib')
|
|
- self.destBinDir = os.path.join(self.destDir, 'lib','petsc','bin')
|
|
+ self.destConfDir = os.path.join(self.destDir, LIB,'petsc','conf')
|
|
+ self.destLibDir = os.path.join(self.destDir, LIB)
|
|
+ self.destBinDir = os.path.join(self.destDir, LIB,'petsc','bin')
|
|
self.installIncludeDir = os.path.join(self.installDir, 'include')
|
|
- self.installLibDir = os.path.join(self.installDir, 'lib')
|
|
- self.installBinDir = os.path.join(self.installDir, 'lib','petsc','bin')
|
|
+ self.installLibDir = os.path.join(self.installDir, LIB)
|
|
+ self.installBinDir = os.path.join(self.installDir, LIB,'petsc','bin')
|
|
self.rootShareDir = os.path.join(self.rootDir, 'share')
|
|
self.destShareDir = os.path.join(self.destDir, 'share')
|
|
self.rootSrcDir = os.path.join(self.rootDir, 'src')
|
|
@@ -344,7 +346,7 @@ class Installer(script.Script):
|
|
return glob.glob(os.path.join(dirname, *patterns))
|
|
def shell(*args):
|
|
return self.executeShellCommand(' '.join(args))[0]
|
|
- libdir = os.path.join(self.installDir, 'lib')
|
|
+ libdir = os.path.join(self.installDir, LIB)
|
|
if sys.platform == 'linux':
|
|
libraries = [
|
|
lib for lib in lsdir(self.destLibDir, 'lib*.so*')
|