summaryrefslogtreecommitdiff
path: root/multilib/lib32-libphobos-ldc/PKGBUILD
blob: 949ed5e59e307fcece2ac55eaea7f2b1248d278d (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
# $Id: PKGBUILD 72029 2012-06-06 11:58:40Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
pkgname=lib32-libphobos-ldc
pkgver=20120606
pkgrel=1
pkgdesc="libphobos for ldc (32-bit)"
arch=('x86_64')
url="http://www.dsource.org/projects/ldc"
license=('BSD')
depends=('llvm' 'libconfig')
makedepends=('git' 'cmake')
source=()
md5sums=()

_gitroot=git://github.com/ldc-developers/ldc.git
_gitname=ldc
_gitbranch=llvm-3.1

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    git clone --branch "$_gitbranch" "$_gitroot" "$_gitname"
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  git clone --recursive "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"
	
  mkdir build && cd build
  cmake \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DINCLUDE_INSTALL_DIR=/usr/include/d/std-ldc \
      -DMULTILIB=ON \
      ..
  make
}

package() {
  cd "$srcdir/$_gitname-build"
  
  cd build
  make DESTDIR=$pkgdir install
  cd ..

  # We don't want anything but the 32-bit libs
  rm -rf $pkgdir/usr/{share,lib,include,bin} $pkgdir/etc

  install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}