summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 090ccd7eaee1633455d65cbbfd4f4b67818ab8a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: techcs <techcs@protonmail.com>
pkgname=admixtools-git
pkgver=r61.b10ddcf
pkgrel=1
pkgdesc="Tools to test whether admixture occurred and more"
arch=('x86_64')
url="https://reich.hms.harvard.edu/software"
license=('custom')
depends=('gsl' 'openblas' 'gcc-fortran')
makedepends=('git' 'make')
source=("admixtools-git::git+https://github.com/DReichLab/AdmixTools")
sha256sums=('SKIP')

build() {
  cd "$srcdir/$pkgname/src"

  make
}

package() {
  cd "$srcdir/$pkgname/src"

  install -dm755 "$pkgdir/usr/bin"
  install -dm755 "$pkgdir/usr/lib"
  install -dm755 "$pkgdir/usr/share/doc/$pkgname"

  for bin in qpDstat qp3Pop qpAdm qpGraph; do
    if [[ -x "$bin" ]]; then
      install -Dm755 "$bin" "$pkgdir/usr/bin/$bin"
    else
      echo "Warning: Binary '$bin' not found. Skipping..."
    fi
  done

  if [[ -f "nicksrc/libnick.a" ]]; then
    install -Dm644 nicksrc/libnick.a "$pkgdir/usr/lib/libnick.a"
  fi

  if [[ -f "../README.md" ]]; then
    install -Dm644 ../README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  fi
}

pkgver() {
  cd "$srcdir/$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}