r-lpsymphony: fix depends, use metadata checks

This commit is contained in:
Pekka Ristola 2023-06-15 20:56:45 +03:00
parent 4d4bc50a4a
commit 0182409f7f
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
5 changed files with 61 additions and 35 deletions

View file

@ -1,49 +1,50 @@
# system requirements: GNU make
# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: Guoyi Zhang <guoyizhang at malacology dot net>
_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:

View file

@ -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()

View file

@ -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

View file

@ -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"

View file

@ -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",