Package Details: madagascar 4.0.1-2

Git Clone URL: https://aur.archlinux.org/madagascar.git (read-only, click to copy)
Package Base: madagascar
Description: Multidimensional data analysis and reproducible computational experiments.
Upstream URL: https://www.reproducibility.org/wiki/Main_Page
Keywords: analysis computational data experiments geo geology geophysical multidimensional reproducible
Licenses: GPL2
Submitter: PrinceMachiavell
Maintainer: Mr.Smith1974 (kelen)
Last Packager: kelen
Votes: 2
Popularity: 0.001114
First Submitted: 2019-11-13 19:13 (UTC)
Last Updated: 2023-11-13 12:23 (UTC)

Latest Comments

kelen commented on 2023-11-10 07:11 (UTC)

Thanks for your comments. I am learning how to build a package that meets standards. The community commit and archwiki helped me a lot.

Mr.Smith1974 commented on 2023-11-10 06:35 (UTC)

@kelen

Please don't forget to add before build().This should be used wherever you use the git version.

pkgver() {
    cd ${_pkgname}
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

kelen commented on 2023-11-10 06:16 (UTC)

I want to name this package madagascar-git because I repackaged madagascar with the version number. Also I tweaked the script and packaged it to /opt because it has close to 2000 bin.

If you don't mind, here is my git PKGBUILD

# Contributor: anon at sansorgan.es

pkgname=madagascar-git
pkgver=r15659.d72996857
pkgrel=1
pkgdesc="Multidimensional data analysis and reproducible computational experiments."
url="https://www.reproducibility.org/wiki/Main_Page"
license=('GPL2')
arch=('i686' 'x86_64')
depends=('libtirpc' 'ffmpeg' 'libxaw' 'cairo' 'fftw' 'netpbm' 'gd' 'swig' 'python'
     'openmpi' 'glu' 'freeglut' 'suitesparse') 
optdepends=('cuda: for nvcc, but not compatible with cuda12' 'plplot: scientific plot')
options=('strip')
source=(madagascar::git+https://github.com/ahay/src)
md5sums=('SKIP')

build() {
  mkdir -p ${srcdir}/${pkgname}
  cd ${srcdir}/${pkgname}
  export RSFROOT=${pkgdir}/opt/${pkgname}

  # fix paths for tirpc in framework/configure.py
  sed -i '430,433c\
    (plat['\''distro'\''\] == '\''centos'\'' and int(plat['\''version'\''\][0]) >= 8) or \\\
    plat['\''distro'\''\] == '\''fedora'\'' or \\\
    plat['\''distro'\''\] == '\''arch'\'' or \\\
    (plat['\''distro'\''\] == '\''ubuntu'\'' and int(plat['\''version'\''\][:2]) >= 20): \ \
        context.env['\''CPPPATH'\''\] = path_get(context,'\''CPPPATH'\'','\''/usr/include/tirpc'\'')' framework/configure.py
  ./configure
  make
}

package() {
    export RSFROOT=${pkgdir}/opt/${pkgname}
    mkdir -p ${RSFROOT}/bin/
    export PATH=${RSFROOT}/bin:$PATH
    cd ${srcdir}/${pkgname}
    make install

    cp -r ${srcdir}/${pkgname} ${pkgdir}/opt/${pkgname}/src

    # add a symlink to rsfcodes in /opt, so that it can be compiled by user
    ln -s ${srcdir}/${pkgname} ${pkgdir}/opt/${pkgname}/rsfcodes
    chmod 755 ${pkgdir}/opt/${pkgname}/rsfcodes

    # fix paths in in files
    arr[0]="/share/madagascar/etc/config.py"
    arr[1]="/share/madagascar/etc/env.sh"
    arr[2]="/share/madagascar/etc/env.csh"
    python_version=$(ls $RSFROOT/lib | grep python)
    arr[3]="/lib/${python_version}/site-packages/rsf/prog.py"
    arr[4]="/src/config.py"
    arr[5]="/src/env.sh"
    arr[6]="/src/env.csh"

    echo ${pkgdir}
    echo ${srcdir}
    for f in ${arr[@]} ; do
      sed -i "s|${pkgdir}||g" "${RSFROOT}/$f"
      sed -i "s|${srcdir}|/opt/${pkgname}/src|g" "${RSFROOT}/$f"
    done

    install install -dm755 "$pkgdir/usr/share/licenses/$pkgname" 
    install -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
    install -dm755 "$pkgdir/etc/profile.d"
    cat > "$pkgdir/etc/profile.d/${pkgname}.sh" << EOF
#!/bin/sh
source /opt/${pkgname}/src/etc/env.sh
EOF
    cat > "$pkgdir/etc/profile.d/${pkgname}.csh" << EOF
#!/bin/csh
source /opt/${pkgname}/src/etc/env.csh
EOF
    chmod 755 "$pkgdir/etc/profile.d/${pkgname}"{.sh,.csh}
}

