mirror of
https://github.com/BioArchLinux/Packages.git
synced 2025-03-10 12:02:42 +00:00
r-mvnormtest: use metadata checks
Also add support for DESCRIPTION file not having a `NeedsCompilation` value at all. In this case, the `expect_needscompilation` argument for `r_pre_build` should be set to "" (empty string).
This commit is contained in:
parent
d7f79a450d
commit
a121503934
4 changed files with 36 additions and 21 deletions
|
@ -1,26 +1,28 @@
|
||||||
# Maintainer: Kiri <kiri@vern.cc>
|
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
|
||||||
|
# Contributor: Kiri <kiri@vern.cc>
|
||||||
|
|
||||||
_pkgname=mvnormtest
|
_pkgname=mvnormtest
|
||||||
_pkgver=0.1-9
|
_pkgver=0.1-9
|
||||||
pkgname=r-${_pkgname,,}
|
pkgname=r-${_pkgname,,}
|
||||||
pkgver=${_pkgver//[:-]/.}
|
pkgver=${_pkgver//-/.}
|
||||||
pkgrel=2
|
pkgrel=2
|
||||||
pkgdesc='Normality test for multivariate variables'
|
pkgdesc="Normality test for multivariate variables"
|
||||||
arch=('any')
|
arch=(any)
|
||||||
url="https://cran.r-project.org/package=${_pkgname}"
|
url="https://cran.r-project.org/package=${_pkgname}"
|
||||||
license=('GPL')
|
license=(GPL)
|
||||||
depends=(
|
depends=(
|
||||||
r
|
r
|
||||||
)
|
)
|
||||||
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
|
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
|
||||||
|
md5sums=('e5960fbfc0e69797eec01c16fe74ecb7')
|
||||||
sha256sums=('46dab6eb9e7d55b8d4054d14029613b89a308259f86ddc8952b0bf752e975dc5')
|
sha256sums=('46dab6eb9e7d55b8d4054d14029613b89a308259f86ddc8952b0bf752e975dc5')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
|
mkdir -p build
|
||||||
|
R CMD INSTALL "$_pkgname" -l build
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
17
BioArchLinux/r-mvnormtest/lilac.py
Normal file
17
BioArchLinux/r-mvnormtest/lilac.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/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():
|
||||||
|
r_pre_build(
|
||||||
|
_G,
|
||||||
|
expect_needscompilation = "",
|
||||||
|
)
|
||||||
|
|
||||||
|
def post_build():
|
||||||
|
git_pkgbuild_commit()
|
||||||
|
update_aur_repo()
|
|
@ -1,16 +1,10 @@
|
||||||
build_prefix: extra-x86_64
|
build_prefix: extra-x86_64
|
||||||
maintainers:
|
maintainers:
|
||||||
- github: kiri2002
|
- github: pekkarr
|
||||||
pre_build_script: |
|
email: pekkarr@protonmail.com
|
||||||
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('-', '.'))
|
|
||||||
post_build_script: |
|
|
||||||
git_pkgbuild_commit()
|
|
||||||
update_on:
|
update_on:
|
||||||
- source: rpkgs
|
- source: rpkgs
|
||||||
pkgname: mvnormtest
|
pkgname: mvnormtest
|
||||||
repo: cran
|
repo: cran
|
||||||
|
md5: true
|
||||||
- alias: r
|
- alias: r
|
||||||
|
|
|
@ -45,10 +45,10 @@ class Description:
|
||||||
self.suggests = self._parse_deps("Suggests")
|
self.suggests = self._parse_deps("Suggests")
|
||||||
self.systemrequirements = self.desc.get("SystemRequirements", None)
|
self.systemrequirements = self.desc.get("SystemRequirements", None)
|
||||||
self.license = self.desc["License"]
|
self.license = self.desc["License"]
|
||||||
nc = self.desc["NeedsCompilation"]
|
nc = self.desc.get("NeedsCompilation", None)
|
||||||
if nc != "yes" and nc != "no":
|
if nc is not None and nc != "yes" and nc != "no":
|
||||||
raise Exception(f"Invalid DESCRIPTION file: NeedsCompilation: {nc}")
|
raise Exception(f"Invalid DESCRIPTION file: NeedsCompilation: {nc}")
|
||||||
self.needscompilation = nc == "yes"
|
self.needscompilation = "" if nc is None else nc == "yes"
|
||||||
|
|
||||||
def _parse_description(self, tar: tarfile.TarFile, name: str) -> dict:
|
def _parse_description(self, tar: tarfile.TarFile, name: str) -> dict:
|
||||||
"""Parse the DESCRIPTION file from the source archive and return it as a dict."""
|
"""Parse the DESCRIPTION file from the source archive and return it as a dict."""
|
||||||
|
@ -333,6 +333,8 @@ def check_arch(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
||||||
if desc.needscompilation != cfg.expect_needscompilation:
|
if desc.needscompilation != cfg.expect_needscompilation:
|
||||||
raise CheckFailed(f"NeedsCompilation value has changed: {desc.needscompilation}")
|
raise CheckFailed(f"NeedsCompilation value has changed: {desc.needscompilation}")
|
||||||
else:
|
else:
|
||||||
|
if desc.needscompilation == "":
|
||||||
|
raise CheckFailed("No NeedsCompilation value")
|
||||||
expected = "x86_64" if desc.needscompilation else "any"
|
expected = "x86_64" if desc.needscompilation else "any"
|
||||||
if pkg.arch != [expected]:
|
if pkg.arch != [expected]:
|
||||||
raise CheckFailed(f"Wrong arch, expected {expected}")
|
raise CheckFailed(f"Wrong arch, expected {expected}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue