r-fastmap: use metadata checks

This commit is contained in:
Pekka Ristola 2023-06-11 15:36:38 +03:00
parent c0303c253a
commit 54ed9dc084
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
4 changed files with 63 additions and 22 deletions

View file

@ -1,30 +1,54 @@
# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: Guoyi Zhang <guoyizhang at malacology dot net>
# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com
_pkgname=fastmap
_pkgver=1.1.1
pkgname=r-${_pkgname,,}
pkgver=1.1.1
pkgver=${_pkgver//[:-]/.}
pkgrel=3
pkgdesc='Fast Data Structures'
arch=('x86_64')
pkgdesc="Fast Data Structures"
arch=(x86_64)
url="https://cran.r-project.org/package=${_pkgname}"
license=('MIT')
license=(MIT)
depends=(
r
)
makedepends=(
hopscotch-map
)
checkdepends=(
r-testthat
)
optdepends=(
r-testthat
)
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('3623809dd016ae8abd235200ba7834effc4b916915a059deb76044137c5c7173')
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz"
"system-hopscotch-map.patch")
md5sums=('57a70be74ce88c5dc7e97c5547526f9f'
'bb23578b236de5d3de6a2fd2505814ba')
sha256sums=('3623809dd016ae8abd235200ba7834effc4b916915a059deb76044137c5c7173'
'a189963fc1d1c913df21bc02d0ba17678965d628775c03d39c2ffb6d4624680d')
prepare() {
# Use system hopscotch_map
patch -Np1 -i system-hopscotch-map.patch
}
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" 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 -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:

View file

@ -1,12 +1,14 @@
#!/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()
update_aur_repo()

View file

@ -1,9 +1,15 @@
build_prefix: extra-x86_64
maintainers:
- github: starsareintherose
email: kuoi@bioarchlinux.org
- github: pekkarr
email: pekkarr@protonmail.com
repo_makedepends:
- hopscotch-map
- r-testthat
update_on:
- regex: fastmap_([\d._-]+).tar.gz
source: regex
url: https://cran.r-project.org/package=fastmap
- source: rpkgs
pkgname: fastmap
repo: cran
md5: true
- alias: r
update_on_build:
- pkgbase: hopscotch-map

View file

@ -0,0 +1,9 @@
diff --git a/fastmap/src/Makevars b/fastmap/src/Makevars
index bed55df..31d7752 100644
--- a/fastmap/src/Makevars
+++ b/fastmap/src/Makevars
@@ -1,4 +1,3 @@
# Require Rf_ prefix for R's functions, to avoid clashes.
PKG_CXXFLAGS=-DR_NO_REMAP
-PKG_CPPFLAGS=-Ilib/