python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / dmd / template
blobbeca0d5c67f251e98785298ed6c234375fa17135
1 # Template file for 'dmd'
2 pkgname=dmd
3 version=2.080.1
4 revision=1
5 create_wrksrc=yes
6 makedepends="dmd-bootstrap"
7 depends="libphobos>=${version} gcc"
8 short_desc="The Digital Mars D compiler"
9 maintainer="Juan RP <xtraeme@voidlinux.eu>"
10 license="BSL-1.0"
11 homepage="http://www.digitalmars.com/d/2.0/"
12 distfiles="
13  https://github.com/dlang/dmd/archive/v${version}.tar.gz>dmd-${version}.tar.gz
14  https://github.com/dlang/druntime/archive/v${version}.tar.gz>druntime-${version}.tar.gz
15  https://github.com/dlang/phobos/archive/v${version}.tar.gz>phobos-${version}.tar.gz
16  http://downloads.dlang.org/releases/2.x/${version}/dmd.${version}.linux.tar.xz"
17 checksum="50f38e3bd1ac2ce05442e2ab061c6544e0c346eb6d03eb95204238b963ee25a0
18  ca075552c3358682937ea8e3412877bfc7c9eddb928575916eabbe9abff58671
19  57b7c7ab18879acffe50dfff0a7f988d6e4d0ba9341a4ee1ab6eeecca180d6c0
20  4e79c92abc3823cfae58a953f2cef4cc4574fa9a9c7a2d8de36d4faa4b3ccef1"
21 conf_files="/etc/dmd.conf"
22 provides="d-compiler-${version}_${revision}"
23 conflicts="dmd-bootstrap"
24 nopie=yes
26 case "$XBPS_TARGET_MACHINE" in
27         x86_64*) _archbits=64;;
28         i686*) _archbits=32;;
29         *) broken="unsupported arch upstream";;
30 esac
32 post_extract() {
33         rm -rf dmd druntime phobos
34         mv dmd-${version} dmd
35         mv druntime-${version} druntime
36         mv phobos-${version} phobos
39 pre_configure() {
40         case "$XBPS_TARGET_MACHINE" in
41                 *-musl) patch -p0 < ${FILESDIR}/musl.patch
42         esac
45 do_build() {
46         local dmd
48         cd dmd
49         make ${makejobs} -f posix.mak MODEL=${_archbits} TARGET_CPU=X86 BUILD=release PIC=1
50         dmd=${wrksrc}/dmd/generated/linux/release/$_archbits/dmd
52         make ${makejobs} -C docs
54         cd ../druntime
55         make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd BUILD=release PIC=1
57         cd ../phobos
58         make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd BUILD=release PIC=1
61 do_install() {
62         cd dmd
63         vbin generated/linux/release/$_archbits/dmd
64         vinstall ${FILESDIR}/dmd.conf 644 etc
66         vman generated/docs/man/man1/dmd.1
67         vman generated/docs/man/man5/dmd.conf.5
70 dmd-doc_package() {
71         short_desc="Documentation and sample code for D programming language"
72         replaces="dmd-docs>=0"
73         license="Boost License"
75         pkg_install() {
76                 cd dmd2
78                 vmkdir usr/share/doc/d
79                 vcopy samples usr/share/doc/d
80                 vcopy html usr/share/doc/d
82                 find ${PKGDESTDIR}/usr/share/doc/d -type f | xargs chmod 0644
84                 vlicense license.txt
85         }
88 libphobos_package() {
89         short_desc+=" - standard library"
90         license="Boost License"
91         conflicts="dmd-bootstrap"
92         pkg_install() {
93                 vinstall ${wrksrc}/druntime/generated/linux/release/$_archbits/libdruntime.a 644 usr/lib libdruntime.a
94                 vinstall ${wrksrc}/phobos/generated/linux/release/$_archbits/libphobos2.a 644 usr/lib libphobos2.a
96                 vmkdir usr/include/d
97                 cp -r ${wrksrc}/phobos/{*.d,etc,std} ${PKGDESTDIR}/usr/include/d
99                 vmkdir usr/include/d/druntime
100                 cp -r ${wrksrc}/druntime/import ${PKGDESTDIR}/usr/include/d/druntime
102                 vlicense ${wrksrc}/druntime/LICENSE.txt
103         }