From 843c99492a69683e7d2a2afb941c8eba1725cd14 Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Fri, 8 Mar 2024 20:58:05 +0200 Subject: [PATCH] r-float: use metadata checks --- BioArchLinux/r-coop/lilac.py | 5 +---- BioArchLinux/r-float/PKGBUILD | 27 ++++++++++++++++----------- BioArchLinux/r-float/lilac.py | 11 ++++++----- BioArchLinux/r-float/lilac.yaml | 15 ++++++++++++--- lilac-extensions/lilac_r_utils.py | 1 + 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/BioArchLinux/r-coop/lilac.py b/BioArchLinux/r-coop/lilac.py index 44c695b3d6..b5cdb057c5 100644 --- a/BioArchLinux/r-coop/lilac.py +++ b/BioArchLinux/r-coop/lilac.py @@ -7,10 +7,7 @@ sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions')) from lilac_r_utils import r_pre_build def pre_build(): - r_pre_build( - _G, - expect_license = "BSD 2-clause License + file LICENSE", - ) + r_pre_build(_G) def post_build(): git_pkgbuild_commit() diff --git a/BioArchLinux/r-float/PKGBUILD b/BioArchLinux/r-float/PKGBUILD index 445cd0300a..b447dd9f25 100644 --- a/BioArchLinux/r-float/PKGBUILD +++ b/BioArchLinux/r-float/PKGBUILD @@ -3,28 +3,33 @@ _pkgname=float _pkgver=0.3-2 pkgname=r-${_pkgname,,} -pkgver=0.3.2 +pkgver=${_pkgver//-/.} pkgrel=1 -pkgdesc='32-Bit Floats' -arch=('x86_64') -url="https://cran.r-project.org/package=${_pkgname}" -license=('BSD') +pkgdesc="32-Bit Floats" +arch=(x86_64) +url="https://cran.r-project.org/package=$_pkgname" +license=('BSD-2-Clause') depends=( + blas + lapack r ) makedepends=( gcc-fortran ) source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz") -sha256sums=('233a0dd71f02491ce410c173fd3c3a503b3b49a6a5fe092dde61710db2732a91') +md5sums=('5bd17f68abd9d11360b64c21c54816e8') +b2sums=('4abdbfd3c9988ad34d71800dbb9afdc412608c6651362591f8876bf3fcbe543035c0524534613fa5178491c042f244da4aab5bb8a25a8d6bc9d0fdcb6fc0a566') build() { - R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" + mkdir build + R CMD INSTALL -l build "$_pkgname" } package() { - install -dm0755 "${pkgdir}/usr/lib/R/library" - cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library" - install -Dm644 "${_pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" + install -d "$pkgdir/usr/lib/R/library" + cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library" + + install -d "$pkgdir/usr/share/licenses/$pkgname" + ln -s "/usr/lib/R/library/$_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" } -# vim:set ts=2 sw=2 et: diff --git a/BioArchLinux/r-float/lilac.py b/BioArchLinux/r-float/lilac.py index bd219c037c..b5cdb057c5 100644 --- a/BioArchLinux/r-float/lilac.py +++ b/BioArchLinux/r-float/lilac.py @@ -1,12 +1,13 @@ #!/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) def post_build(): git_pkgbuild_commit() diff --git a/BioArchLinux/r-float/lilac.yaml b/BioArchLinux/r-float/lilac.yaml index 05c5003139..9479154cc7 100644 --- a/BioArchLinux/r-float/lilac.yaml +++ b/BioArchLinux/r-float/lilac.yaml @@ -3,7 +3,16 @@ maintainers: - github: starsareintherose email: kuoi@bioarchlinux.org update_on: -- regex: float_([\d._-]+).tar.gz - source: regex - url: https://cran.r-project.org/package=float +- source: rpkgs + pkgname: float + repo: cran + md5: true - alias: r +- source: alpmfiles + pkgname: blas + filename: usr/lib/libblas\.so\.([^.]+) + repo: extra +- source: alpmfiles + pkgname: lapack + filename: usr/lib/liblapack\.so\.([^.]+) + repo: extra diff --git a/lilac-extensions/lilac_r_utils.py b/lilac-extensions/lilac_r_utils.py index 133a1d4c69..ababad97f9 100644 --- a/lilac-extensions/lilac_r_utils.py +++ b/lilac-extensions/lilac_r_utils.py @@ -193,6 +193,7 @@ license_map = { "Apache License 2.0": "Apache-2.0", "Artistic-1.0": "Artistic-1.0-Perl", "Artistic-2.0": "Artistic-2.0", + "BSD 2-clause License + file LICENSE": "BSD-2-Clause", "BSD_2_clause + file LICENSE": "BSD-2-Clause", "BSD_3_clause + file LICENSE": "BSD-3-Clause", "BSL-1.0": "BSL-1.0",