and ahay 4.0

# Contributor: anon at sansorgan.es

pkgname=madagascar
pkgver=4.0
pkgrel=1
pkgdesc="Multidimensional data analysis and reproducible computational experiments."
url="https://www.reproducibility.org/wiki/Main_Page"
license=('GPL2')
arch=('i686' 'x86_64')
depends=('libtirpc' 'ffmpeg' 'libxaw' 'cairo' 'fftw' 'netpbm' 'gd'
     'openmpi' 'glu' 'freeglut' 'suitesparse' 'python' 'swig')
optdepends=('cuda: GPU acceleration, but not compatible with cuda 12' 'plplot: scientific plot')
makedepends=('scons')
options=('strip')
source=("$pkgname.tar.gz::https://sourceforge.net/projects/rsf/files/$pkgname/$pkgname-$pkgver/$pkgname-$pkgver.$pkgrel.tar.gz/download")
md5sums=('SKIP')
noextract=("$pkgname.tar.gz")

prepare() {
    cd "$srcdir"
    mkdir -p ${srcdir}/${pkgname}
    bsdtar -xf $pkgname.tar.gz --strip-components=1 -C ${srcdir}/${pkgname}
}

build() {
  mkdir -p ${srcdir}/${pkgname}
  cd ${srcdir}/${pkgname}
  export RSFROOT=${pkgdir}/opt/${pkgname}

  # fix paths for tirpc in framework/configure.py
  sed -i '430,433c\
    (plat['\''distro'\''\] == '\''centos'\'' and int(plat['\''version'\''\][0]) >= 8) or \\\
    plat['\''distro'\''\] == '\''fedora'\'' or \\\
    plat['\''distro'\''\] == '\''arch'\'' or \\\
    (plat['\''distro'\''\] == '\''ubuntu'\'' and int(plat['\''version'\''\][:2]) >= 20): \ \
        context.env['\''CPPPATH'\''\] = path_get(context,'\''CPPPATH'\'','\''/usr/include/tirpc'\'')' framework/configure.py
    # export LINKFLAGS="-llapack -lblas -ltirpc -pthread -fopenmp"
  ./configure
    # sed -i "s/^LINKFLAGS.*/LINKFLAGS = ['-llapack', '-lblas', '-pthread', '-fopenmp', '-ltirpc']/g" config.py
    # make "${MAKEFLAGS}"
  make 
}

package() {

    export RSFROOT=${pkgdir}/opt/${pkgname}
    mkdir -p ${RSFROOT}/bin/
    export PATH=${RSFROOT}/bin:$PATH
    cd ${srcdir}/${pkgname}
    make install

    cp -r ${srcdir}/${pkgname} ${pkgdir}/opt/${pkgname}/src

    # add a symlink to rsfcodes in /opt, so that it can be compiled by user
    ln -s ${srcdir}/${pkgname} ${pkgdir}/opt/${pkgname}/rsfcodes
    chmod 755 ${pkgdir}/opt/${pkgname}/rsfcodes

    # fix paths in in files
    arr[0]="/share/madagascar/etc/config.py"
    arr[1]="/share/madagascar/etc/env.sh"
    arr[2]="/share/madagascar/etc/env.csh"
    python_version=$(ls $RSFROOT/lib | grep python)
    arr[3]="/lib/${python_version}/site-packages/rsf/prog.py"
    arr[4]="/src/config.py"
    arr[5]="/src/env.sh"
    arr[6]="/src/env.csh"

    echo ${pkgdir}
    echo ${srcdir}
    for f in ${arr[@]} ; do
      sed -i "s|${pkgdir}||g" "${RSFROOT}/$f"
      sed -i "s|${srcdir}|/opt/${pkgname}/src|g" "${RSFROOT}/$f"
    done

    install install -dm755 "$pkgdir/usr/share/licenses/$pkgname" 
    install -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
    install -dm755 "$pkgdir/etc/profile.d"
    cat > "$pkgdir/etc/profile.d/${pkgname}.sh" << EOF
#!/bin/sh
source /opt/${pkgname}/src/etc/env.sh
EOF
    cat > "$pkgdir/etc/profile.d/${pkgname}.csh" << EOF
#!/bin/csh
source /opt/${pkgname}/src/etc/env.csh
EOF
    chmod 755 "$pkgdir/etc/profile.d/${pkgname}"{.sh,.csh}
}

Aleksandr commented on 2020-05-02 09:45 (UTC)

It is not working. I cannot install on my manjaro kde(