-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathtemplate
More file actions
102 lines (84 loc) · 2.72 KB
/
template
File metadata and controls
102 lines (84 loc) · 2.72 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Template file for 'dmd'
pkgname=dmd
version=2.112.0
revision=1
create_wrksrc=yes
hostmakedepends="dmd2.091 which"
makedepends="git"
depends="libphobos>=${version} gcc"
short_desc="Digital Mars D compiler"
maintainer="streaks <assemblyislaw@gmail.com>"
license="BSL-1.0"
homepage="http://www.digitalmars.com/d/2.0/"
distfiles="
https://github.com/dlang/dmd/archive/refs/tags/v${version}.tar.gz>dmd-${version}.tar.gz
https://github.com/dlang/phobos/archive/v${version}.tar.gz>phobos-${version}.tar.gz
http://downloads.dlang.org/releases/2.x/${version}/dmd.${version}.linux.tar.xz"
checksum="33592dc18855bd113914ca065d9e88018745afaa5fbf85b971fbc1a6663c9ec5
99e046c1107bc3f365910f5cb52937483c9a5528f2d4ef543b8690ad66723f16
4556ecde412c6c43662cd1c6e7cec5c6d567b7e74508287a8a0c3c6c506a7e94"
conf_files="/etc/dmd.conf"
provides="d-compiler-${version}_${revision}"
conflicts="dmd-bootstrap dmd2.081 dmd2.091"
nopie=yes
# from no to very little distinction between host CC and target CC in
# makefiles or build.d
nocross="broken build system"
disable_parallel_build=yes
LDFLAGS="-lpthread"
case "$XBPS_TARGET_MACHINE" in
x86_64*) _archbits=64;;
i686) _archbits=32;;
*) broken="unsupported arch upstream";;
esac
post_extract() {
mv dmd-${version} dmd
mv phobos-${version} phobos
}
post_patch() {
if [ "$XBPS_TARGET_LIBC" = musl ]; then
patch -p0 < ${FILESDIR}/musl.patch
fi
}
do_build() {
local dmd
cd dmd
make ${makejobs} -f posix.mak MODEL=${_archbits} TARGET_CPU=X86 ENABLE_RELEASE=1 PIC=1
dmd=${wrksrc}/dmd/generated/linux/release/$_archbits/dmd
make ${makejobs} -C compiler/docs
cd ../phobos
make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd ENABLE_RELEASE=1 PIC=1
}
do_install() {
cd dmd
vbin generated/linux/release/$_archbits/dmd
vinstall ${FILESDIR}/dmd.conf 644 etc
vman generated/docs/man/man1/dmd.1
vman generated/docs/man/man5/dmd.conf.5
}
dmd-doc_package() {
short_desc="Documentation and sample code for D programming language"
replaces="dmd-docs>=0"
license="BSL-1.0"
pkg_install() {
cd dmd2
vmkdir usr/share/doc/d
vcopy html usr/share/doc/d
find ${PKGDESTDIR}/usr/share/doc/d -type f | xargs chmod 0644
vlicense license.txt
}
}
libphobos_package() {
short_desc+=" - standard library"
license="BSL-1.0"
conflicts="dmd-bootstrap dmd2.081 dmd2.091"
pkg_install() {
vinstall ${wrksrc}/dmd/generated/linux/release/$_archbits/libdruntime.a 644 usr/lib libdruntime.a
vinstall ${wrksrc}/phobos/generated/linux/release/$_archbits/libphobos2.a 644 usr/lib libphobos2.a
vmkdir usr/include/d
cp -r ${wrksrc}/phobos/{*.d,etc,std} ${PKGDESTDIR}/usr/include/d
vmkdir usr/include/d/druntime
cp -r ${wrksrc}/dmd/druntime/import ${PKGDESTDIR}/usr/include/d/druntime
vlicense ${wrksrc}/dmd/LICENSE.txt
}
}