summaryrefslogtreecommitdiff
path: root/libre/cgminer-libre/PKGBUILD
blob: 8f47048a2d2610fbe10e27b7bff42aa105103bec (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# $Id: PKGBUILD 98584 2013-10-14 15:10:08Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: monson <holymonson@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: David Manouchehri <david@davidmanouchehri.com>
# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>

_pkgname=cgminer
pkgname=cgminer-libre
pkgver=3.6.1
pkgrel=1
pkgdesc="Multi-threaded multi-pool GPU, FPGA and ASIC miner for bitcoin and derivative coins, without nonfree OpenCL recommendation"
url='http://forum.bitcoin.org/index.php?topic=28402.0'
license=('GPL3')
arch=('i686' 'x86_64' 'mips64el')
replaces=$_pkgname
conflicts=$_pkgname
provides=$_pkgname=$pkgver
depends=('curl' 'mesa-libcl' 'libusbx' 'jansson')
makedepends=('opencl-headers')
source=("http://ck.kolivas.org/apps/$_pkgname/$_pkgname-${pkgver}.tar.bz2"
        "$_pkgname.conf.d"
        "$_pkgname.service")
backup=("etc/conf.d/$_pkgname" "etc/$_pkgname.conf")

[ "$CARCH" == "x86_64" ] && makedepends+=('yasm')

build() {
  cd "$srcdir/$_pkgname-$pkgver"

  # We have latest jansson and libusb - just use them
  sed "s|ac_subdirs_all='compat/libusb\-1.0'||" -i ./configure
  sed 's|subdirs="$subdirs compat/libusb\-1.0"||' -i ./configure
  sed 's|LIBUSB_LIBS="compat/libusb-1.0/libusb/.libs/libusb-1.0.a"|LIBUSB_LIBS=-lusb-1.0|' -i ./configure
  sed 's|JANSSON_LIBS="compat/jansson/libjansson.a"|JANSSON_LIBS=-ljansson|' -i ./configure
  sed 's|compat/Makefile compat/jansson/Makefile||' -i ./configure

  sed 's|JANSSON_INCLUDES = -I$(top_srcdir)/compat/jansson||' -i ./Makefile.in
  sed 's|USBUTILS_INCLUDES = -I$(top_srcdir)/compat/libusb\-1.0/libusb|USBUTILS_INCLUDES = -I/usr/include/libusb-1.0|' -i ./Makefile.in
  sed 's|SUBDIRS = lib compat ccan|SUBDIRS = lib ccan|' -i ./Makefile.in

  rm -r compat

  # Here you may want to use custom CFLAGS
  #export CFLAGS="-O2 -march=native -mtune=native -msse2"
  
  ./configure \
    --prefix=/usr \
    --enable-scrypt \
    --enable-opencl \
    --enable-bflsc \
    --enable-bitforce \
    --enable-icarus \
    --enable-modminer \
    --enable-ztex \
    --enable-avalon \
    --enable-klondike \
    --enable-bitfury \
    --disable-adl # For license issues
  
  make
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  install -d "$pkgdir/usr/share/$_pkgname"
  install -m755 miner.php api-example.* "$pkgdir/usr/share/$_pkgname"

  install -Dm644 "$srcdir"/$_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname.service
  install -Dm644 "$srcdir"/$_pkgname.conf.d "$pkgdir"/etc/conf.d/$_pkgname
  sed 's#/usr/local/bin#/usr/bin#g' example.conf > $_pkgname.conf
  install -Dm644 $_pkgname.conf "$pkgdir"/etc/$_pkgname.conf
}

sha512sums=('53df3f3899d00c7bbaca1528c55e5c8c2ddb00bf9da8af23b6b4a1f05bfe0100ac4f5381ff084b7a00d69ee795f8edceddb6c89a6d354dc5e26dc0a865f09890'
            '99c38bc395848f9712ce172343d31f5c60f5d8ac1cfe2f48df8f3ec6c488fc275763a79c5ef36b99f32faa465b5a65284b38e8a63ef9b144075ee13971313b41'
            '3317b60c6b1f14c47d8ee636113ef40a4023ab14054129de80a37947b381fd2b647a7053f4e1bb639efa225a514e862fa531908714c34040dda2d6221dde7f5f')