Hi all,
I've prepared a page descibing the installation of DMD (Digital Mars D). That
is a compiler for a relative young language called D. It aims to combine the
benefits of C, C++, Java and such in one language while keeping the language
simple.
I've coded some programs already with D, most to learn D, and I feel quite
comfortable with the language. Even larger projects are easy to manage. Well
yes, that may depend on personal taste.
Do you think that this should go into the book (in the "Programming" section)?
I've attached a patch which would add the page - you may want to have a look
to it and feedbacks would be appreciated.
--
Thomas
diff -Naur '--exclude=.svn' '--exclude=tmp' BLFS.orig/trunk/BOOK/general/prog/dmd.xml BLFS/trunk/BOOK/general/prog/dmd.xml
--- BLFS.orig/trunk/BOOK/general/prog/dmd.xml 1970-01-01 01:00:00.000000000 +0100
+++ BLFS/trunk/BOOK/general/prog/dmd.xml 2013-03-03 08:36:31.028965159 +0100
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % general-entities SYSTEM "../../general.ent">
+ %general-entities;
+
+ <!ENTITY DMD-download-http "http://downloads.dlang.org.s3-website-us-east-1.amazonaws.com/releases/2013/dmd.&dmd-version;.zip">
+ <!ENTITY DMD-download-ftp " ">
+ <!ENTITY DMD-md5sum "fd2211206532ab41a8aef764a9225d3c">
+ <!ENTITY DMD-size "31 MB">
+ <!ENTITY DMD-buildsize "225 MB" >
+ <!ENTITY DMD-time "0.8 SBU">
+]>
+
+<sect1 id="DMD" xreflabel="DMD-&dmd-version;">
+ <?dbhtml filename="DMD.html" ?>
+
+ <sect1info>
+ <othername>$LastChangedBy$</othername>
+ <date>$Date$</date>
+ </sect1info>
+
+ <title>DMD-&dmd-version;</title>
+
+ <indexterm zone="DMD">
+ <primary sortas="a-DMD">DMD</primary>
+ </indexterm>
+
+ <sect2 role="package">
+ <title>Introduction to DMD</title>
+
+ <para><application>DMD</application> (Digital Mars D) is the reference
+ implementation of D. The language D has been designed to combine all
+ the good features of C, C++, C#, Java and such but keep the language
+ as simple as possible.</para>
+
+ &lfs73_checked;
+
+ <bridgehead renderas="sect3">Package Information</bridgehead>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para>Download (HTTP): <ulink url="&DMD-download-http;"/></para>
+ </listitem>
+ <listitem>
+ <para>Download (FTP): <ulink url="&DMD-download-ftp;"/></para>
+ </listitem>
+ <listitem>
+ <para>Download MD5 sum: &DMD-md5sum;</para>
+ </listitem>
+ <listitem>
+ <para>Download size: &DMD-size;</para>
+ </listitem>
+ <listitem>
+ <para>Estimated disk space required: &DMD-buildsize;</para>
+ </listitem>
+ <listitem>
+ <para>Estimated build time: &DMD-time;</para>
+ </listitem>
+ </itemizedlist>
+
+ <bridgehead renderas="sect3">Additional Downloads</bridgehead>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para>Useful tools: <ulink
+ url="https://github.com/D-Programming-Language/tools/archive/&dmd-version;.zip"/></para>
+ </listitem>
+ </itemizedlist>
+
+ <para condition="html" role="usernotes">User Notes:
+ <ulink url="&blfs-wiki;/dmd"/></para>
+
+ </sect2>
+
+ <sect2 role="installation">
+ <title>Installation of DMD</title>
+
+ <para>Prepare the installation of <application>DMD</application> by
+ running the following commands:</para>
+
+<screen><userinput>case `uname -m` in
+ x86_64) MODEL=64 ;;
+ *) MODEL=32 ;;
+esac &&
+echo "&dmd-version;" > src/VERSION</userinput></screen>
+
+ <para>Install <application>DMD</application> by running
+ the following commands:</para>
+
+ <para>Compile the D compiler:</para>
+<screen><userinput>cd src/dmd &&
+make MODEL=${MODEL} -f posix.mak</userinput></screen>
+
+ <para>Create the D runtime:</para>
+<screen><userinput>cd ../druntime &&
+make MODEL=${MODEL} -f posix.mak DMD=../dmd/dmd &&
+cd ../phobos &&
+make MODEL=${MODEL} -f posix.mak DMD=../dmd/dmd</userinput></screen>
+
+<!--TODO: thats not true: -->
+ <para>This package does not come with a test suite.</para>
+
+ <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>cd .. &&
+install -v -m755 dmd/dmd /usr/bin/ &&
+install -v -m644 druntime/lib/libdruntime-linux${MODEL}.a /usr/lib/ &&
+install -v -m644 phobos/generated/linux/release/${MODEL}/libphobos2.a /usr/lib/ &&
+install -v -d /usr/include/d/druntime &&
+cp -v -r phobos/{*.d,etc,std} /usr/include/d/ &&
+cp -v -r druntime/import /usr/include/d/druntime/</userinput></screen>
+
+ <para>Install the documentation with the following instructions
+ as the <systemitem class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>cd .. &&
+install -v -d /usr/share/doc/d &&
+cp -v -r html /usr/share/doc/d/ &&
+install -v -m644 src/druntime/LICENSE /usr/share/doc/d/LICENSE &&
+
+install -v -d /usr/share/man/man1 &&
+for man in man/man1/*.1; do
+ install -v -m644 $man /usr/share/man/man1/
+done &&
+install -v -d /usr/share/man/man5 &&
+for man in man/man1/*.5; do
+ install -v -m644 $man /usr/share/man/man5/
+done &&
+
+install -v -d /usr/share/doc/d/samples &&
+cp -v -R samples/d/* /usr/share/doc/d/samples/</userinput></screen>
+
+ <para>Create a configuration file which sets the default flags. This
+ is used by default to set the search pathes for the D compiler:</para>
+
+<screen><userinput>cat > /etc/dmd.conf <<EOF
+[Environment]
+DFLAGS=-I/usr/include/d -I/usr/include/d/druntime/import -L-L/usr/lib -L--no-warn-search-mismatch -L--export-dynamic
+EOF
+</userinput></screen>
+
+ <para>Now that the <application>DMD</application> compiler is
+ in place, some useful tools which belongs to the
+ <application>DMD</application> package can be built. Install the
+ tools by running following commands:</para>
+
+<screen><userinput>cd src &&
+unzip ../../&dmd-version;.zip &&
+cd tools-&dmd-version; &&
+make MODEL=${MODEL} -f posix.mak DMD=../dmd/dmd</userinput></screen>
+
+ <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>make PREFIX=/usr/bin -f posix.mak install</userinput></screen>
+
+ </sect2>
+
+ <sect2 role="content">
+ <title>Contents</title>
+
+ <segmentedlist>
+ <segtitle>Installed Programs</segtitle>
+ <segtitle>Installed Libraries</segtitle>
+ <segtitle>Installed Directory</segtitle>
+
+ <seglistitem>
+ <seg>dmd, catdoc, ddemangle, detab, dget, rdmd, tolf</seg>
+ <seg>libdruntime-linux*.a, libphobos2.a</seg>
+ <seg>/usr/include/d, /usr/share/doc/d</seg>
+ </seglistitem>
+ </segmentedlist>
+
+ <variablelist>
+ <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+ <?dbfo list-presentation="list"?>
+ <?dbhtml list-presentation="table"?>
+
+ <varlistentry id="dmd-prog">
+ <term><command>dmd</command></term>
+ <listitem>
+ <para>is the D compiler.</para>
+ <indexterm zone="DMD dmd-prog">
+ <primary sortas="b-dmd">dmd</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="catdoc">
+ <term><command>catdoc</command></term>
+ <listitem>
+ <para>is a tool to concatenate Ddoc files.</para>
+ <indexterm zone="DMD catdoc">
+ <primary sortas="b-catdoc">catdoc</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="ddemangle">
+ <term><command>ddemangle</command></term>
+ <listitem>
+ <para>is a tool to demangle D symbols</para>
+ <indexterm zone="DMD ddemangle">
+ <primary sortas="b-ddemangle">ddemangle</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="detab">
+ <term><command>detab</command></term>
+ <listitem>
+ <para>is a tool to replace tabs by spaces</para>
+ <indexterm zone="DMD detab">
+ <primary sortas="b-detab">detab</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="dget">
+ <term><command>dget</command></term>
+ <listitem>
+ <para>is a tool clone D source repositories</para>
+ <indexterm zone="DMD dget">
+ <primary sortas="b-dget">dget</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="rdmd">
+ <term><command>rdmd</command></term>
+ <listitem>
+ <para>is a tool which allows D programs run as scripts. Add <command>#!/usr/bin/rdmd</command>
+ as the first line in your D source.</para>
+ <indexterm zone="DMD rdmd">
+ <primary sortas="b-rdmd">rdmd</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="tolf">
+ <term><command>tolf</command></term>
+ <listitem>
+ <para>is a tool to fix line ends in source files</para>
+ <indexterm zone="DMD tolf">
+ <primary sortas="b-tolf">tolf</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </sect2>
+
+</sect1>
diff -Naur '--exclude=.svn' '--exclude=tmp' BLFS.orig/trunk/BOOK/general/prog/prog.xml BLFS/trunk/BOOK/general/prog/prog.xml
--- BLFS.orig/trunk/BOOK/general/prog/prog.xml 2013-01-26 10:12:36.017859136 +0100
+++ BLFS/trunk/BOOK/general/prog/prog.xml 2013-03-02 08:52:17.339733772 +0100
@@ -28,6 +28,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cvs.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cvsserver.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dejagnu.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dmd.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="doxygen.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
diff -Naur '--exclude=.svn' '--exclude=tmp' BLFS.orig/trunk/BOOK/general.ent BLFS/trunk/BOOK/general.ent
--- BLFS.orig/trunk/BOOK/general.ent 2013-03-03 08:37:52.271500488 +0100
+++ BLFS/trunk/BOOK/general.ent 2013-03-03 08:37:45.308000811 +0100
@@ -397,6 +397,7 @@
<!ENTITY cmake-version "2.8.10.2">
<!ENTITY cvs-version "1.11.23">
<!ENTITY dejagnu-version "1.5">
+<!ENTITY dmd-version "2.062">
<!ENTITY doxygen-version "1.8.3.1">
<!ENTITY expect-version "5.45">
<!ENTITY gcc-version "4.7.2">
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page