dmd: Update to 2.079.0

Closes: #12237 [via git-merge-pr]
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
Yuxuan Shui 2018-03-07 09:59:21 -05:00 committed by Jürgen Buchmüller
parent 7c5f7f8288
commit 555bed3e85
No known key found for this signature in database
GPG key ID: 6764EC32352D0647
5 changed files with 222 additions and 783 deletions

1
srcpkgs/dmd-doc Symbolic link
View file

@ -0,0 +1 @@
dmd

View file

@ -1,735 +0,0 @@
LPAREN = (
RPAREN = )
BACKTICK = `
DOLLAR = $
ESCAPES =
/</&lt;/
/>/&gt;/
/&/&amp;/
B = <b>$0</b>
I = <i>$0</i>
U = <u>$0</u>
P = <p>$0</p>
DL = <dl>$0</dl>
DT = <dt>$0</dt>
DD = <dd>$0</dd>
TABLE = <table>$0</table>
TR = <tr>$0</tr>
TH = <th>$0</th>
TD = <td>$0</td>
OL = <ol>$0</ol>
UL = <ul>$0</ul>
LI = <li>$0</li>
BIG = <span class="font_big">$0</span>
SMALL = <small>$0</small>
BR = <br>
LINK = <a href="$0">$0</a>
LINK2 = <a href="$1">$+</a>
DEPRECATED = $0
RED = <span class="color_red">$0</span>
BLUE = <span class="color_blue">$0</span>
GREEN = <span class="color_green">$0</span>
YELLOW = <span class="color_yellow">$0</span>
BLACK = <span class="color_black">$0</span>
WHITE = <span class="color_white">$0</span>
D_CODE =
<section class="code_listing">
<div class="code_sample">
<div class="dlang">
<ol class="code_lines">
<li><code class="code">$0</code></li>
</ol>
</div>
</div>
</section>
D_INLINECODE = <code class="code">$0</code>
DDOC_BACKQUOTED = $(D_INLINECODE $0)
D_COMMENT = <span class="comment">$0</span>
D_STRING = <span class="string_literal">$0</span>
D_KEYWORD = <span class="keyword">$0</span>
D_PSYMBOL = <span class="psymbol">$0</span>
D_PARAM = <span class="param">$0</span>
DDOC_BLANKLINE = <br><br>
DDOC_COMMENT = <!-- $0 -->
DDOC =
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>$(TITLE)</title>
<style type="text/css" media="screen">
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p,
blockquote, pre, a, abbr, address, cite, code, del, dfn, em, figure,
img, ins, kbd, q, s, samp, small, strong, sub, sup, var, b, u, i, dl,
dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td {
background: transparent none repeat scroll 0 0;
border: 0 none;
font-size: 100%;
margin: 0;
outline: 0 none;
padding: 0;
vertical-align: baseline;
}
.color_red { color: #dc322f; }
.color_blue { color: #268bd2; }
.color_green { color: #859901; }
.color_yellow { color: #b58901; }
.color_black { color: black; }
.color_white { color: white; }
.font_big {
font-size: 1.2em;
}
.ddoc_section_h {
font-weight: bold;
font-size: 13px;
line-height: 19.5px;
margin-top: 11px;
display: block;
}
body.dlang .dlang {
display: inline-block;
}
body.dlang .declaration .dlang {
display: block;
}
body.dlang .ddoc_header_anchor a.dlang {
display: block;
color: rgba(0, 136, 204, 1);
text-decoration: none;
}
body.dlang .ddoc_header_anchor .code {
color: rgba(0, 136, 204, 1);
}
#ddoc_main .module {
border-color: currentColor rgba(233, 233, 233, 1) rgba(233, 233, 233, 1);
border-style: none solid solid;
border-width: 0 1px 1px;
overflow-x: hidden;
padding: 15px;
}
#ddoc_main .section .section {
margin-top: 0;
}
#ddoc_main .ddoc_module_members_section {
padding: 1px 0 0;
transition: transform 0.3s ease 0s;
}
#ddoc_main .ddoc_member, #ddoc_main .ddoc_module_members section.intro {
background: #fff none repeat scroll 0 0;
list-style-type: none;
width: 100%;
}
#ddoc_main .ddoc_header_anchor {
font-size: 1.4em;
transition: transform 0.3s ease 0s;
}
#ddoc_main .ddoc_header_anchor > .code {
display: inline-block;
}
#ddoc_main .ddoc_decl {
background-color: transparent;
height: 100%;
left: 0;
top: 0;
padding: 0;
padding-left: 15px;
}
#ddoc_main .ddoc_decl .section, #ddoc_main .section.ddoc_sections {
background: white none repeat scroll 0 0;
margin: 0;
padding: 5px;
position: relative;
border-radius: 5px;
}
#ddoc_main .ddoc_decl .section h4, #ddoc_main .section.ddoc_sections h4 {
font-size: 13px;
line-height: 1.5;
margin-top: 21px;
}
#ddoc_main .section .declaration {
margin-top: 21px;
}
#ddoc_main .section .declaration .code {
color: rgba(0, 0, 0, 1);
margin-bottom: 15px;
padding-bottom: 6px;
}
#ddoc_main .declaration div .para {
margin-bottom: 0;
}
#ddoc_main .ddoc_params .graybox tr td:first-of-type {
padding: 7px;
text-align: right;
vertical-align: top;
word-break: normal;
white-space: nowrap;
}
#ddoc_main .ddoc_params .graybox {
border: 0 none;
}
#ddoc_main .ddoc_params .graybox td {
border-color: rgba(214, 214, 214, 1);
}
#ddoc_main .ddoc_params .graybox tr:first-child > td {
border-top: 0 none;
}
#ddoc_main .ddoc_params .graybox tr:last-child > td {
border-bottom: 0 none;
}
#ddoc_main .ddoc_params .graybox tr > td:first-child {
border-left: 0 none;
}
#ddoc_main .ddoc_params .graybox tr > td:last-child {
border-right: 0 none;
width: 100%;
}
#ddoc_main em.term, #ddoc_main em.term .code {
color: rgba(65, 65, 65, 1);
font-size: 12px;
font-style: italic;
line-height: 1.5;
}
#ddoc_main .see-also {
cursor: pointer;
font-family: Menlo,monospace;
}
#ddoc_main .ddoc_decl .section > div:last-of-type {
margin-bottom: 15px;
}
#ddoc_main .ddoc_member, #ddoc_main .ddoc_module_members {
transition: transform 0.3s ease 0s;
}
#ddoc_main .code_sample {
background: inherit;
}
#ddoc_main .declaration .code-line {
display: block;
font: 1em Menlo,monospace;
}
#ddoc_main a[name] {
margin: -112px 0 0;
padding-top: 112px;
}
#ddoc_main .ddoc_decl td {
max-width: inherit;
}
#ddoc_main .declaration a {
color: inherit;
}
#ddoc_main .declaration a:hover {
color: rgba(0, 136, 204, 1);
text-decoration: underline;
}
body.ddoc {
background-color: transparent;
color: rgba(0, 0, 0, 1);
font-family: Helvetica,Arial,sans-serif;
font-size: 62.5%;
margin: 0;
border: 0;
left: 0;
top: 0;
padding: 0;
}
.ddoc a[name] {
display: block;
height: 0;
margin: -85px 0 0;
padding-top: 85px;
width: 0;
}
.ddoc .module {
border-color: transparent;
background-color: rgba(255, 255, 255, 1);
border-color: currentColor rgba(233, 233, 233, 1) rgba(233, 233, 233, 1);
border-image: none;
border-style: none solid solid;
border-width: 0 1px 1px;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.07);
display: block;
margin-left: 0;
min-height: calc(100% - 173px);
overflow: auto;
padding-bottom: 100px;
}
.ddoc .content_wrapper {
background-color: rgba(242, 242, 242, 1);
margin: 0 auto;
max-width: 980px;
}
.ddoc .section {
padding: 15px 25px 30px;
}
.ddoc .section .section {
margin: 30px 0 0;
padding: 0;
}
.ddoc .para {
color: rgba(65, 65, 65, 1);
font-size: 1.4em;
line-height: 145%;
margin-bottom: 15px;
}
.ddoc .ddoc_examples .para {
margin-bottom: 0;
}
.ddoc .module_name {
color: rgba(0, 0, 0, 1);
display: block;
font-family: Helvetica;
font-size: 2.8em;
font-weight: 100;
margin-bottom: 0;
padding: 15px 0;
}
.ddoc .module a {
color: rgba(0, 136, 204, 1);
text-decoration: none;
}
.ddoc .code {
color: rgba(128, 128, 128, 1);
font-family: Menlo,monospace;
font-size: 0.85em;
word-wrap: break-word;
}
.ddoc .code i {
font-style: normal;
}
.ddoc .code .code {
font-size: 1em;
}
.ddoc .code_sample {
background-clip: padding-box;
margin: 1px 0;
text-align: left;
}
.ddoc .code_sample {
display: block;
font-size: 1.4em;
margin-left: 21px;
}
.ddoc ol .code_sample {
font-size: 1em;
}
.ddoc .code_lines {
counter-reset: li;
line-height: 1.6em;
list-style: outside none none;
margin: 0;
padding: 0;
}
.ddoc .code_listing .code_sample div {
margin-left: 13px;
width: 93%;
}
.ddoc .code_listing .code_sample div .code_lines li {
list-style-type: none;
margin: 0;
padding-right: 10px;
}
.ddoc .code_sample div .code_lines li::before {
margin-left: -33px;
margin-right: 25px;
}
.ddoc .code_sample div .code_lines li:nth-child(n+10)::before {
margin-left: -39px;
margin-right: 25px;
}
.ddoc .code_sample div .code_lines li:nth-child(n+100)::before {
margin-left: -46px;
margin-right: 25px;
}
.ddoc .code_sample .code_lines .code {
color: #000;
}
.ddoc div.dlang {
margin: 10px 0 21px;
padding: 4px 0 2px 10px;
}
.ddoc div.dlang {
margin: 10px 0 21px;
padding: 4px 0 2px 10px;
}
.ddoc div.dlang {
border-left: 5px solid rgba(0, 155, 51, 0.2);
}
.ddoc .code_lines li::before {
color: rgba(128, 128, 128, 1);
content: counter(li, decimal);
counter-increment: li;
font-family: Menlo,monospace;
font-size: 0.9em;
margin-right: 16px;
}
.ddoc .code_lines li {
padding-left: 0;
white-space: pre-wrap;
}
.ddoc .code_lines li:only-of-type::before {
color: rgba(255, 255, 255, 1);
content: " ";
}
.ddoc .code_lines li:only-of-type {
color: rgba(255, 255, 255, 1);
content: " ";
}
.ddoc .code_lines li:nth-child(n+10) {
text-indent: -17px;
}
.ddoc .code_lines li:nth-child(n+10)::before {
margin-right: 12px;
}
.ddoc .graybox {
border: 1px solid rgba(233, 233, 233, 1);
border-collapse: collapse;
border-spacing: 0;
empty-cells: hide;
margin: 20px 0 36px;
text-align: left;
}
.ddoc .graybox p {
margin: 0;
min-width: 50px;
}
.ddoc td {
border: 1px solid rgba(233, 233, 233, 1);
margin: 0;
max-width: 260px;
padding: 5px 25px 5px 10px;
vertical-align: middle;
}
.punctuation {
color: rgba(0, 0, 0, 1);
}
.comment {
color: rgba(0, 131, 18, 1);
}
.operator {
color: #000;
}
.keyword {
color: rgba(170, 13, 145, 1);
}
.keyword_type {
color: rgba(170, 51, 145, 1);
}
.string_literal {
color: rgba(196, 26, 22, 1);
}
.ddoc_psuper_symbol {
color: rgba(92, 38, 153, 1);
}
.param {
color: rgba(0, 0, 0, 1);
}
.psymbol {
color: rgba(0, 0, 0, 1);
}
.ddoc_member_header .ddoc_header_anchor .code {
font-size: 1em;
}
</style>
</head>
<body id="ddoc_main" class="ddoc dlang">
<div class="content_wrapper">
<article class="module">
<h1 class="module_name">$(TITLE)</h1>
<section id="module_content">$(BODY)</section>
</article>
</div>
</body>
</html>
DDOC_MODULE_MEMBERS = <section class="section ddoc_module_members_section">
<div class="ddoc_module_members">
$(DDOC_MEMBERS $0)
</div>
</section>
DDOC_CLASS_MEMBERS = $(DDOC_MEMBERS $0)
DDOC_STRUCT_MEMBERS = $(DDOC_MEMBERS $0)
DDOC_ENUM_MEMBERS = $(DDOC_MEMBERS $0)
DDOC_TEMPLATE_MEMBERS = $(DDOC_MEMBERS $0)
DDOC_MEMBERS = <ul class="ddoc_members">
$0
</ul>
DDOC_MEMBER = <li class="ddoc_member">
$0
</li>
DDOC_MEMBER_HEADER = <div class="ddoc_member_header">
$0
</div>
DDOC_HEADER_ANCHOR = <div class="ddoc_header_anchor">
<a href="#$1" id="$1"><code class="code">$2</code></a>
</div>
DDOC_DECL = <div class="ddoc_decl">
<section class="section">
<div class="declaration">
<h4>Declaration</h4>
<div class="dlang">
<p class="para">
<code class="code">
$0
</code>
</p>
</div>
</div>
</section>
</div>
DDOC_ANCHOR = <span class="ddoc_anchor" id="$1"></span>
DDOC_DECL_DD = <div class="ddoc_decl">
$0
</div>
DDOC_SECTIONS = <section class="section ddoc_sections">
$0
</section>
DDOC_SUMMARY = <div class="ddoc_summary">
<p class="para">
$0
</p>
</div>
DDOC_DESCRIPTION = <div class="ddoc_description">
<h4>Discussion</h4>
<p class="para">
$0
</p>
</div>
DDOC_EXAMPLES = <div class="ddoc_examples">
<h4>Examples</h4>
<p class="para">
$0
</p>
</div>
DDOC_RETURNS = <div class="ddoc_returns">
<h4>Return Value</h4>
<p class="para">
$0
</p>
</div>
DDOC_PARAMS = <div class="ddoc_params">
<h4>Parameters</h4>
<table cellspacing="0" cellpadding="5" border="0" class="graybox">
<tbody>
$0
</tbody>
</table>
</div>
DDOC_PARAM_ROW = <tr class="ddoc_param_row">
$0
</tr>
DDOC_PARAM_ID = <td scope="ddoc_param_id">
<code class="code">
<em class="term">$0</em>
</code>
</td>
DDOC_PARAM_DESC = <td>
<div class="ddoc_param_desc">
<p class="para">
$0
</p>
</div>
</td>
DDOC_LICENSE = <div class="ddoc_license">
<h4>License</h4>
<p class="para">
$0
</p>
</div>
DDOC_AUTHORS = <div class="ddoc_authors">
<h4>Authors</h4>
<p class="para">
$0
</p>
</div>
DDOC_BUGS = <div class="ddoc_bugs">
<h4>Bugs</h4>
<p class="para">
$0
</p>
</div>
DDOC_COPYRIGHT = <div class="ddoc_copyright">
<h4>Copyright</h4>
<p class="para">
$0
</p>
</div>
DDOC_DATE = <div class="ddoc_date">
<h4>Date</h4>
<p class="para">
$0
</p>
</div>
DDOC_DEPRECATED = <div class="ddoc_deprecated">
<h4>Deprecated</h4>
<p class="para">
$0
</p>
</div>
DDOC_HISTORY = <div class="ddoc_history">
<h4>History</h4>
<p class="para">
$0
</p>
</div>
DDOC_SEE_ALSO = <div class="ddoc_see_also">
<h4>See Also</h4>
<p class="para">
$0
</p>
</div>
DDOC_STANDARDS = <div class="ddoc_standards">
<h4>Standards</h4>
<p class="para">
$0
</p>
</div>
DDOC_THROWS = <div class="ddoc_throws">
<h4>Throws</h4>
<p class="para">
$0
</p>
</div>
DDOC_VERSION = <div class="ddoc_version">
<h4>Version</h4>
<p class="para">
$0
</p>
</div>
DDOC_SECTION = <div class="ddoc_section">
<p class="para">
$0
</p>
</div>
DDOC_SECTION_H = <span class="ddoc_section_h">$0</span>
DDOC_DITTO = <br>
$0
DDOC_PSYMBOL = <code class="code">$0</code>
DDOC_ENUM_BASETYPE = $0
DDOC_PSUPER_SYMBOL = <span class="ddoc_psuper_symbol">$0</span>
DDOC_KEYWORD = <code class="code">$0</code>
DDOC_PARAM = <code class="code">$0</code>
DDOC_CONSTRAINT = $(DDOC_CONSTRAINT) if ($0)
DDOC_OVERLOAD_SEPARATOR = $0
DDOC_TEMPLATE_PARAM_LIST = $0
DDOC_TEMPLATE_PARAM = $0

View file

@ -0,0 +1,11 @@
--- dmd/src/dmd/mars.d
+++ dmd/src/dmd/mars.d
@@ -1374,7 +1374,7 @@ void addDefaultVersionIdentifiers()
}
else static if (TARGET.Linux)
{
- VersionCondition.addPredefinedGlobalIdent("CRuntime_Glibc");
+ VersionCondition.addPredefinedGlobalIdent("CRuntime_Musl");
}
if (global.params.isLP64)

View file

@ -0,0 +1,145 @@
From 034988a0db917719b59887d8017addba76076b1f Mon Sep 17 00:00:00 2001
From: Joakim <git@joakim.fea.st>
Date: Sat, 17 Feb 2018 14:25:07 +0530
Subject: [PATCH] Add needed changes to get all tests passing with Musl
---
.../allocator/building_blocks/region.d | 6 +++
std/socket.d | 44 +---------------------
std/stdio.d | 24 ++++++------
3 files changed, 19 insertions(+), 55 deletions(-)
diff --git a/std/experimental/allocator/building_blocks/region.d b/std/experimental/allocator/building_blocks/region.d
index 40a5387c64..c277498d1e 100644
--- phobos/std/experimental/allocator/building_blocks/region.d
+++ phobos/std/experimental/allocator/building_blocks/region.d
@@ -647,6 +647,12 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment)
assert((() nothrow @nogc => r2.deallocateAll())());
}
+version(CRuntime_Musl)
+{
+ // sbrk and brk are disabled in Musl:
+ // https://git.musl-libc.org/cgit/musl/commit/?id=7a995fe706e519a4f55399776ef0df9596101f93
+ // https://git.musl-libc.org/cgit/musl/commit/?id=863d628d93ea341b6a32661a1654320ce69f6a07
+} else:
private extern(C) void* sbrk(long) nothrow @nogc;
private extern(C) int brk(shared void*) nothrow @nogc;
diff --git a/std/socket.d b/std/socket.d
index 6a5e5ff2ba..8f0c8a225a 100644
--- phobos/std/socket.d
+++ phobos/std/socket.d
@@ -163,47 +163,7 @@ string formatSocketError(int err) @trusted
{
cs = strerror_r(err, buf.ptr, buf.length);
}
- else version (OSX)
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
- cs = buf.ptr;
- else
- return "Socket error " ~ to!string(err);
- }
- else version (FreeBSD)
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
- cs = buf.ptr;
- else
- return "Socket error " ~ to!string(err);
- }
- else version (NetBSD)
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
- cs = buf.ptr;
- else
- return "Socket error " ~ to!string(err);
- }
- else version (DragonFlyBSD)
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
- cs = buf.ptr;
- else
- return "Socket error " ~ to!string(err);
- }
- else version (Solaris)
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
- cs = buf.ptr;
- else
- return "Socket error " ~ to!string(err);
- }
- else version (CRuntime_Bionic)
+ else
{
auto errs = strerror_r(err, buf.ptr, buf.length);
if (errs == 0)
@@ -211,8 +171,6 @@ string formatSocketError(int err) @trusted
else
return "Socket error " ~ to!string(err);
}
- else
- static assert(0);
auto len = strlen(cs);
diff --git a/std/stdio.d b/std/stdio.d
index 16d34f0e94..9f0495d98c 100644
--- phobos/std/stdio.d
+++ phobos/std/stdio.d
@@ -44,38 +44,38 @@ version (CRuntime_Glibc)
version = GCC_IO;
version = HAS_GETDELIM;
}
-
-version (OSX)
+else version (CRuntime_Bionic)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
-
-version (FreeBSD)
+else version (CRuntime_Musl)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
-version (NetBSD)
+version (OSX)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
-
-version (DragonFlyBSD)
+else version (FreeBSD)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
-
-version (Solaris)
+else version (NetBSD)
{
version = GENERIC_IO;
- version = NO_GETDELIM;
+ version = HAS_GETDELIM;
}
-
-version (CRuntime_Bionic)
+else version (DragonFlyBSD)
+{
+ version = GENERIC_IO;
+ version = HAS_GETDELIM;
+}
+else version (Solaris)
{
version = GENERIC_IO;
version = NO_GETDELIM;

View file

@ -1,88 +1,105 @@
# Template file for 'dmd'
pkgname=dmd
version=2.077.0
revision=2
wrksrc="dmd2"
version=2.079.0
revision=1
create_wrksrc=yes
short_desc="The Digital Mars D compiler"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.digitalmars.com/d/2.0/"
license="Boost Software License 1.0"
distfiles="http://downloads.dlang.org/releases/2.x/${version}/dmd.${version}.linux.tar.xz
https://raw.githubusercontent.com/dlang/dmd/5f3bdcde7a870509a3e2f1af48909c62bf8a18e7/config.sh"
skip_extraction="config.sh"
checksum="54471d7c5fdb73dd38cd8ab1d8ac4cb6b7aca0d0d18e7a9f38dcafcb242732f4
778834ad25225c6656565b3c66437543ed40066b9e40fde657c4d632fd4e391c"
distfiles="
https://github.com/dlang/dmd/archive/v${version}.tar.gz>dmd-${version}.tar.gz
https://github.com/dlang/druntime/archive/v${version}.tar.gz>druntime-${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="e4fed191a05051dd262198ebbfd77e9e99fbad251b67b88b3394e2cca8a41893
531910210e29c938ecee8ff6f39d2d247e892cae71811a684a504504bf1ea29b
39cae5b9578925a9458654c64c9a85204b7598c685c2e48b7d4fcfc37d4a3550
75c3df4ba4e731ac0fa36a60cd04bbac05a2d79633f4602ad645f533847929ce"
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
_archbits=64
elif [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
_archbits=32
fi
case "$XBPS_TARGET_MACHINE" in
x86_64*) _archbits=64;;
i686*) _archbits=32;;
esac
only_for_archs="x86_64"
makedepends="dmd-bootstrap"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
conf_files="/etc/dmd.conf"
nopie=yes
hostmakedepends="curl"
provides="d-compiler-${version}_${revision}"
conflicts="dmd-bootstrap"
depends="libphobos>=${version} gcc"
post_extract() {
rm -rf dmd druntime phobos
mv dmd-${version} dmd
mv druntime-${version} druntime
mv phobos-${version} phobos
}
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
*-musl) patch -p0 < ${FILESDIR}/musl.patch
esac
}
do_build() {
cp ${XBPS_SRCDISTDIR}/${pkgname}-${version}/config.sh src
chmod +x src/config.sh
cd src
# missing file in archive for some reason?
mkdir -p res
cp ${FILESDIR}/default_ddoc_theme.ddoc res
local dmd
cd dmd
make ${makejobs} -f posix.mak MODEL=${_archbits} TARGET_CPU=X86 BUILD=release PIC=1
dmd=${wrksrc}/dmd/generated/linux/release/$_archbits/dmd
mkdir src
cp osmodel.mak src
make ${makejobs} -f posix.mak MODEL=${_archbits} AUTO_BOOTSTRAP=1 PIC=1
make ${makejobs} -C docs
cd ../druntime
make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=../dmd/dmd PIC=1
make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd BUILD=release PIC=1
cd ../phobos
make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=../dmd/dmd PIC=1
make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd BUILD=release PIC=1
}
do_install() {
vbin src/dmd/dmd
cd dmd
vbin generated/linux/release/$_archbits/dmd
vinstall ${FILESDIR}/dmd.conf 644 etc
vman man/man1/dmd.1
vman man/man1/rdmd.1
vman man/man5/dmd.conf.5
vman generated/docs/man/man1/dmd.1
vman generated/docs/man/man5/dmd.conf.5
}
vmkdir usr/share/d/samples
cp -r samples/d/* ${DESTDIR}/usr/share/d/samples/
dmd-doc_package() {
short_desc="Documentation and sample code for D programming language"
replaces="dmd-docs>=0"
license="Boost License"
find ${DESTDIR}/usr/share/d/samples -type f | xargs chmod 0644
pkg_install() {
cd dmd2
for f in ddemangle dumpobj obj2asm rdmd; do
vbin linux/bin${_archbits}/${f}
done
vmkdir usr/share/doc/d
vcopy samples 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="The phobos D standard library for DMD"
short_desc+=" - standard library"
license="Boost License"
conflicts="dmd-bootstrap"
pkg_install() {
vinstall ${wrksrc}/src/druntime/generated/linux/release/$_archbits/libdruntime.a 644 usr/lib libdruntime.a
vinstall ${wrksrc}/src/phobos/generated/linux/release/$_archbits/libphobos2.a 644 usr/lib libphobos2.a
vinstall ${wrksrc}/druntime/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}/src/phobos/{*.d,etc,std} ${PKGDESTDIR}/usr/include/d
cp -r ${wrksrc}/phobos/{*.d,etc,std} ${PKGDESTDIR}/usr/include/d
vmkdir usr/include/d/druntime
cp -r ${wrksrc}/src/druntime/import ${PKGDESTDIR}/usr/include/d/druntime
cp -r ${wrksrc}/druntime/import ${PKGDESTDIR}/usr/include/d/druntime
vmkdir usr/share/doc/d/
cp -r ${wrksrc}/html ${PKGDESTDIR}/usr/share/doc/d/
find ${PKGDESTDIR}/usr/share/doc/d -type f | xargs chmod 0644
vlicense ${wrksrc}/src/druntime/LICENSE
vlicense ${wrksrc}/druntime/LICENSE.txt
}
}