mirror of
https://github.com/BioArchLinux/Packages.git
synced 2025-03-10 12:02:42 +00:00
r-igraph: fix depends, use metadata checks
This commit is contained in:
parent
ef9619ac99
commit
8295536dbb
5 changed files with 148 additions and 37 deletions
|
@ -1,27 +1,42 @@
|
||||||
# system requirements: gmp (>= 4.38, optional), libxml2 (optional), glpk(optional)
|
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
|
||||||
# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
|
# Contributor: Guoyi Zhang <guoyizhang at malacology dot net>
|
||||||
|
# Contributor: Alex Branham <branham@utexas.edu>
|
||||||
|
|
||||||
_pkgname=igraph
|
_pkgname=igraph
|
||||||
_pkgver=1.4.3
|
_pkgver=1.5.0
|
||||||
pkgname=r-${_pkgname,,}
|
pkgname=r-${_pkgname,,}
|
||||||
pkgver=1.4.3
|
pkgver=${_pkgver//[:-]/.}
|
||||||
pkgrel=1
|
pkgrel=0
|
||||||
pkgdesc='Network Analysis and Visualization'
|
pkgdesc="Network Analysis and Visualization"
|
||||||
arch=('x86_64')
|
arch=(x86_64)
|
||||||
url="https://cran.r-project.org/package=${_pkgname}"
|
url="https://cran.r-project.org/package=${_pkgname}"
|
||||||
license=('GPL')
|
license=(GPL)
|
||||||
depends=(
|
depends=(
|
||||||
r
|
arpack
|
||||||
r-cpp11
|
blas
|
||||||
|
glpk
|
||||||
|
gmp
|
||||||
|
lapack
|
||||||
|
libxml2
|
||||||
|
plfit
|
||||||
|
r-cli
|
||||||
r-magrittr
|
r-magrittr
|
||||||
r-pkgconfig
|
r-pkgconfig
|
||||||
r-rlang
|
r-rlang
|
||||||
|
suitesparse
|
||||||
|
util-linux-libs
|
||||||
|
)
|
||||||
|
makedepends=(
|
||||||
|
r-cpp11
|
||||||
|
)
|
||||||
|
checkdepends=(
|
||||||
|
r-graph
|
||||||
|
r-testthat
|
||||||
|
r-vdiffr
|
||||||
)
|
)
|
||||||
optdepends=(
|
optdepends=(
|
||||||
glpk
|
|
||||||
gmp
|
|
||||||
libxml2
|
|
||||||
r-ape
|
r-ape
|
||||||
|
r-callr
|
||||||
r-decor
|
r-decor
|
||||||
r-digest
|
r-digest
|
||||||
r-graph
|
r-graph
|
||||||
|
@ -30,24 +45,35 @@ optdepends=(
|
||||||
r-rgl
|
r-rgl
|
||||||
r-rmarkdown
|
r-rmarkdown
|
||||||
r-scales
|
r-scales
|
||||||
r-stats4
|
|
||||||
r-tcltk
|
|
||||||
r-testthat
|
r-testthat
|
||||||
r-vdiffr
|
r-vdiffr
|
||||||
r-withr
|
r-withr
|
||||||
)
|
)
|
||||||
makedepends=(
|
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz"
|
||||||
gcc-fortran
|
"igraph-system-libs.patch")
|
||||||
)
|
md5sums=('5e77d6cd9b04e72ceb0d51d2e5a232c8'
|
||||||
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
|
'34283a0a206240ab1f33f83d2526ffca')
|
||||||
sha256sums=('06bdb3fa6cced6a5990268f9f26c5ef129df1dc2d4ff2806fe36f3b45cc16021')
|
sha256sums=('d80778ff0fd0ee00a348c5d63b3b398b7467a1af49d85dc57fbee0a900fd7306'
|
||||||
|
'38731c656da7f1fe34a4d21c3e3dcae65592898ba81620b96cd27c7894539530')
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "$_pkgname"
|
||||||
|
# Build using system libraries
|
||||||
|
patch -Np1 -i ../igraph-system-libs.patch
|
||||||
|
autoconf
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
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() {
|
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:
|
|
||||||
|
|
56
BioArchLinux/r-igraph/igraph-system-libs.patch
Normal file
56
BioArchLinux/r-igraph/igraph-system-libs.patch
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,17 @@
|
||||||
#!/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 = "gmp (optional), libxml2 (optional), glpk (>= 4.57, optional)",
|
||||||
print(line)
|
ignore_fortran_files = True,
|
||||||
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
|
)
|
||||||
|
|
||||||
def post_build():
|
def post_build():
|
||||||
git_pkgbuild_commit()
|
git_pkgbuild_commit()
|
||||||
|
|
|
@ -1,14 +1,30 @@
|
||||||
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-cpp11
|
- r-cli
|
||||||
- r-magrittr
|
- r-magrittr
|
||||||
- r-pkgconfig
|
- r-pkgconfig
|
||||||
- r-rlang
|
- r-rlang
|
||||||
|
repo_makedepends:
|
||||||
|
- r-cpp11
|
||||||
|
- r-graph
|
||||||
|
- r-testthat
|
||||||
|
- r-vdiffr
|
||||||
update_on:
|
update_on:
|
||||||
- regex: igraph_([\d._-]+).tar.gz
|
- source: rpkgs
|
||||||
source: regex
|
pkgname: igraph
|
||||||
url: https://cran.r-project.org/package=igraph
|
repo: cran
|
||||||
|
md5: true
|
||||||
- alias: r
|
- alias: r
|
||||||
|
- source: alpm
|
||||||
|
alpm: libxml2
|
||||||
|
repo: core
|
||||||
|
provided: libxml2.so
|
||||||
|
strip_release: true
|
||||||
|
- source: alpm
|
||||||
|
alpm: util-linux-libs
|
||||||
|
repo: core
|
||||||
|
provided: libuuid.so
|
||||||
|
strip_release: true
|
||||||
|
|
|
@ -211,9 +211,14 @@ class CheckFailed(Exception):
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
|
|
||||||
class CheckConfig:
|
class CheckConfig:
|
||||||
def __init__(self, expect_license: str = None, expect_systemrequirements: str = None):
|
def __init__(self,
|
||||||
|
expect_license: str = None,
|
||||||
|
expect_systemrequirements: str = None,
|
||||||
|
ignore_fortran_files: bool = False,
|
||||||
|
):
|
||||||
self.expect_license = expect_license
|
self.expect_license = expect_license
|
||||||
self.expect_systemrequirements = expect_systemrequirements
|
self.expect_systemrequirements = expect_systemrequirements
|
||||||
|
self.ignore_fortran_files = ignore_fortran_files
|
||||||
|
|
||||||
def check_default_pkgs(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
def check_default_pkgs(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
||||||
errors = set()
|
errors = set()
|
||||||
|
@ -285,9 +290,12 @@ def check_fortran(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
||||||
fortran_dep = "gcc-fortran" in pkg.makedepends
|
fortran_dep = "gcc-fortran" in pkg.makedepends
|
||||||
|
|
||||||
if fortran_files and not fortran_dep:
|
if fortran_files and not fortran_dep:
|
||||||
raise CheckFailed("Missing make dependency: gcc-fortran")
|
if not cfg.ignore_fortran_files:
|
||||||
|
raise CheckFailed("Missing make dependency: gcc-fortran")
|
||||||
elif not fortran_files and fortran_dep:
|
elif not fortran_files and fortran_dep:
|
||||||
raise CheckFailed("Unnecessary make dependency: gcc-fortran")
|
raise CheckFailed("Unnecessary make dependency: gcc-fortran")
|
||||||
|
elif cfg.ignore_fortran_files and not fortran_files:
|
||||||
|
raise CheckFailed("Unnecessary config 'ignore_fortran_files'");
|
||||||
|
|
||||||
def check_systemrequirements(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
def check_systemrequirements(pkg: Pkgbuild, desc: Description, cfg: CheckConfig):
|
||||||
if cfg.expect_systemrequirements != desc.systemrequirements:
|
if cfg.expect_systemrequirements != desc.systemrequirements:
|
||||||
|
|
Loading…
Add table
Reference in a new issue