tUpdate - petsc-git-PKGBUILD - build template for non-complex PETSC with petsc4py
 (HTM) git clone git://src.adamsgaard.dk/petsc-git-PKGBUILD
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 483c0558a92ca886d9cbaec70948f088f8563101
 (DIR) parent cafb49e666e6c55f288cd469460186b0f99e52e1
 (HTM) Author: Lucas Heitzmann Gabrielli <heitzmann@gmail.com>
       Date:   Tue, 18 May 2021 17:57:48 -0300
       
       Update
       
       Diffstat:
         M .SRCINFO                            |       4 +---
         M PKGBUILD                            |      52 +++++++++----------------------
         D petsc4py.patch                      |      11 -----------
       
       3 files changed, 15 insertions(+), 52 deletions(-)
       ---
 (DIR) diff --git a/.SRCINFO b/.SRCINFO
       t@@ -1,6 +1,6 @@
        pkgbase = petsc-git
                pkgdesc = Portable, extensible toolkit for scientific computation (external downloads enabled)
       -        pkgver = 20210204
       +        pkgver = 20210515
                pkgrel = 1
                url = https://gitlab.com/petsc/petsc
                install = petsc.install
       t@@ -35,9 +35,7 @@ pkgbase = petsc-git
                provides = petsc
                conflicts = petsc
                source = petsc::git+https://gitlab.com/petsc/petsc.git#branch=release
       -        source = petsc4py.patch
                sha256sums = SKIP
       -        sha256sums = b0f4a9d33e9c3ba3f51b81808f04ec66091b0a29cf99cac6392e97232edec768
        
        pkgname = petsc-git
        
 (DIR) diff --git a/PKGBUILD b/PKGBUILD
       t@@ -1,7 +1,7 @@
        # Maintainer: Lucas H. Gabrielli <heitzmann@gmail.com>
        
        pkgname=petsc-git
       -pkgver=20210204
       +pkgver=20210515
        pkgrel=1
        _config=linux-c-opt
        pkgdesc="Portable, extensible toolkit for scientific computation (external downloads enabled)"
       t@@ -19,10 +19,8 @@ optdepends=("opencl: GPU computing"
                    "libyaml: YAML configuration support"
                    "libx11: GUI tools")
        install=petsc.install
       -source=(petsc::git+https://gitlab.com/petsc/petsc.git#branch=release
       -        petsc4py.patch)
       -sha256sums=('SKIP'
       -            'b0f4a9d33e9c3ba3f51b81808f04ec66091b0a29cf99cac6392e97232edec768')
       +source=(petsc::git+https://gitlab.com/petsc/petsc.git#branch=release)
       +sha256sums=('SKIP')
        
        _petsc_arch="arch-${_config}"
        _petsc_dir='/usr/local/petsc'
       t@@ -52,7 +50,6 @@ pkgver() {
        prepare() {
            cd "${srcdir}/petsc"
            sed -i 's-\(self.publicInstall[^=]*=[[:space:]]\)[^#]*-\10 -g' config/BuildSystem/config/package.py
       -    patch -p1 < ../petsc4py.patch
        }
        
        
       t@@ -96,7 +93,6 @@ build() {
              --download-mumps=1
              --download-scalapack=1
              --download-hypre=1
       -      --download-petsc4py=1
            )
        
            CONFOPTS=( "${CONFOPTS[@]}" )
       t@@ -135,10 +131,10 @@ build() {
            export PETSC_ARCH="${_petsc_arch}"
        
            python ./configure LDFLAGS="$LDFLAGS" \
       -           --prefix="${_petsc_dir}/${_config}" \
       +           --prefix="${_install_dir}" \
                   --MAKEFLAGS="$MAKEFLAGS" \
                   $(for (( i=1; i<=${#CONFOPTS[@]}; i++)); do echo "${CONFOPTS[$i]}"; done)
       -    make clean
       +
            make all
        }
        
       t@@ -152,19 +148,24 @@ package() {
        
            make DESTDIR="${pkgdir}" install
        
       -    # Fix petsc4py runpath
       -    chrpath -r "${_install_dir}/lib:/usr/lib/openmpi" ${_build_dir}/${_petsc_arch}/lib/petsc4py/lib/${_petsc_arch}/PETSc.cpython-39-x86_64-linux-gnu.so
       +    # petsc4py
       +    pushd ${_build_dir}/src/binding/petsc4py
       +    CFLAGS="$(echo "${CFLAGS}" | sed 's%-D[^[:space:]]*%%g')" python setup.py install --root="${pkgdir}"
       +    popd
        
            # install license
            install -Dm 644 ${_build_dir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
        
            mkdir -p "${pkgdir}/etc/profile.d"
       -    echo "export PETSC_DIR=${_install_dir}" > "${pkgdir}/etc/profile.d/petsc.sh"
       +    printf "export PETSC_DIR=${_install_dir}" > "${pkgdir}/etc/profile.d/petsc.sh"
            chmod +x "${pkgdir}/etc/profile.d/petsc.sh"
        
            # show where the shared libraries are
            install -dm 755 "${pkgdir}/etc/ld.so.conf.d/"
       -    echo "${_install_dir}/lib" > "${pkgdir}/etc/ld.so.conf.d/petsc.conf"
       +    printf "${_install_dir}/lib" > "${pkgdir}/etc/ld.so.conf.d/petsc.conf"
       +
       +    printf "PETSC_DIR  = ${_petsc_dir}\nPETSC_ARCH = ${_petsc_arch}" \
       +        > "${pkgdir}/usr/lib/python3.9/site-packages/petsc4py/lib/petsc.cfg"
        
            _rem_dir="${_build_dir}/${_petsc_arch}"
        
       t@@ -175,29 +176,4 @@ package() {
            sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/petsc/conf/pkg.conf.hypre"
            sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/petsc/conf/petscvariables"
            sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/petsc/conf/petscrules"
       -    sed -i "s#${_build_dir}#${_petsc_dir}#g" "${_rem_dir}/lib/petsc4py/lib/petsc.cfg"
       -
       -    # install petsc4py
       -    _python_package="${pkgdir}/usr/lib/python3.9/site-packages"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/PKG-INFO"                          "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/PKG-INFO"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/SOURCES.txt"                       "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/SOURCES.txt"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/dependency_links.txt"              "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/dependency_links.txt"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/not-zip-safe"                      "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/not-zip-safe"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/requires.txt"                      "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/requires.txt"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/top_level.txt"                     "${_python_package}/petsc4py-3.14.1-py3.9.egg-info/top_level.txt"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/__init__.py"                                             "${_python_package}/petsc4py/__init__.py"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/__main__.py"                                             "${_python_package}/petsc4py/__main__.py"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.pxd"                                               "${_python_package}/petsc4py/PETSc.pxd"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.py"                                                "${_python_package}/petsc4py/PETSc.py"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pxd"                           "${_python_package}/petsc4py/include/petsc4py/__init__.pxd"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pyx"                           "${_python_package}/petsc4py/include/petsc4py/__init__.pyx"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/numpy.h"                                "${_python_package}/petsc4py/include/petsc4py/numpy.h"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.h"                             "${_python_package}/petsc4py/include/petsc4py/petsc4py.h"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.i"                             "${_python_package}/petsc4py/include/petsc4py/petsc4py.i"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc_api.h"                   "${_python_package}/petsc4py/include/petsc4py/petsc4py.PETSc_api.h"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc.h"                       "${_python_package}/petsc4py/include/petsc4py/petsc4py.PETSc.h"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/PETSc.pxd"                              "${_python_package}/petsc4py/include/petsc4py/PETSc.pxd"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/__init__.py"                                         "${_python_package}/petsc4py/lib/__init__.py"
       -    install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/petsc.cfg"                                           "${_python_package}/petsc4py/lib/petsc.cfg"
       -    install -Dm 755 "${_rem_dir}/lib/petsc4py/lib/${_petsc_arch}/PETSc.cpython-39-x86_64-linux-gnu.so" "${_python_package}/petsc4py/lib/PETSc.cpython-39-x86_64-linux-gnu.so"
        }
 (DIR) diff --git a/petsc4py.patch b/petsc4py.patch
       t@@ -1,11 +0,0 @@
       ---- a/config/BuildSystem/config/packages/petsc4py.py
       -+++ b/config/BuildSystem/config/packages/petsc4py.py
       -@@ -46,7 +46,7 @@
       - 
       -     # if installing prefix location then need to set new value for PETSC_DIR/PETSC_ARCH
       -     if self.argDB['prefix'] and not 'package-prefix-hash' in self.argDB:
       --       newdir = 'PETSC_DIR='+os.path.abspath(os.path.expanduser(self.argDB['prefix']))+' '+'PETSC_ARCH= MPICC=${PCC} '
       -+       newdir = 'MPICC=${PCC} '
       -     else:
       -        newdir = 'MPICC=${PCC} '
       -