diff options
author | Sukanka | 2022-06-06 11:36:07 +0800 |
---|---|---|
committer | Sukanka | 2022-06-06 11:36:07 +0800 |
commit | da49c826cfc7054501b30bcb01a13e791c7c39af (patch) | |
tree | 88d33d9f6fb28935d3cd57dbdb369fdc4fcfc031 | |
download | aur-da49c826cfc7054501b30bcb01a13e791c7c39af.tar.gz |
add r-gpart
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | fix_pi.patch | 17 |
3 files changed, 105 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..115de887ea95 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = r-gpart + pkgdesc = Human genome partitioning of dense sequencing data by identifying haplotype blocks + pkgver = 1.13.0 + pkgrel = 1 + url = https://bioconductor.org/packages/gpart + arch = x86_64 + license = MIT + makedepends = patch + depends = r + depends = r-annotationdbi + depends = r-biomart + depends = r-data.table + depends = r-genomicranges + depends = r-homo.sapiens + depends = r-igraph + depends = r-iranges + depends = r-organismdbi + depends = r-rcpp + depends = r-txdb.hsapiens.ucsc.hg38.knowngene + optdepends = r-biocstyle + optdepends = r-knitr + optdepends = r-rmarkdown + optdepends = r-testthat + source = https://bioconductor.org/packages/release/bioc/src/contrib/gpart_1.13.0.tar.gz + source = fix_pi.patch + sha256sums = 4d8b149f072e10ad1ad149bf09325871cb08d740511bcaef9b4c08aea6e42894 + sha256sums = 033774f380e8c8edbe056b8dd2b076bcd408895a4ecaa75eb6da5e1c99caae70 + +pkgname = r-gpart diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e5c01bbea1bb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,59 @@ +# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net> +# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com + +_pkgname=gpart +_pkgver=1.13.0 +pkgname=r-${_pkgname,,} +pkgver=1.13.0 +pkgrel=1 +pkgdesc='Human genome partitioning of dense sequencing data by identifying haplotype blocks' +arch=('x86_64') +url="https://bioconductor.org/packages/${_pkgname}" +license=('MIT') +depends=( + r + r-annotationdbi + r-biomart + r-data.table + r-genomicranges + r-homo.sapiens + r-igraph + r-iranges + r-organismdbi + r-rcpp + r-txdb.hsapiens.ucsc.hg38.knowngene +) +makedepends=( + patch +) +optdepends=( + r-biocstyle + r-knitr + r-rmarkdown + r-testthat +) +source=("https://bioconductor.org/packages/release/bioc/src/contrib/${_pkgname}_${_pkgver}.tar.gz" + "fix_pi.patch") +sha256sums=('4d8b149f072e10ad1ad149bf09325871cb08d740511bcaef9b4c08aea6e42894' + '033774f380e8c8edbe056b8dd2b076bcd408895a4ecaa75eb6da5e1c99caae70') + +prepare() { + cd "${srcdir}/${_pkgname}" + + # fix misspelled PI macro/variable + patch -Np0 -i "${srcdir}/fix_pi.patch" +} + +build() { + # create staging directory for installation + mkdir -p "${srcdir}/staged" + + R CMD INSTALL "${_pkgname}" -l "${srcdir}/staged" +} + +package() { + install -dm0755 "${pkgdir}/usr/lib/R/library" + cp -a --no-preserve=ownership "${srcdir}/staged/${_pkgname}" "${pkgdir}/usr/lib/R/library" + install -Dm644 "${_pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" +} +# vim:set ts=2 sw=2 et: diff --git a/fix_pi.patch b/fix_pi.patch new file mode 100644 index 000000000000..d6b55dd61a6d --- /dev/null +++ b/fix_pi.patch @@ -0,0 +1,17 @@ +--- src/gpart_cpp.cpp 2021-10-26 22:24:23.000000000 +0300 ++++ src/gpart_cpp.cpp 2022-01-24 15:11:39.775657833 +0300 +@@ -617,12 +617,12 @@ + // three real roots + sq = sqrt(qq); + dxx = acos(rr / (qq * sq)) * (1.0 / 3.0); + sq *= -2; + solutions[0] = sq * cos(dxx) - adiv3; +- solutions[1] = sq * cos(dxx + (2.0 * PI / 3.0)) - adiv3; +- solutions[2] = sq * cos(dxx - (2.0 * PI / 3.0)) - adiv3; ++ solutions[1] = sq * cos(dxx + (2.0 * M_PI / 3.0)) - adiv3; ++ solutions[2] = sq * cos(dxx - (2.0 * M_PI / 3.0)) - adiv3; + // now sort and check for within-epsilon equality + if (solutions[0] > solutions[1]) { + dxx = solutions[0]; + solutions[0] = solutions[1]; + if (dxx > solutions[2]) { |