diff --git a/BioArchLinux/r-lpsymphony/PKGBUILD b/BioArchLinux/r-lpsymphony/PKGBUILD index 7c06e6fe6e..75f2020fcb 100644 --- a/BioArchLinux/r-lpsymphony/PKGBUILD +++ b/BioArchLinux/r-lpsymphony/PKGBUILD @@ -1,49 +1,50 @@ -# system requirements: GNU make -# Maintainer: Guoyi Zhang +# Maintainer: Pekka Ristola +# Contributor: Guoyi Zhang _pkgname=lpsymphony _pkgver=1.28.1 pkgname=r-${_pkgname,,} -pkgver=1.28.1 +pkgver=${_pkgver//[:-]/.} pkgrel=0 -pkgdesc='Symphony integer linear programming solver in R' -arch=('x86_64') +pkgdesc="Symphony integer linear programming solver in R" +arch=(x86_64) url="https://bioconductor.org/packages/${_pkgname}" -license=('EPL') +license=(EPL) depends=( + coin-or-symphony r - coin-or-asl - coin-or-clp - coin-or-coinutils - coin-or-osi - coin-or-cgl - make - glpk ) -makedepends=( - gcc-fortran +checkdepends=( + r-testthat ) optdepends=( r-biocstyle r-knitr - r-slam r-testthat ) -source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz") -sha256sums=('4d46f81f6bc676167c5dbd498c8415d97434274b885f11de5d29745ce6696421') +source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz" + "system-symphony.patch") +md5sums=('a04276f8329ae09e82e3e16bc3a7b78e' + '5fe82566bce5f45a9d9d8682e51ebfaa') +sha256sums=('4d46f81f6bc676167c5dbd498c8415d97434274b885f11de5d29745ce6696421' + 'e4ffaac1444e128a63ba43d0adbd3dd8b6acac0ca5e8b2d8fe43ab3ffcb92e5a') prepare() { - sed -i 's#CXXFLAGS="-w -g -O2"#CXXFLAGS="-w -g -O2 -I/usr/include/coin"#' "${srcdir}/${_pkgname}/configure" - tar cfz "${_pkgname}.tar.gz" "${_pkgname}" + # build against system SYMPHONY + patch -Np1 -i system-symphony.patch } build() { - #R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" - R CMD INSTALL ${_pkgname}.tar.gz -l "${srcdir}" + mkdir -p build + R CMD INSTALL "$_pkgname" -l build +} + +check() { + cd "$_pkgname/tests" + R_LIBS="$srcdir/build" NOT_CRAN=true Rscript --vanilla testthat.R } package() { - install -dm0755 "${pkgdir}/usr/lib/R/library" - cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library" + install -d "$pkgdir/usr/lib/R/library" + cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library" } -# vim:set ts=2 sw=2 et: diff --git a/BioArchLinux/r-lpsymphony/lilac.py b/BioArchLinux/r-lpsymphony/lilac.py index bd219c037c..6cfc1b802b 100644 --- a/BioArchLinux/r-lpsymphony/lilac.py +++ b/BioArchLinux/r-lpsymphony/lilac.py @@ -1,12 +1,16 @@ #!/usr/bin/env python3 from lilaclib import * +import os +import sys +sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions')) +from lilac_r_utils import r_pre_build + def pre_build(): - for line in edit_file('PKGBUILD'): - if line.startswith('_pkgver='): - line = f'_pkgver={_G.newver}' - print(line) - update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.')) + r_pre_build( + _G, + expect_systemrequirements = "GNU make", + ) def post_build(): git_pkgbuild_commit() diff --git a/BioArchLinux/r-lpsymphony/lilac.yaml b/BioArchLinux/r-lpsymphony/lilac.yaml index 4b6e5aa303..ca616d704d 100644 --- a/BioArchLinux/r-lpsymphony/lilac.yaml +++ b/BioArchLinux/r-lpsymphony/lilac.yaml @@ -1,9 +1,14 @@ build_prefix: extra-x86_64 maintainers: -- github: starsareintherose - email: kuoi@bioarchlinux.org +- github: pekkarr + email: pekkarr@protonmail.com +repo_depends: +- coin-or-symphony +repo_makedepends: +- r-testthat update_on: -- regex: lpsymphony_([\d._-]+).tar.gz - source: regex - url: https://bioconductor.org/packages/lpsymphony +- source: rpkgs + pkgname: lpsymphony + repo: bioc + md5: true - alias: r diff --git a/BioArchLinux/r-lpsymphony/system-symphony.patch b/BioArchLinux/r-lpsymphony/system-symphony.patch new file mode 100644 index 0000000000..ebf38d2353 --- /dev/null +++ b/BioArchLinux/r-lpsymphony/system-symphony.patch @@ -0,0 +1,15 @@ +diff --git a/lpsymphony/configure b/lpsymphony/configure +index b3975c2..f1488ff 100755 +--- a/lpsymphony/configure ++++ b/lpsymphony/configure +@@ -9,8 +9,8 @@ fi + + R="${R_HOME}/bin/R" + +-SYMPHONY_CPPFLAGS=`pkg-config --cflags SYMPHONY >/dev/null 2>&1` +-SYMPHONY_LIBS=`pkg-config --libs SYMPHONY >/dev/null 2>&1` ++SYMPHONY_CPPFLAGS=`pkg-config --cflags symphony 2>/dev/null` ++SYMPHONY_LIBS=`pkg-config --libs symphony 2>/dev/null` + + test -z "${SYMPHONY_LIBS}" && SYMPHONY_LIBS="-lSym -lCgl -lOsiClp -lClp -lOsi -lCoinUtils" + diff --git a/lilac-extensions/lilac_r_utils.py b/lilac-extensions/lilac_r_utils.py index 49cfcbbdc3..7c74309c28 100644 --- a/lilac-extensions/lilac_r_utils.py +++ b/lilac-extensions/lilac_r_utils.py @@ -187,6 +187,7 @@ license_map = { "BSD_2_clause + file LICENSE": "BSD", "BSD_3_clause + file LICENSE": "BSD", "BSL-1.0": "Boost", + "EPL": "EPL", "GPL": "GPL", "GPL (>= 2)": "GPL", "GPL (>= 3)": "GPL3",