r-chemminer: use metadata checks

This commit is contained in:
Pekka Ristola 2023-07-22 13:03:27 +03:00
parent 6df3d43893
commit 96bda329a6
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
4 changed files with 52 additions and 28 deletions

View file

@ -1,19 +1,17 @@
# system requirements: GNU make # Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net> # Contributor: Guoyi Zhang <guoyizhang at malacology dot net>
_pkgname=ChemmineR _pkgname=ChemmineR
_pkgver=3.52.0 _pkgver=3.52.0
pkgname=r-${_pkgname,,} pkgname=r-${_pkgname,,}
pkgver=3.52.0 pkgver=${_pkgver//-/.}
pkgrel=1 pkgrel=1
pkgdesc='Cheminformatics Toolkit for R' pkgdesc="Cheminformatics Toolkit for R"
arch=('x86_64') arch=(x86_64)
url="https://bioconductor.org/packages/${_pkgname}" url="https://bioconductor.org/packages/${_pkgname}"
license=('Artistic2.0') license=(Artistic2.0)
depends=( depends=(
r
r-base64enc r-base64enc
r-bh
r-biocgenerics r-biocgenerics
r-dbi r-dbi
r-digest r-digest
@ -27,20 +25,26 @@ depends=(
r-rjson r-rjson
r-rsvg r-rsvg
r-stringi r-stringi
make )
makedepends=(
r-bh
swig
)
checkdepends=(
r-rsqlite
r-runit
r-snow
) )
optdepends=( optdepends=(
r-bibtex r-bibtex
r-biocmanager r-biocmanager
r-biocstyle r-biocstyle
r-chemminedrugs r-chemminedrugs
r-chemmineob
r-fmcsr r-fmcsr
r-gplots r-gplots
r-knitcitations r-knitcitations
r-knitr r-knitr
r-knitrbootstrap r-knitrbootstrap
r-png
r-rmarkdown r-rmarkdown
r-rpostgresql r-rpostgresql
r-rsqlite r-rsqlite
@ -48,14 +52,25 @@ optdepends=(
r-snow r-snow
) )
source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz") source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
md5sums=('54601905e8a4a48d85b3c7a80f935eb5')
sha256sums=('3d24d7b81d8d5315c53b5c04002b39d0f2b5354b992b66d73cca4ff0077e9bd4') sha256sums=('3d24d7b81d8d5315c53b5c04002b39d0f2b5354b992b66d73cca4ff0077e9bd4')
build() { build() {
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" # generate R bindings
cd "$_pkgname"
./runSwig.sh
cd ..
mkdir -p build
R CMD INSTALL "$_pkgname" -l build
}
check() {
cd "$_pkgname/tests"
R_LIBS="$srcdir/build" Rscript --vanilla runTests.R
} }
package() { package() {
install -dm0755 "${pkgdir}/usr/lib/R/library" install -d "$pkgdir/usr/lib/R/library"
cp -a --no-preserve=ownership "${_pkgname}" "${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 #!/usr/bin/env python3
from lilaclib import * 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(): def pre_build():
for line in edit_file('PKGBUILD'): r_pre_build(
if line.startswith('_pkgver='): _G,
line = f'_pkgver={_G.newver}' expect_systemrequirements = "GNU make",
print(line) )
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
def post_build(): def post_build():
git_pkgbuild_commit() git_pkgbuild_commit()

View file

@ -1,10 +1,9 @@
build_prefix: extra-x86_64 build_prefix: extra-x86_64
maintainers: maintainers:
- github: starsareintherose - github: pekkarr
email: kuoi@bioarchlinux.org email: pekkarr@protonmail.com
repo_depends: repo_depends:
- r-base64enc - r-base64enc
- r-bh
- r-biocgenerics - r-biocgenerics
- r-dbi - r-dbi
- r-digest - r-digest
@ -18,8 +17,14 @@ repo_depends:
- r-rjson - r-rjson
- r-rsvg - r-rsvg
- r-stringi - r-stringi
repo_makedepends:
- r-bh
- r-rsqlite
- r-runit
- r-snow
update_on: update_on:
- regex: ChemmineR_([\d._-]+).tar.gz - source: rpkgs
source: regex pkgname: ChemmineR
url: https://bioconductor.org/packages/ChemmineR repo: bioc
md5: true
- alias: r - alias: r

View file

@ -8,7 +8,7 @@ def r_update_pkgver_and_pkgrel(newver: str):
""" """
Update _pkgver and pkgrel used in R packages. Update _pkgver and pkgrel used in R packages.
The pkgver variable (without underscore) should be defined as `${_pkgver//[:-]/.}`. The pkgver variable (without underscore) should be defined as `${_pkgver//-/.}`.
""" """
ver_prefix = "_pkgver=" ver_prefix = "_pkgver="
rel_prefix = "pkgrel=" rel_prefix = "pkgrel="
@ -285,7 +285,7 @@ def check_optdepends(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
errors.append(f"Unnecessary optional dependency: {dep}") errors.append(f"Unnecessary optional dependency: {dep}")
for dep in desc.suggests: for dep in desc.suggests:
if (dep not in cfg.default_r_pkgs) and (dep not in pkg.optdepends): if (dep not in cfg.default_r_pkgs) and (dep not in pkg.optdepends) and (dep not in pkg.depends):
errors.append(f"Missing optional dependency: {dep}") errors.append(f"Missing optional dependency: {dep}")
if len(errors) > 0: if len(errors) > 0: