From b17d549758b2f684f7e9385059beec3a58eb3088 Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Tue, 10 Oct 2023 17:01:42 +0300 Subject: [PATCH] r-gdsfmt: use metadata checks --- BioArchLinux/r-gdsfmt/PKGBUILD | 47 ++++++++++++++++++------- BioArchLinux/r-gdsfmt/lilac.py | 11 +++--- BioArchLinux/r-gdsfmt/lilac.yaml | 29 ++++++++++++--- BioArchLinux/r-gdsfmt/system-libs.patch | 42 ++++++++++++++++++++++ 4 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 BioArchLinux/r-gdsfmt/system-libs.patch diff --git a/BioArchLinux/r-gdsfmt/PKGBUILD b/BioArchLinux/r-gdsfmt/PKGBUILD index 4dc8629b25..0d57f7c613 100644 --- a/BioArchLinux/r-gdsfmt/PKGBUILD +++ b/BioArchLinux/r-gdsfmt/PKGBUILD @@ -1,16 +1,25 @@ -# Maintainer: Guoyi Zhang +# Maintainer: Pekka Ristola +# Contributor: Guoyi Zhang _pkgname=gdsfmt _pkgver=1.36.1 pkgname=r-${_pkgname,,} -pkgver=1.36.1 +pkgver=${_pkgver//-/.} pkgrel=1 -pkgdesc='R Interface to CoreArray Genomic Data Structure (GDS) Files' -arch=('x86_64') +pkgdesc="R Interface to CoreArray Genomic Data Structure (GDS) Files" +arch=(x86_64) url="https://bioconductor.org/packages/${_pkgname}" -license=('LGPL') +license=(LGPL3) depends=( + lz4 r + xz + zlib +) +checkdepends=( + r-biocgenerics + r-digest + r-runit ) optdepends=( r-biocgenerics @@ -18,20 +27,32 @@ optdepends=( r-digest r-knitr r-markdown - r-matrix - r-parallel r-rmarkdown r-runit ) -source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz") -sha256sums=('a753d15c43d4d8618f6751b6ec87f1d8439a9eb3a1e2d4c1f2fbdb6fbf581187') +source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz" + "system-libs.patch") +md5sums=('7e54216f1539f908f188665986552ab5' + 'bffd05eba8706aacc469c69a3b0eeada') +sha256sums=('a753d15c43d4d8618f6751b6ec87f1d8439a9eb3a1e2d4c1f2fbdb6fbf581187' + 'a30cf43b5d8f07f19e88cc26fc2ccf6d88ab491e21ab3eb5b656d5258272af85') + +prepare() { + # use system lz4, xz and zlib + patch -Np1 -i system-libs.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" 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-gdsfmt/lilac.py b/BioArchLinux/r-gdsfmt/lilac.py index bd219c037c..b5cdb057c5 100644 --- a/BioArchLinux/r-gdsfmt/lilac.py +++ b/BioArchLinux/r-gdsfmt/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-gdsfmt/lilac.yaml b/BioArchLinux/r-gdsfmt/lilac.yaml index a424dd6e30..20195e700a 100644 --- a/BioArchLinux/r-gdsfmt/lilac.yaml +++ b/BioArchLinux/r-gdsfmt/lilac.yaml @@ -1,9 +1,28 @@ build_prefix: extra-x86_64 maintainers: -- github: starsareintherose - email: kuoi@bioarchlinux.org +- github: pekkarr + email: pekkarr@protonmail.com +repo_makedepends: +- r-biocgenerics +- r-digest +- r-runit update_on: -- regex: gdsfmt_([\d._-]+).tar.gz - source: regex - url: https://bioconductor.org/packages/gdsfmt +- source: rpkgs + pkgname: gdsfmt + repo: bioc + md5: true - alias: r +- source: alpmfiles + pkgname: lz4 + filename: usr/lib/liblz4\.so\.([^.]+) + repo: core +- source: alpm + alpm: xz + repo: core + provided: liblzma.so + strip_release: true +- source: alpm + alpm: zlib + repo: core + provided: libz.so + strip_release: true diff --git a/BioArchLinux/r-gdsfmt/system-libs.patch b/BioArchLinux/r-gdsfmt/system-libs.patch new file mode 100644 index 0000000000..fad5602c0b --- /dev/null +++ b/BioArchLinux/r-gdsfmt/system-libs.patch @@ -0,0 +1,42 @@ +diff --git a/gdsfmt/src/Makevars b/gdsfmt/src/Makevars +index 0140469..3d4d197 100755 +--- a/gdsfmt/src/Makevars ++++ b/gdsfmt/src/Makevars +@@ -6,7 +6,7 @@ + PKG_CPPFLAGS = -DUSING_R -D_FILE_OFFSET_BITS=64 -I../inst/include -ICoreArray + + # to set flags for the linker +-PKG_LIBS = ./liblzma.a -lpthread ++PKG_LIBS = -lz -llz4 -llzma -lpthread + + SOURCES = \ + R_CoreArray.cpp \ +@@ -65,27 +65,11 @@ OBJECTS = \ + CoreArray/dStream.o \ + CoreArray/dStruct.o \ + CoreArray/dSparse.o \ +- CoreArray/dVLIntGDS.o \ +- ZLIB/adler32.o \ +- ZLIB/compress.o \ +- ZLIB/crc32.o \ +- ZLIB/deflate.o \ +- ZLIB/infback.o \ +- ZLIB/inffast.o \ +- ZLIB/inflate.o \ +- ZLIB/inftrees.o \ +- ZLIB/trees.o \ +- ZLIB/uncompr.o \ +- ZLIB/zutil.o \ +- LZ4/lz4.o \ +- LZ4/lz4hc.o \ +- LZ4/lz4frame.o \ +- LZ4/xxhash.o ++ CoreArray/dVLIntGDS.o + + + all: $(SHLIB) + +-$(SHLIB): liblzma.a + + + ZLIB/adler32.o: