archrelease: copy trunk to community-any
[ArchLinux/community.git] / dfmt / repos / community-x86_64 / PKGBUILD
blob43a3c00b55de507fed3ad92e420d7308e1f0964f
1 # Maintainer: Dan Printzell <wild@archlinux.org>
3 pkgname=('dfmt')
4 pkgver=0.15.0
5 pkgrel=1
6 _pkgcommit=49b9fe4051579bdcc7fc155bee6a43f3ab7174df
7 pkgdesc="Dfmt is a formatter for D source code"
8 arch=('x86_64')
9 url="https://github.com/dlang-community/dfmt"
10 license=("custom")
11 groups=('dlang')
12 makedepends=('ldc' 'git')
13 depends=('liblphobos')
15 source=(
16         "git+https://github.com/dlang-community/dfmt#commit=$_pkgcommit"
17         "git+https://github.com/dlang-community/libdparse"
18         "git+https://github.com/sociomantic-tsunami/makd"
19         "git+https://github.com/sociomantic-tsunami/beaver"
20         "git+https://github.com/dlang-community/stdx-allocator"
22 sha256sums=('SKIP'
23             'SKIP'
24             'SKIP'
25             'SKIP'
26             'SKIP')
28 prepare() {
29         cd "$srcdir/dfmt"
31         git submodule init
32         git config submodule.libdparse.url "$srcdir/libdparse"
33         git config submodule.makd.url "$srcdir/makd"
34         git config submodule.beaver.url "$srcdir/beaver"
35         git config submodule.stdx-allocator.url "$srcdir/stdx-allocator"
36         git -c protocol.file.allow=always submodule update
38         _extraFlags="-O5 -flto=full -linker=gold -link-defaultlib-shared=false -L=\"$LDFLAGS\""
39         sed -i "/LDC_FLAGS \:=/ a override LDC_FLAGS += $_extraFlags" makefile
42 build() {
43         cd "$srcdir/dfmt"
44         make ldc
47 package() {
48         # binaries
49         install -Dm755 "$srcdir/dfmt/bin/dfmt" "$pkgdir/usr/bin/dfmt"
51         # license
52         install -Dm644 "$srcdir/dfmt/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"