From dffad489c10cf5b7f8648e5c4f6ddf308269d0c3 Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Tue, 10 Oct 2023 18:34:30 +0300 Subject: [PATCH] r-hibag: use metadata checks --- BioArchLinux/r-hibag/PKGBUILD | 37 ++++++++++++++++++++------------- BioArchLinux/r-hibag/lilac.py | 14 ++++++++----- BioArchLinux/r-hibag/lilac.yaml | 16 +++++++++----- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/BioArchLinux/r-hibag/PKGBUILD b/BioArchLinux/r-hibag/PKGBUILD index 678529c0e7..1f74c54bbe 100644 --- a/BioArchLinux/r-hibag/PKGBUILD +++ b/BioArchLinux/r-hibag/PKGBUILD @@ -1,41 +1,50 @@ -# system requirements: C++11, GNU make -# Maintainer: Guoyi Zhang +# Maintainer: Pekka Ristola +# Contributor: Guoyi Zhang _pkgname=HIBAG _pkgver=1.36.4 pkgname=r-${_pkgname,,} -pkgver=1.36.4 +pkgver=${_pkgver//-/.} pkgrel=1 -pkgdesc='HLA Genotype Imputation with Attribute Bagging' -arch=('x86_64') +pkgdesc="HLA Genotype Imputation with Attribute Bagging" +arch=(x86_64) url="https://bioconductor.org/packages/${_pkgname}" -license=('GPL') +license=(GPL3) depends=( - r r-rcppparallel - gcc - make +) +checkdepends=( + r-gdsfmt + r-ggplot2 + r-reshape2 + r-snprelate ) optdepends=( r-gdsfmt r-ggplot2 r-knitr r-markdown - r-parallel r-reshape2 r-rmarkdown + r-rsamtools r-seqarray r-snprelate ) source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz") +md5sums=('db885989e0e66d6ddad9fa71425a34d2') sha256sums=('8a5c38950418db1cd6ab9c017d4c7c715b31b4b94d878d17bd6219934e3b93b1') build() { - R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" + mkdir -p build + R CMD INSTALL "$_pkgname" -l build +} + +check() { + cd "$_pkgname/tests" + R_LIBS="$srcdir/build" Rscript --vanilla runTests.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-hibag/lilac.py b/BioArchLinux/r-hibag/lilac.py index bd219c037c..2bb127545f 100644 --- a/BioArchLinux/r-hibag/lilac.py +++ b/BioArchLinux/r-hibag/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 = "C++11, GNU make", + ) def post_build(): git_pkgbuild_commit() diff --git a/BioArchLinux/r-hibag/lilac.yaml b/BioArchLinux/r-hibag/lilac.yaml index 91b60b8d72..2fc6ae6694 100644 --- a/BioArchLinux/r-hibag/lilac.yaml +++ b/BioArchLinux/r-hibag/lilac.yaml @@ -1,11 +1,17 @@ build_prefix: extra-x86_64 maintainers: -- github: starsareintherose - email: kuoi@bioarchlinux.org +- github: pekkarr + email: pekkarr@protonmail.com repo_depends: - r-rcppparallel +repo_makedepends: +- r-gdsfmt +- r-ggplot2 +- r-reshape2 +- r-snprelate update_on: -- regex: HIBAG_([\d._-]+).tar.gz - source: regex - url: https://bioconductor.org/packages/HIBAG +- source: rpkgs + pkgname: HIBAG + repo: bioc + md5: true - alias: r