summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2748194f99fa8cb77d7f634c3d994d5a728663c2 (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: soloturn@gmail.com

_basename=llbuild
pkgname="$_basename-git"
pkgver=swift.DEVELOPMENT.SNAPSHOT.2020.09.23.a.r0.g3332fc26
pkgrel=1
pkgdesc="Build system and library at the core of XCode and Swift package manager."
arch=('x86_64')
url="https://swift.org/"
license=('apache2')
conflicts=("$_basename")
provides=("$_basename")
makedepends=('clang' 'git' 'ninja')
source=(
  'llbuild::git+https://github.com/apple/swift-llbuild'
  '0002-llbuild-ninja-test-binary-links-against-ncurses.patch'
)
md5sums=(
  'SKIP'
  'SKIP'
)

pkgver() {
  cd "$_basename"
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  mkdir -p build
  ( cd "$_basename" && patch -p1 -i "$srcdir/0002-llbuild-ninja-test-binary-links-against-ncurses.patch" )
}

build() {
  cd build

  # this is a copy of the build command generated by apples build-script, when building swift:
  #/usr/sbin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=/usr/sbin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/sbin/clang++ -DCMAKE_LIBTOOL:PATH=/usr/sbin/libtool -DLLVM_VERSION_MAJOR:STRING=10 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=10 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/sbin/ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/ -DCMAKE_IGNORE_PATH=/usr/include/bits 

  CXX=clang++ CC=clang cmake ../${_basename} -G Ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/
  ninja
}

package() {
  cd build
  DESTDIR="${pkgdir}" ninja install
}

# vim:set ts=2 sw=2 et: