summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Leise <marco.leise@gmx.de>2012-04-21 11:29:30 +0200
committerMarco Leise <marco.leise@gmx.de>2012-04-21 11:29:30 +0200
commit131c652662f9ac278e82163e8857b0fd662a8191 (patch)
tree71e0f34c036896a060524a119551ab847e4fe507 /dev-lang
parentgames-misc/limbs-off: Add dodoc TODO (diff)
downloadsunrise-reviewed-131c652662f9ac278e82163e8857b0fd662a8191.tar.gz
sunrise-reviewed-131c652662f9ac278e82163e8857b0fd662a8191.tar.bz2
sunrise-reviewed-131c652662f9ac278e82163e8857b0fd662a8191.zip
dev-lang/dmd: version bump to dmd-2.059; keeping last 3 versions, until dmd2 is stable enough
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/dmd/ChangeLog12
-rw-r--r--dev-lang/dmd/Manifest14
-rw-r--r--dev-lang/dmd/Manifest.edited25
-rw-r--r--dev-lang/dmd/dmd-2.059.ebuild (renamed from dev-lang/dmd/dmd-2.056.ebuild)37
-rw-r--r--dev-lang/dmd/files/2.059-issue-7907.patch346
-rw-r--r--dev-lang/dmd/files/2.059-issue-7911.patch27
-rw-r--r--dev-lang/dmd/files/2.059-issue-7922.patch162
-rw-r--r--dev-lang/dmd/files/2.059-outOfMemoryError-undeprecation.patch19
-rw-r--r--dev-lang/dmd/files/2.059-std-path-sep-deprecation.patch26
-rw-r--r--dev-lang/dmd/files/dmd-2.056-makefile.patch105
-rw-r--r--dev-lang/dmd/files/dmd-2.059-makefile.patch80
11 files changed, 710 insertions, 143 deletions
diff --git a/dev-lang/dmd/ChangeLog b/dev-lang/dmd/ChangeLog
index e5680765f..7c868fa7a 100644
--- a/dev-lang/dmd/ChangeLog
+++ b/dev-lang/dmd/ChangeLog
@@ -2,6 +2,18 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*dmd-2.059 (21 Apr 2012)
+
+ 21 Apr 2012; Marco Leise (mleise) <marco.leise@gmx.de> -dmd-2.056.ebuild,
+ -files/dmd-2.056-makefile.patch, +dmd-2.059.ebuild,
+ +files/dmd-2.059-makefile.patch, +files/2.059-issue-7907.patch,
+ +files/2.059-issue-7911.patch,
+ +files/2.059-outOfMemoryError-undeprecation.patch,
+ +files/2.059-issue-7922.patch, +files/2.059-std-path-sep-deprecation.patch,
+ -Manifest.edited:
+ version bump to dmd-2.059; keeping last 3 versions, until dmd2 is stable
+ enough
+
16 Feb 2012; Marco Leise (mleise) <marco.leise@gmx.de>
files/dmd-2.058-makefile.patch:
cleaned up patch file
diff --git a/dev-lang/dmd/Manifest b/dev-lang/dmd/Manifest
index eae8827e3..baf9b1e59 100644
--- a/dev-lang/dmd/Manifest
+++ b/dev-lang/dmd/Manifest
@@ -1,18 +1,22 @@
+AUX 2.059-issue-7907.patch 9542 RMD160 53fdcc3a9f34edefa606551a43ea9963a97cfcd7 SHA1 ecdfed332a9e5d20d9007d26db21c0ae2f458950 SHA256 515861e0fd4e79b7cf1e3b401f2e32235d2bb4d3d7e7855e46da85925fe234ea
+AUX 2.059-issue-7911.patch 820 RMD160 f4ec6778383a4157eac6601d8025c8e012f49813 SHA1 4e22336ef741bce4a830b2e372323e66a3ec88c2 SHA256 ab15b4d821c902ff529ab97245ff954e66779b65ccfefcf6a638ae568ff66ffa
+AUX 2.059-issue-7922.patch 6229 RMD160 47670e99574de492486f076d5a12fd8edfd522fd SHA1 28bddbab8e65756acd1f9b05198dc68aeda255d2 SHA256 82c387f6321329a4763c689114d32e09ee9d0f4e92ed38c32f06f7948079d0fb
+AUX 2.059-outOfMemoryError-undeprecation.patch 553 RMD160 0d2a2a59f226879c20f319fc72c0b5fb6e996c5f SHA1 3c0dccfd8ab31625b832a03623b7b773acdb3a58 SHA256 6b36b490cce2a9bc72a28adaf85887f30cb26999189e1c84e32d68820e72713a
+AUX 2.059-std-path-sep-deprecation.patch 1378 RMD160 2f7f0f0be413bf03fb8c14c0124834f901d4ef61 SHA1 144cc4673796ce5115703f75a2c8031b14148ace SHA256 b196c8a274bb5bd9268311fa6bdd14ecf3c42cd711ef12f016d3addff4ab980b
AUX dmd-1.066-makefile.patch 16530 RMD160 b7196c46933dc0493a69340743fa74cbe48da20b SHA1 65960f6613393f35366da80767f39625eda246eb SHA256 df0c6db1578747b9cc5bbc9ccb14ab53599d7e2456d68f60d40ee98daa61dbb6
-AUX dmd-2.056-makefile.patch 2707 RMD160 68b07ed19b1e191c7820b7ef85cc4c4eff2c3f64 SHA1 11607841bd7caebc277e8bb4ce2a08e345ae7157 SHA256 532631f7f295dc722783f7d48208bd37981e81f18163a086ae78a5760970b477
AUX dmd-2.057-makefile.patch 2727 RMD160 64d9ea8c7172e6297d4f76bf92a9b274b922882f SHA1 4cee7d9ae5a582b6af4e76a23feec47404447ee0 SHA256 54d25d5715457b90908f6d9642cd10c23f56fa9a9f1db7874b08a69a209d7a5a
AUX dmd-2.058-makefile.patch 1843 RMD160 72eb04777293a0d77911add9cbdc72421ccbeb21 SHA1 bd406d37c2e788fc862aaa28daf211e70b304bc2 SHA256 e8cb107bd1943950f077c696275e01920b1f0351ebcf1734f7dc862eb3392a9c
+AUX dmd-2.059-makefile.patch 1843 RMD160 72eb04777293a0d77911add9cbdc72421ccbeb21 SHA1 bd406d37c2e788fc862aaa28daf211e70b304bc2 SHA256 e8cb107bd1943950f077c696275e01920b1f0351ebcf1734f7dc862eb3392a9c
AUX dmd.bashcomp 4486 RMD160 9d68ac6e7df0d6698decbcdf49b6b1625aa05546 SHA1 06fc9eb9e9a9070e5e0a13c046abfc5648319b34 SHA256 b679b0c676035eda48948eeb6c2a8184c6effdc97d8c98d1ca4b071f345e4ac6
AUX slot-compat.patch 376 RMD160 f8a2770f6994ebf056e40bbb6ecc6fd3cbec798e SHA1 6e25821964199378f568c601bbdf18c2ad1d7d00 SHA256 d9f1f19b158c3cc52e133751e834460b12a0fa003192d50ba40421bf9ff56763
AUX stackelf.patch 3527 RMD160 efa17b66952649e0fa64bb7fe73f58f7c01c6d4d SHA1 e723fefaaaa35122cc45b3882cea17b499fc9926 SHA256 56835f1bb5b5f33edbb2bdf650bdb9e459f3670db205b2aeb0a367a868517a96
DIST dmd.1.066.zip 8958349 RMD160 c65c32750b1bce9192d955f392de70ddf9667023 SHA1 9197d0a4ffda2021e860396e9a1c7f9225b678d8 SHA256 26c421fdeaa3f81397cb9be858b8829eb01ebe11d6874c133b2ba2de249775fb
-DIST dmd.2.056.zip 19678819 RMD160 d323972e326c113b8976a494d783389f8999c34a SHA1 1b0c80c1415b9fb22e992c6c8dcb5b40674cccfb SHA256 22aea9e97f271cf64fbcb71458fa3454b6eef4bb5a2ed7061f753a4e91c9f515
DIST dmd.2.057.zip 21798644 RMD160 e1d5e80c935123373a2fc037cc6118bc12e0503b SHA1 8b3124206669c7285b8081aa745187e27d3d01c7 SHA256 424878440f36a74a31486dd69ef154cc938307ae78b25b7fa4a9296c54436d1b
DIST dmd.2.058.zip 26266462 RMD160 63a67a91ae887a5eadc683e9ed70cfb9121602d5 SHA1 a8324d2c5da0616f609bd7dd4f3457bdff405fd2 SHA256 3bbfebf8d1288f6a6f021814680e77f0287fff45436dfe8e86117371d5557fea
+DIST dmd.2.059.zip 26217241 RMD160 02cb8dda0e3d2346d8e8994888e1ec41e47f97a5 SHA1 a9ad1a435f2c8cff9673bbec6c306b12ed463349 SHA256 47c712f9c47e0ac156362dfbd5e90f6ed63eb6ffbd0cc96c7db3f9d48ccd9a50
EBUILD dmd-1.066.ebuild 2252 RMD160 004b851bb80d68557b4e5930bfc0b06ca446b223 SHA1 ff0aaa4f0f518c779f8c0ce8665ad5851fc0eb71 SHA256 bc8776c7523f3b513b5879939d47261585b9af73271aa9fc3af1adeb8c5cd42f
-EBUILD dmd-2.056.ebuild 3963 RMD160 564a8f1d01728aa1323deb738762d34c436c3ed5 SHA1 ee188f106f569de0a4b05ae58d763f0657d14396 SHA256 9a39dc63bbfaab079acae1006d70d6bfc35f4a1ca4b13e07bdb430e290f7a9d8
EBUILD dmd-2.057.ebuild 3963 RMD160 564a8f1d01728aa1323deb738762d34c436c3ed5 SHA1 ee188f106f569de0a4b05ae58d763f0657d14396 SHA256 9a39dc63bbfaab079acae1006d70d6bfc35f4a1ca4b13e07bdb430e290f7a9d8
EBUILD dmd-2.058.ebuild 4367 RMD160 e2fe0e9bc1119ddc9c18b07a1d1f2098dfc47a3a SHA1 f31b57af2191ccdc7a31e200e7e17f3d5ec043e7 SHA256 779496298f67daf17f395efe8aff371bd44b445da9e99d04cd0018c3589311c6
-MISC ChangeLog 1900 RMD160 5f234abb4ea85092579fc8a4bd01f0b9867f94bc SHA1 bff13d8aa7ad1b1143ff0e950be285b867f4fad3 SHA256 fc356ae6897402e498f0ccbeb7deb7c67591c5fb42dd92128823e07417deabfe
-MISC Manifest.edited 3767 RMD160 131290aca493aa0b3afa8b84b702f9e437b0985a SHA1 4f9f909d3c2606e42f73090623fd04b93ceb2907 SHA256 a15e020f4751b64276ac98190e0ea1f9fa68355352ecd44a2ef9c995ca034521
+EBUILD dmd-2.059.ebuild 4626 RMD160 9c762e70a9911560cd763d69d920bd141b278e1f SHA1 b8df6eea5c092025417c4085845e220cd5319a2e SHA256 1229163a4e578785566412214396637a68b00bc42e44f5d92b59db39ec56b0c7
+MISC ChangeLog 2391 RMD160 c9305308c3dc8998dc078c693029e81f8ac43f64 SHA1 b9546ddf17efaed411d74c45452bfd202e996d34 SHA256 cd9e5a548375201f08a316b232e32f27afeb7ed7181ba635f8bb202834d4fb26
MISC metadata.xml 377 RMD160 5d6a0b9eb68275408943f0805dac078ecb41afee SHA1 3fa2a4ed5043b4a3c3ae317927b4598ba91e419c SHA256 5edc28143917c389d89a0af6623313c5f7ef81bf55dba92b39c611014fa6ed9e
diff --git a/dev-lang/dmd/Manifest.edited b/dev-lang/dmd/Manifest.edited
deleted file mode 100644
index 74a3fb498..000000000
--- a/dev-lang/dmd/Manifest.edited
+++ /dev/null
@@ -1,25 +0,0 @@
-AUX dmd-1.066-makefile.patch 16530 RMD160 b7196c46933dc0493a69340743fa74cbe48da20b SHA1 65960f6613393f35366da80767f39625eda246eb SHA256 df0c6db1578747b9cc5bbc9ccb14ab53599d7e2456d68f60d40ee98daa61dbb6
-AUX dmd-2.055-makefile.patch 2707 RMD160 68b07ed19b1e191c7820b7ef85cc4c4eff2c3f64 SHA1 11607841bd7caebc277e8bb4ce2a08e345ae7157 SHA256 532631f7f295dc722783f7d48208bd37981e81f18163a086ae78a5760970b477
-AUX dmd-2.056-makefile.patch 2707 RMD160 68b07ed19b1e191c7820b7ef85cc4c4eff2c3f64 SHA1 11607841bd7caebc277e8bb4ce2a08e345ae7157 SHA256 532631f7f295dc722783f7d48208bd37981e81f18163a086ae78a5760970b477
-AUX dmd-2.057-makefile.patch 2727 RMD160 64d9ea8c7172e6297d4f76bf92a9b274b922882f SHA1 4cee7d9ae5a582b6af4e76a23feec47404447ee0 SHA256 54d25d5715457b90908f6d9642cd10c23f56fa9a9f1db7874b08a69a209d7a5a
-AUX dmd.bashcomp 4486 RMD160 9d68ac6e7df0d6698decbcdf49b6b1625aa05546 SHA1 06fc9eb9e9a9070e5e0a13c046abfc5648319b34 SHA256 b679b0c676035eda48948eeb6c2a8184c6effdc97d8c98d1ca4b071f345e4ac6
-<<<<<<< .mine
-DIST dmd.1.066.zip 8958349 RMD160 c65c32750b1bce9192d955f392de70ddf9667023 SHA1 9197d0a4ffda2021e860396e9a1c7f9225b678d8 SHA256 26c421fdeaa3f81397cb9be858b8829eb01ebe11d6874c133b2ba2de249775fb
-=======
-AUX slot-compat.patch 376 RMD160 f8a2770f6994ebf056e40bbb6ecc6fd3cbec798e SHA1 6e25821964199378f568c601bbdf18c2ad1d7d00 SHA256 d9f1f19b158c3cc52e133751e834460b12a0fa003192d50ba40421bf9ff56763
-AUX stackelf.patch 3527 RMD160 efa17b66952649e0fa64bb7fe73f58f7c01c6d4d SHA1 e723fefaaaa35122cc45b3882cea17b499fc9926 SHA256 56835f1bb5b5f33edbb2bdf650bdb9e459f3670db205b2aeb0a367a868517a96
-DIST dmd.1.066.zip 8958349 RMD160 c65c32750b1bce9192d955f392de70ddf9667023 SHA1 9197d0a4ffda2021e860396e9a1c7f9225b678d8 SHA256 26c421fdeaa3f81397cb9be858b8829eb01ebe11d6874c133b2ba2de249775fb
->>>>>>> .r12755
-DIST dmd.2.055.zip 17137571 RMD160 c418324817e7d44bc76468e6d5e79089c82ca367 SHA1 13fb220db783cb47ad4cf3614d389894e92745c6 SHA256 11901f541ab3cce2ea245c1f609f456996eab1922c976483750c90d99c49816b
-DIST dmd.2.056.zip 19678819 RMD160 d323972e326c113b8976a494d783389f8999c34a SHA1 1b0c80c1415b9fb22e992c6c8dcb5b40674cccfb SHA256 22aea9e97f271cf64fbcb71458fa3454b6eef4bb5a2ed7061f753a4e91c9f515
-DIST dmd.2.057.zip 21798644 RMD160 e1d5e80c935123373a2fc037cc6118bc12e0503b SHA1 8b3124206669c7285b8081aa745187e27d3d01c7 SHA256 424878440f36a74a31486dd69ef154cc938307ae78b25b7fa4a9296c54436d1b
-<<<<<<< .mine
-EBUILD dmd-1.066.ebuild 2556 RMD160 45089660fcbfedeca2aa0c7d60a1b1c627e62ad8 SHA1 3b739ed153bb20d5a274ceaf2f018c68a58ac539 SHA256 7ad2238df8188378210c08e96d3d37c348525a81e0bef713075c327a98ff6043
-=======
-EBUILD dmd-1.066.ebuild 2252 RMD160 70fe6d6bfb5ccba7018a0665364e58f5f5fa0296 SHA1 c061eff99d6df75234439ea49d7ad4cfffd5f9fe SHA256 36f7f66aca610cbd15c22d8f1da4b99eea5f506c5fabc84b161a07b90683d889
->>>>>>> .r12755
-EBUILD dmd-2.055-r1.ebuild 3963 RMD160 f857cc63b917b154510687edb33fa8d9d6dcaa3e SHA1 fbcb3f0fc0e2bc907e059e9b884d88e77ce797be SHA256 61d094d8fdce5606d471321f50ac1879066485f597bd5ab5227e8b0ca10fe0a4
-EBUILD dmd-2.056.ebuild 3963 RMD160 f857cc63b917b154510687edb33fa8d9d6dcaa3e SHA1 fbcb3f0fc0e2bc907e059e9b884d88e77ce797be SHA256 61d094d8fdce5606d471321f50ac1879066485f597bd5ab5227e8b0ca10fe0a4
-EBUILD dmd-2.057.ebuild 3963 RMD160 f857cc63b917b154510687edb33fa8d9d6dcaa3e SHA1 fbcb3f0fc0e2bc907e059e9b884d88e77ce797be SHA256 61d094d8fdce5606d471321f50ac1879066485f597bd5ab5227e8b0ca10fe0a4
-MISC ChangeLog 1412 RMD160 d6ba6edc9607e55640dacc9898dcf785a16d45cf SHA1 b290dd92b4a9c38ccf737ebac095e580dff738fc SHA256 98b847fd4ced2940deebedde40d8d617eca4cca138befdf778904d02e474d19d
-MISC metadata.xml 332 RMD160 c37d44264a461109c3140ee764a96c40dd8c9826 SHA1 355e7fdc8d61d7b156ebe27f05ba184b64438e18 SHA256 ca3965824cec545a7ba488604bd8ac54a80035fe1b17d3984e4bcc454d60fbe6
diff --git a/dev-lang/dmd/dmd-2.056.ebuild b/dev-lang/dmd/dmd-2.059.ebuild
index bb10e8353..a0a7dcaaa 100644
--- a/dev-lang/dmd/dmd-2.056.ebuild
+++ b/dev-lang/dmd/dmd-2.059.ebuild
@@ -13,7 +13,7 @@ SRC_URI="http://ftp.digitalmars.com/${PN}.${PV}.zip"
# DMD supports amd64/x86 exclusively
KEYWORDS="-* ~amd64 ~x86"
SLOT="2"
-IUSE="multilib doc examples"
+IUSE="multilib doc examples tools"
# License doesn't allow redistribution
LICENSE="DMD"
@@ -32,7 +32,9 @@ rdos2unix() {
src_prepare() {
cd .. || die
- rm -r osx linux windows freebsd README.TXT || die "Failed to remove included binaries"
+ rm -r README.TXT windows freebsd osx linux/{lib32,lib64} \
+ linux/{bin32,bin64}/{README.TXT,dmd,dmd.conf} \
+ || die "Failed to remove included binaries"
# convert line-endings of file-types that start as cr-lf and are
# patched or installed later on
@@ -43,6 +45,11 @@ src_prepare() {
# misc patches for the build process
epatch "${FILESDIR}/${P}-makefile.patch"
+ epatch "${FILESDIR}/${PV}-issue-7907.patch"
+ epatch "${FILESDIR}/${PV}-issue-7911.patch"
+ epatch "${FILESDIR}/${PV}-issue-7922.patch"
+ epatch "${FILESDIR}/${PV}-std-path-sep-deprecation.patch"
+ epatch "${FILESDIR}/${PV}-outOfMemoryError-undeprecation.patch"
}
src_compile() {
@@ -90,7 +97,7 @@ src_install() {
cd "dmd" || die
cat > dmd.conf << EOF
[Environment]
-DFLAGS=-I/usr/include/phobos2 -I/usr/include/druntime -L-L--no-warn-search-mismatch -L--export-dynamic -L-lrt
+DFLAGS=-I/usr/include/phobos2 -I/usr/include/druntime -L--no-warn-search-mismatch -L--export-dynamic -L-lrt
EOF
insinto /etc
doins dmd.conf
@@ -106,6 +113,20 @@ EOF
use doc && dohtml -r ../html/*
+ if use tools; then
+ doman ../man/man1/dumpobj.1
+ doman ../man/man1/obj2asm.1
+ doman ../man/man1/rdmd.1
+
+ # Bundled pre-compiled tools
+ if use amd64; then
+ dobin ../linux/bin64/{dumpobj,obj2asm,rdmd}
+ fi
+ if use x86; then
+ dobin ../linux/bin32/{dumpobj,obj2asm,rdmd}
+ fi
+ fi
+
docompress -x /usr/share/doc/${PF}/samples/
insinto /usr/share/doc/${PF}/samples/
if use examples; then
@@ -114,18 +135,18 @@ EOF
# druntime & Phobos
if use amd64; then
- dolib.a "druntime/lib64/libdruntime.a"
- dolib.a "phobos/generated/linux/release64/libphobos2.a"
+ newlib.a "druntime/lib/libdruntime-linux64.a" "libdruntime.a"
+ dolib.a "phobos/generated/linux/release/64/libphobos2.a"
fi
if use x86 || (use amd64 && use multilib); then
use amd64 && multilib_toolchain_setup x86
- dolib.a "druntime/lib32/libdruntime.a"
- dolib.a "phobos/generated/linux/release32/libphobos2.a"
+ newlib.a "druntime/lib/libdruntime-linux32.a" "libdruntime.a"
+ dolib.a "phobos/generated/linux/release/32/libphobos2.a"
# TODO: restore target architecture
fi
# cleanup builds
- rm -r "druntime/obj"* "druntime/lib"* || die
+ rm -r "druntime/obj" "druntime/lib" || die
rm -r "phobos/generated" || die
# remove files that are not required
diff --git a/dev-lang/dmd/files/2.059-issue-7907.patch b/dev-lang/dmd/files/2.059-issue-7907.patch
new file mode 100644
index 000000000..e04d226e1
--- /dev/null
+++ b/dev-lang/dmd/files/2.059-issue-7907.patch
@@ -0,0 +1,346 @@
+diff -Nurp a/src/phobos/std/conv.d b/src/phobos/std/conv.d
+--- a/src/phobos/std/conv.d 2012-04-17 12:02:10.824875716 +0200
++++ b/src/phobos/std/conv.d 2012-04-17 12:15:10.654126508 +0200
+@@ -101,6 +101,12 @@ private
+ formatValue(w, src, f);
+ return w.data;
+ }
++
++ template isEnumStrToStr(S, T) // @@@Workaround@@@
++ {
++ enum isEnumStrToStr = isImplicitlyConvertible!(S, T) &&
++ is(S == enum) && isSomeString!T;
++ }
+ }
+
+ /**
+@@ -250,7 +256,7 @@ If the source type is implicitly convert
+ to) simply performs the implicit conversion.
+ */
+ T toImpl(T, S)(S value)
+- if (isImplicitlyConvertible!(S, T))
++ if (isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T))
+ {
+ alias isUnsigned isUnsignedInt;
+
+@@ -1032,8 +1038,7 @@ unittest
+
+ /// ditto
+ T toImpl(T, S)(S s)
+- if (!isImplicitlyConvertible!(S, T) &&
+- is(S == enum) &&
++ if (is(S == enum) &&
+ isSomeString!T)
+ {
+ return toStr!T(s);
+@@ -1042,21 +1047,26 @@ T toImpl(T, S)(S s)
+ unittest
+ {
+ debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
+- enum E { a, b, c }
+- assert(to! string(E.a) == "a"c);
+- assert(to!wstring(E.b) == "b"w);
+- assert(to!dstring(E.c) == "c"d);
+-
+- enum F : real { x = 1.414, y = 1.732, z = 2.236 }
+- assert(to! string(F.x) == "x"c);
+- assert(to!wstring(F.y) == "y"w);
+- assert(to!dstring(F.z) == "z"d);
++
++ enum EB { a = true }
++ enum EU { a = 0, b = 1, c = 2 } // base type is unsigned
++ enum EI { a = -1, b = 0, c = 1 } // base type is signed (bug 7909)
++ enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
++ enum EC { a = 'a', b = 'b' }
++ enum ES : string { a = "aaa", b = "bbb" }
++
++ foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES))
++ {
++ assert(to! string(E.a) == "a"c);
++ assert(to!wstring(E.a) == "a"w);
++ assert(to!dstring(E.a) == "a"d);
++ }
+
+ // Test an value not corresponding to an enum member.
+- auto o = cast(E)5;
+- assert(to! string(o) == "cast(E)5"c);
+- assert(to!wstring(o) == "cast(E)5"w);
+- assert(to!dstring(o) == "cast(E)5"d);
++ auto o = cast(EU)5;
++ assert(to! string(o) == "cast(EU)5"c);
++ assert(to!wstring(o) == "cast(EU)5"w);
++ assert(to!dstring(o) == "cast(EU)5"d);
+ }
+
+ /// ditto
+@@ -1073,7 +1083,7 @@ deprecated T toImpl(T, S)(S s, in T left
+
+ /// ditto
+ T toImpl(T, S)(S b)
+- if (is(Unqual!S == bool) &&
++ if (isBoolean!S &&
+ isSomeString!T)
+ {
+ return toStr!T(b);
+@@ -1090,7 +1100,7 @@ unittest
+
+ /// ditto
+ T toImpl(T, S)(S c)
+- if (isSomeChar!(Unqual!S) &&
++ if (isSomeChar!S &&
+ isSomeString!T)
+ {
+ return toStr!T(c);
+@@ -1132,7 +1142,7 @@ unittest
+
+ /// ditto
+ T toImpl(T, S)(S input)
+- if (isIntegral!S && isUnsigned!S &&
++ if (isIntegral!S &&
+ isSomeString!T)
+ {
+ return toStr!T(input);
+@@ -1149,26 +1159,7 @@ unittest
+ assert(to!string(to!Int(9)) == "9");
+ assert(to!string(to!Int(123)) == "123");
+ }
+-}
+-
+-/// ditto
+-T toImpl(T, S)(S value)
+- if (isIntegral!S && isSigned!S &&
+- isSomeString!T)
+-{
+- return toStr!T(value);
+-}
+
+-unittest
+-{
+- debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
+- assert(wtext(int.max) == "2147483647"w);
+- assert(wtext(int.min) == "-2147483648"w);
+- assert(to!string(0L) == "0");
+-}
+-
+-unittest
+-{
+ foreach (Int; TypeTuple!(byte, short, int, long))
+ {
+ debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
+@@ -1184,9 +1175,17 @@ unittest
+ }
+ }
+
++unittest
++{
++ debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
++ assert(wtext(int.max) == "2147483647"w);
++ assert(wtext(int.min) == "-2147483648"w);
++ assert(to!string(0L) == "0");
++}
++
+ /// ditto
+ T toImpl(T, S)(S value, uint radix)
+- if (isIntegral!(Unqual!S) &&
++ if (isIntegral!S &&
+ isSomeString!T)
+ in
+ {
+@@ -1194,7 +1193,7 @@ in
+ }
+ body
+ {
+- static if (!is(Unqual!S == ulong))
++ static if (!is(IntegralTypeOf!S == ulong))
+ {
+ enforce(radix >= 2 && radix <= 36, new ConvException("Radix error"));
+ if (radix == 10)
+@@ -2076,24 +2075,25 @@ Target parse(Target, Source)(ref Source
+ ~ to!string(s) ~ "'");
+ }
+
+-//@@@BUG4737@@@: typeid doesn't work for scoped enum with initializer
+-version(unittest)
+-{
+- private enum F : real { x = 1.414, y = 1.732, z = 2.236 }
+-}
+ unittest
+ {
+ debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
+- enum E { a, b, c }
+- assert(to!E("a"c) == E.a);
+- assert(to!E("b"w) == E.b);
+- assert(to!E("c"d) == E.c);
+
+- assert(to!F("x"c) == F.x);
+- assert(to!F("y"w) == F.y);
+- assert(to!F("z"d) == F.z);
++ enum EB : bool { a = true, b = false, c = a }
++ enum EU { a, b, c }
++ enum EI { a = -1, b = 0, c = 1 }
++ enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
++ enum EC : char { a = 'a', b = 'b', c = 'c' }
++ enum ES : string { a = "aaa", b = "bbb", c = "ccc" }
++
++ foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES))
++ {
++ assert(to!E("a"c) == E.a);
++ assert(to!E("b"w) == E.b);
++ assert(to!E("c"d) == E.c);
+
+- assertThrown!ConvException(to!E("d"));
++ assertThrown!ConvException(to!E("d"));
++ }
+ }
+
+ version (none) // TODO: BUG4744
+diff -Nurp a/src/phobos/std/stdio.d b/src/phobos/std/stdio.d
+--- a/src/phobos/std/stdio.d 2012-04-17 12:02:10.957874054 +0200
++++ b/src/phobos/std/stdio.d 2012-04-17 12:15:10.648126586 +0200
+@@ -665,19 +665,19 @@ arguments in text format to the file. */
+ foreach (arg; args)
+ {
+ alias typeof(arg) A;
+- static if (isSomeString!A && !is(A == enum))
++ static if (isSomeString!A)
+ {
+ put(w, arg);
+ }
+- else static if (isIntegral!A && !is(A == enum))
++ else static if (isIntegral!A)
+ {
+ toTextRange(arg, w);
+ }
+- else static if (isBoolean!A && !is(A == enum))
++ else static if (isBoolean!A)
+ {
+ put(w, arg ? "true" : "false");
+ }
+- else static if (isSomeChar!A && !is(A == enum))
++ else static if (isSomeChar!A)
+ {
+ put(w, arg);
+ }
+diff -Nurp a/src/phobos/std/traits.d b/src/phobos/std/traits.d
+--- a/src/phobos/std/traits.d 2012-04-17 12:02:10.897874804 +0200
++++ b/src/phobos/std/traits.d 2012-04-17 12:15:10.647126599 +0200
+@@ -2693,7 +2693,7 @@ unittest
+
+ /*
+ */
+-template BooleanTypeOf(T)
++template BooleanTypeOf(T) if (!is(T == enum))
+ {
+ inout(bool) idx( inout(bool) );
+ shared(inout bool) idx( shared(inout bool) );
+@@ -2727,7 +2727,7 @@ unittest
+
+ /*
+ */
+-template IntegralTypeOf(T)
++template IntegralTypeOf(T) if (!is(T == enum))
+ {
+ inout( byte) idx( inout( byte) );
+ inout( ubyte) idx( inout( ubyte) );
+@@ -2786,7 +2786,7 @@ unittest
+
+ /*
+ */
+-template FloatingPointTypeOf(T)
++template FloatingPointTypeOf(T) if (!is(T == enum))
+ {
+ inout( float) idx( inout( float) );
+ inout(double) idx( inout(double) );
+@@ -2825,7 +2825,7 @@ unittest
+
+ /*
+ */
+-template NumericTypeOf(T)
++template NumericTypeOf(T) if (!is(T == enum))
+ {
+ static if (is(IntegralTypeOf!T X))
+ alias X NumericTypeOf;
+@@ -2853,7 +2853,7 @@ unittest
+
+ /*
+ */
+-template UnsignedTypeOf(T)
++template UnsignedTypeOf(T) if (!is(T == enum))
+ {
+ static if (is(IntegralTypeOf!T X) &&
+ staticIndexOf!(Unqual!X, UnsignedIntTypeList) >= 0)
+@@ -2862,7 +2862,7 @@ template UnsignedTypeOf(T)
+ static assert(0, T.stringof~" is not an unsigned type.");
+ }
+
+-template SignedTypeOf(T)
++template SignedTypeOf(T) if (!is(T == enum))
+ {
+ static if (is(IntegralTypeOf!T X) &&
+ staticIndexOf!(Unqual!X, SignedIntTypeList) >= 0)
+@@ -2875,7 +2875,7 @@ template SignedTypeOf(T)
+
+ /*
+ */
+-template CharTypeOf(T)
++template CharTypeOf(T) if (!is(T == enum))
+ {
+ inout( char) idx( inout( char) );
+ inout(wchar) idx( inout(wchar) );
+@@ -2930,7 +2930,7 @@ unittest
+
+ /*
+ */
+-template StaticArrayTypeOf(T)
++template StaticArrayTypeOf(T) if (!is(T == enum))
+ {
+ inout(U[n]) idx(U, size_t n)( inout(U[n]) );
+
+@@ -2961,7 +2961,7 @@ unittest
+
+ /*
+ */
+-template DynamicArrayTypeOf(T)
++template DynamicArrayTypeOf(T) if (!is(T == enum))
+ {
+ inout(U[]) idx(U)( inout(U[]) );
+
+@@ -3001,7 +3001,7 @@ unittest
+
+ /*
+ */
+-template ArrayTypeOf(T)
++template ArrayTypeOf(T) if (!is(T == enum))
+ {
+ static if (is(StaticArrayTypeOf!T X))
+ alias X ArrayTypeOf;
+@@ -3017,7 +3017,7 @@ unittest
+
+ /*
+ */
+-template StringTypeOf(T) if (isSomeString!T)
++template StringTypeOf(T) if (!is(T == enum) && isSomeString!T)
+ {
+ alias ArrayTypeOf!T StringTypeOf;
+ }
+@@ -3047,7 +3047,7 @@ unittest
+
+ /*
+ */
+-template AssocArrayTypeOf(T)
++template AssocArrayTypeOf(T) if (!is(T == enum))
+ {
+ immutable(V [K]) idx(K, V)( immutable(V [K]) );
+
+@@ -3279,7 +3279,10 @@ Detect whether we can treat T as one of
+ */
+ template isSomeString(T)
+ {
+- enum isSomeString = isNarrowString!T || is(T : const(dchar[]));
++ static if (is(T == enum))
++ enum isSomeString = false;
++ else
++ enum isSomeString = isNarrowString!T || is(T : const(dchar[]));
+ }
+
+ unittest
diff --git a/dev-lang/dmd/files/2.059-issue-7911.patch b/dev-lang/dmd/files/2.059-issue-7911.patch
new file mode 100644
index 000000000..839e0bf27
--- /dev/null
+++ b/dev-lang/dmd/files/2.059-issue-7911.patch
@@ -0,0 +1,27 @@
+diff -Nurp a/src/dmd/attrib.c b/src/dmd/attrib.c
+--- a/src/dmd/attrib.c 2012-04-17 12:02:10.224883217 +0200
++++ b/src/dmd/attrib.c 2012-04-17 12:31:56.293554287 +0200
+@@ -1402,6 +1402,23 @@ void StaticIfDeclaration::setScope(Scope
+
+ // But do set the scope, in case we need it for forward referencing
+ Dsymbol::setScope(sc);
++
++ // Set the scopes for both the decl and elsedecl, as we don't know yet
++ // which will be selected, and the scope will be the same regardless
++ Dsymbols *d = decl;
++ for (int j = 0; j < 2; j++)
++ {
++ if (d)
++ {
++ for (size_t i = 0; i < d->dim; i++)
++ {
++ Dsymbol *s = (*d)[i];
++
++ s->setScope(sc);
++ }
++ }
++ d = elsedecl;
++ }
+ }
+
+ void StaticIfDeclaration::semantic(Scope *sc)
diff --git a/dev-lang/dmd/files/2.059-issue-7922.patch b/dev-lang/dmd/files/2.059-issue-7922.patch
new file mode 100644
index 000000000..0d5004d7d
--- /dev/null
+++ b/dev-lang/dmd/files/2.059-issue-7922.patch
@@ -0,0 +1,162 @@
+diff -Nurp a/src/dmd/declaration.c b/src/dmd/declaration.c
+--- a/src/dmd/declaration.c 2012-04-17 12:02:10.231883129 +0200
++++ b/src/dmd/declaration.c 2012-04-17 12:37:45.585187488 +0200
+@@ -1361,11 +1361,17 @@ Lnomatch:
+ e->op = TOKblit;
+ }
+ e->type = t;
+- (*pinit) = new CommaExp(loc, e, (*pinit));
+
+- /* Replace __ctmp being constructed with e1
++ /* Replace __ctmp being constructed with e1.
++ * We need to copy constructor call expression,
++ * because it may be used in other place.
+ */
+- dve->e1 = e1;
++ DotVarExp *dvx = (DotVarExp *)dve->copy();
++ dvx->e1 = e1;
++ CallExp *cx = (CallExp *)ce->copy();
++ cx->e1 = dvx;
++
++ (*pinit) = new CommaExp(loc, e, cx);
+ (*pinit) = (*pinit)->semantic(sc);
+ goto Ldtor;
+ }
+diff -Nurp a/src/dmd/opover.c b/src/dmd/opover.c
+--- a/src/dmd/opover.c 2012-04-17 12:02:10.226883191 +0200
++++ b/src/dmd/opover.c 2012-04-17 12:37:45.585187488 +0200
+@@ -354,9 +354,11 @@ Expression *UnaExp::op_overload(Scope *s
+ /* Rewrite op(e1) as:
+ * op(e1.aliasthis)
+ */
+- UnaExp *e = (UnaExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad->aliasthis->ident);
++ Expression *e = copy();
++ ((UnaExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+ #endif
+ }
+@@ -411,9 +413,11 @@ Expression *ArrayExp::op_overload(Scope
+ /* Rewrite op(e1) as:
+ * op(e1.aliasthis)
+ */
+- UnaExp *e = (UnaExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad->aliasthis->ident);
++ Expression *e = copy();
++ ((UnaExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+ }
+ return NULL;
+@@ -456,9 +460,11 @@ Expression *CastExp::op_overload(Scope *
+ /* Rewrite op(e1) as:
+ * op(e1.aliasthis)
+ */
+- UnaExp *e = (UnaExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad->aliasthis->ident);
++ Expression *e = copy();
++ ((UnaExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+ }
+ return NULL;
+@@ -714,9 +720,11 @@ L1:
+ /* Rewrite (e1 op e2) as:
+ * (e1.aliasthis op e2)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad1->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad1->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+
+ // Try alias this on second operand
+@@ -729,9 +737,11 @@ L1:
+ /* Rewrite (e1 op e2) as:
+ * (e1 op e2.aliasthis)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e2 = new DotIdExp(loc, e->e2, ad2->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e2 = new DotIdExp(loc, this->e2, ad2->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e2 = e2;
++ e = e->trySemantic(sc);
++ return e;
+ }
+ #endif
+ return NULL;
+@@ -883,9 +893,11 @@ Expression *BinExp::compare_overload(Sco
+ /* Rewrite (e1 op e2) as:
+ * (e1.aliasthis op e2)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad1->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad1->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+
+ // Try alias this on second operand
+@@ -894,9 +906,11 @@ Expression *BinExp::compare_overload(Sco
+ /* Rewrite (e1 op e2) as:
+ * (e1 op e2.aliasthis)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e2 = new DotIdExp(loc, e->e2, ad2->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e2 = new DotIdExp(loc, this->e2, ad2->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e2 = e2;
++ e = e->trySemantic(sc);
++ return e;
+ }
+
+ return NULL;
+@@ -1131,9 +1145,11 @@ L1:
+ /* Rewrite (e1 op e2) as:
+ * (e1.aliasthis op e2)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e1 = new DotIdExp(loc, e->e1, ad1->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e1 = new DotIdExp(loc, this->e1, ad1->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e1 = e1;
++ e = e->trySemantic(sc);
++ return e;
+ }
+
+ // Try alias this on second operand
+@@ -1143,9 +1159,11 @@ L1:
+ /* Rewrite (e1 op e2) as:
+ * (e1 op e2.aliasthis)
+ */
+- BinExp *e = (BinExp *)syntaxCopy();
+- e->e2 = new DotIdExp(loc, e->e2, ad2->aliasthis->ident);
+- return e->trySemantic(sc);
++ Expression *e2 = new DotIdExp(loc, this->e2, ad2->aliasthis->ident);
++ Expression *e = copy();
++ ((BinExp *)e)->e2 = e2;
++ e = e->trySemantic(sc);
++ return e;
+ }
+ #endif
+ return NULL;
diff --git a/dev-lang/dmd/files/2.059-outOfMemoryError-undeprecation.patch b/dev-lang/dmd/files/2.059-outOfMemoryError-undeprecation.patch
new file mode 100644
index 000000000..47d96f6ea
--- /dev/null
+++ b/dev-lang/dmd/files/2.059-outOfMemoryError-undeprecation.patch
@@ -0,0 +1,19 @@
+diff -Nurp a/src/phobos/std/path.d b/src/phobos/std/path.d
+--- a/src/phobos/std/path.d 2012-04-17 12:02:10.980873765 +0200
++++ b/src/phobos/std/path.d 2012-04-17 13:43:17.035037653 +0200
+@@ -59,6 +59,7 @@ version(Posix)
+ import core.stdc.errno;
+ import core.sys.posix.pwd;
+ import core.sys.posix.stdlib;
++ private import core.exception : onOutOfMemoryError;
+ }
+
+
+@@ -2795,7 +2796,6 @@ deprecated:
+ version(Posix)
+ {
+ private import core.sys.posix.pwd;
+- private import core.exception : onOutOfMemoryError;
+ }
+
+ version(Windows)
diff --git a/dev-lang/dmd/files/2.059-std-path-sep-deprecation.patch b/dev-lang/dmd/files/2.059-std-path-sep-deprecation.patch
new file mode 100644
index 000000000..79c5bc33b
--- /dev/null
+++ b/dev-lang/dmd/files/2.059-std-path-sep-deprecation.patch
@@ -0,0 +1,26 @@
+diff -Nurp a/src/phobos/std/datetime.d b/src/phobos/std/datetime.d
+--- a/src/phobos/std/datetime.d 2012-04-17 12:02:10.776876316 +0200
++++ b/src/phobos/std/datetime.d 2012-04-17 13:37:56.468045292 +0200
+@@ -29286,7 +29286,7 @@ assert(tz.dstName == "PDT");
+ version(Posix)
+ auto file = tzDatabaseDir ~ name;
+ else version(Windows)
+- auto file = tzDatabaseDir ~ replace(strip(name), "/", sep);
++ auto file = tzDatabaseDir ~ replace(strip(name), "/", dirSeparator);
+
+ enforce(file.exists, new DateTimeException(format("File %s does not exist.", file)));
+ enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
+@@ -29595,10 +29595,10 @@ assert(tz.dstName == "PDT");
+ version(Posix)
+ subName = strip(subName);
+ else version(Windows)
+- subName = replace(strip(subName), "/", sep);
++ subName = replace(strip(subName), "/", dirSeparator);
+
+- if(!tzDatabaseDir.endsWith(sep))
+- tzDatabaseDir ~= sep;
++ if(!tzDatabaseDir.endsWith(dirSeparator))
++ tzDatabaseDir ~= dirSeparator;
+
+ enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
+ enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
diff --git a/dev-lang/dmd/files/dmd-2.056-makefile.patch b/dev-lang/dmd/files/dmd-2.056-makefile.patch
deleted file mode 100644
index 01474b732..000000000
--- a/dev-lang/dmd/files/dmd-2.056-makefile.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- dmd2/src/dmd/posix.mak.orig 2011-09-08 05:10:14.000000000 +0200
-+++ dmd2/src/dmd/posix.mak 2011-09-14 15:29:04.635180684 +0200
-@@ -29,7 +29,7 @@ C=backend
- TK=tk
- ROOT=root
-
--MODEL=32
-+MODEL?=32
-
- ifeq (OSX,$(TARGET))
- ## See: http://developer.apple.com/documentation/developertools/conceptual/cross_development/Using/chapter_3_section_2.html#//apple_ref/doc/uid/20002000-1114311-BABGCAAB
---- dmd2/src/druntime/posix.mak.orig 2011-09-01 21:22:06.000000000 +0200
-+++ dmd2/src/druntime/posix.mak 2011-09-14 15:29:04.636180672 +0200
-@@ -20,21 +20,21 @@ ifeq (,$(OS))
- endif
- endif
-
--DMD=dmd
-+DMD?=dmd
-
- DOCDIR=doc
- IMPDIR=import
-
--MODEL=32
-+MODEL?=32
-
- DFLAGS=-m$(MODEL) -O -release -inline -nofloat -w -d -Isrc -Iimport
- UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d -Isrc -Iimport
-
- CFLAGS=-m$(MODEL) -O
-
--OBJDIR=obj
-+OBJDIR=obj$(MODEL)
- DRUNTIME_BASE=druntime
--DRUNTIME=lib/lib$(DRUNTIME_BASE).a
-+DRUNTIME=lib$(MODEL)/lib$(DRUNTIME_BASE).a
-
- DOCFMT=
-
---- dmd2/src/phobos/etc/c/zlib/gzio.c.orig 2010-09-16 22:27:48.000000000 +0200
-+++ dmd2/src/phobos/etc/c/zlib/gzio.c 2011-09-14 15:29:29.412870920 +0200
-@@ -8,6 +8,7 @@
- /* @(#) $Id$ */
-
- #include <stdio.h>
-+#include <errno.h>
-
- #include "zutil.h"
-
---- dmd2/src/phobos/posix.mak.orig 2011-09-08 05:10:16.000000000 +0200
-+++ dmd2/src/phobos/posix.mak 2011-09-14 15:29:04.638180648 +0200
-@@ -48,7 +48,7 @@ endif
- DRUNTIME_PATH = ../druntime
- ZIPFILE = phobos.zip
- ROOT_OF_THEM_ALL = generated
--ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)/$(MODEL)
-+ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)$(MODEL)
- # Documentation-related stuff
- DOCSRC = ../d-programming-language.org
- WEBSITE_DIR = ../web
-@@ -61,8 +61,6 @@ DDOCFLAGS=-m$(MODEL) -d -c -o- -version=
-
- # Variable defined in an OS-dependent manner (see below)
- CC =
--DMD =
--DDOC =
- CFLAGS =
- DFLAGS =
-
-@@ -75,7 +73,7 @@ MAKEFILE:=$(lastword $(MAKEFILE_LIST))
-
- # Set DRUNTIME name and full path
- ifeq (,$(findstring win,$(OS)))
-- DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime.a
-+ DRUNTIME = $(DRUNTIME_PATH)/lib$(MODEL)/libdruntime.a
- else
- DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
- endif
-@@ -83,14 +81,14 @@ endif
- # Set CC and DMD
- ifeq ($(OS),win32wine)
- CC = wine dmc.exe
-- DMD = wine dmd.exe
-+ DMD ?= wine dmd.exe
- RUN = wine
- else
- ifeq ($(OS),win32remote)
-- DMD = ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
-+ DMD ?= ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
- CC = ssh 206.125.170.138 "cd code/dmd/phobos && dmc"
- else
-- DMD = dmd
-+ DMD ?= dmd
- ifeq ($(OS),win32)
- CC = dmc
- else
-@@ -141,7 +139,7 @@ else
- endif
-
- # Set DDOC, the documentation generator
--DDOC=dmd
-+DDOC?=$(DMD)
-
- # Set LIB, the ultimate target
- ifeq (,$(findstring win,$(OS)))
diff --git a/dev-lang/dmd/files/dmd-2.059-makefile.patch b/dev-lang/dmd/files/dmd-2.059-makefile.patch
new file mode 100644
index 000000000..0505f48eb
--- /dev/null
+++ b/dev-lang/dmd/files/dmd-2.059-makefile.patch
@@ -0,0 +1,80 @@
+The patches allow for MODEL, DMD (compiler for the library) and
+DDOC (documentation generator) to be overriden on the command line.
+The patch to gzio.c adds the missing errno.h include, to make the code portable:
+http://d.puremagic.com/issues/show_bug.cgi?id=5463
+--- dmd2/src/dmd/posix.mak
++++ dmd2/src/dmd/posix.mak
+@@ -29,7 +29,7 @@
+ TK=tk
+ ROOT=root
+
+-MODEL=32
++MODEL?=32
+
+ ifeq (OSX,$(TARGET))
+ ## See: http://developer.apple.com/documentation/developertools/conceptual/cross_development/Using/chapter_3_section_2.html#//apple_ref/doc/uid/20002000-1114311-BABGCAAB
+--- dmd2/src/druntime/posix.mak
++++ dmd2/src/druntime/posix.mak
+@@ -20,12 +20,12 @@
+ endif
+ endif
+
+-DMD=dmd
++DMD?=dmd
+
+ DOCDIR=doc
+ IMPDIR=import
+
+-MODEL=32
++MODEL?=32
+
+ DFLAGS=-m$(MODEL) -O -release -inline -nofloat -w -d -Isrc -Iimport -property
+ UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d -Isrc -Iimport -property
+--- dmd2/src/phobos/etc/c/zlib/gzio.c
++++ dmd2/src/phobos/etc/c/zlib/gzio.c
+@@ -8,6 +8,7 @@
+ /* @(#) $Id$ */
+
+ #include <stdio.h>
++#include <errno.h>
+
+ #include "zutil.h"
+
+--- dmd2/src/phobos/posix.mak
++++ dmd2/src/phobos/posix.mak
+@@ -61,8 +61,6 @@
+
+ # Variable defined in an OS-dependent manner (see below)
+ CC =
+-DMD =
+-DDOC =
+ CFLAGS =
+ DFLAGS =
+
+@@ -83,14 +81,14 @@
+ # Set CC and DMD
+ ifeq ($(OS),win32wine)
+ CC = wine dmc.exe
+- DMD = wine dmd.exe
++ DMD ?= wine dmd.exe
+ RUN = wine
+ else
+ ifeq ($(OS),win32remote)
+- DMD = ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
++ DMD ?= ssh 206.125.170.138 "cd code/dmd/phobos && dmd"
+ CC = ssh 206.125.170.138 "cd code/dmd/phobos && dmc"
+ else
+- DMD = dmd
++ DMD ?= dmd
+ ifeq ($(OS),win32)
+ CC = dmc
+ else
+@@ -141,7 +139,7 @@
+ endif
+
+ # Set DDOC, the documentation generator
+-DDOC=$(DMD)
++DDOC?=$(DMD)
+
+ # Set LIB, the ultimate target
+ ifeq (,$(findstring win,$(OS)))