diff options
author | Anant Narayanan <anant@gentoo.org> | 2007-05-22 19:10:08 +0000 |
---|---|---|
committer | Anant Narayanan <anant@gentoo.org> | 2007-05-22 19:10:08 +0000 |
commit | 931e811b7d5fcbb08efbaa07d5b76b2d0f542685 (patch) | |
tree | b919c29b64c0f26627b5f427e13d9107971374f8 /dev-libs | |
download | d-931e811b7d5fcbb08efbaa07d5b76b2d0f542685.tar.gz d-931e811b7d5fcbb08efbaa07d5b76b2d0f542685.tar.bz2 d-931e811b7d5fcbb08efbaa07d5b76b2d0f542685.zip |
Add the D overlay, with phobos and tango to start with.
svn path=/d/; revision=7
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/phobos/Manifest | 8 | ||||
-rw-r--r-- | dev-libs/phobos/files/digest-phobos-1.014 | 3 | ||||
-rw-r--r-- | dev-libs/phobos/phobos-1.014.ebuild | 68 | ||||
-rw-r--r-- | dev-libs/tango/Manifest | 8 | ||||
-rw-r--r-- | dev-libs/tango/files/digest-tango-0.98 | 3 | ||||
-rw-r--r-- | dev-libs/tango/tango-0.98.ebuild | 230 |
6 files changed, 320 insertions, 0 deletions
diff --git a/dev-libs/phobos/Manifest b/dev-libs/phobos/Manifest new file mode 100644 index 0000000..d1f8f7e --- /dev/null +++ b/dev-libs/phobos/Manifest @@ -0,0 +1,8 @@ +DIST dmd.1.014.zip 4809385 RMD160 8c16cc82abee6cdd7208d18149bdb050e2461540 SHA1 823300dfb3e4693948191af05fc9918d72f8353a SHA256 810f60f4b934fa122d69d45b9301817157f4070ade1400ea05218d7e5e32b441 +EBUILD phobos-1.014.ebuild 1682 RMD160 7079fa3f71606728971d326e744c360de4d5c626 SHA1 b32fb467753613d82fce394d438914b45658b231 SHA256 98665c90824433c8136aa34dee88af7c0654200aec093ca4000e85a8b31a700e +MD5 55cc3f1d009de4782ecad08377799c07 phobos-1.014.ebuild 1682 +RMD160 7079fa3f71606728971d326e744c360de4d5c626 phobos-1.014.ebuild 1682 +SHA256 98665c90824433c8136aa34dee88af7c0654200aec093ca4000e85a8b31a700e phobos-1.014.ebuild 1682 +MD5 16ef1e95d5ab67afae5c2132981df57b files/digest-phobos-1.014 223 +RMD160 1701e5209b11d40a8422a3f182ce7f66f0af080a files/digest-phobos-1.014 223 +SHA256 71877c525cdc3320bb8cb4660c17bbb3f50379d2fb330ffd2da3729199d090e9 files/digest-phobos-1.014 223 diff --git a/dev-libs/phobos/files/digest-phobos-1.014 b/dev-libs/phobos/files/digest-phobos-1.014 new file mode 100644 index 0000000..4901997 --- /dev/null +++ b/dev-libs/phobos/files/digest-phobos-1.014 @@ -0,0 +1,3 @@ +MD5 e4c912d5a25bd5dca2d6e7dd1a8b3ee1 dmd.1.014.zip 4809385 +RMD160 8c16cc82abee6cdd7208d18149bdb050e2461540 dmd.1.014.zip 4809385 +SHA256 810f60f4b934fa122d69d45b9301817157f4070ade1400ea05218d7e5e32b441 dmd.1.014.zip 4809385 diff --git a/dev-libs/phobos/phobos-1.014.ebuild b/dev-libs/phobos/phobos-1.014.ebuild new file mode 100644 index 0000000..ed2734e --- /dev/null +++ b/dev-libs/phobos/phobos-1.014.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils + +DESCRIPTION="The Phobos standard library for DMD" +HOMEPAGE="http://www.digitalmars.com/d/" +SRC_URI="http://ftp.digitalmars.com/dmd.${PV}.zip" + +LICENSE="DMD" +RESTRICT="mirror nostrip" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +LOC="/opt/dmd" +S="${WORKDIR}" + +DEPEND=">=dev-lang/dmd-bin-1.014" +RDEPEND="" + +src_unpack() { + unpack ${A} + + # Remove unneccesary file + mv ${S}/dmd/src/phobos ${S}/ + rm -r ${S}/dmd ${S}/dm + mkdir -p ${S}/dmd/lib ${S}/dmd/src ${S}/dmd/bin + mv ${S}/phobos ${S}/dmd/src/ +} + +src_compile() { + cd ${S}/dmd/src/phobos + sed -i -e "s:DMD=.*:DMD=${LOC}/bin/dmd.bin:" linux.mak internal/gc/linux.mak + edos2unix linux.mak internal/gc/linux.mak + make -flinux.mak + cp libphobos.a ${S}/dmd/lib/ + + # Clean up + make -flinux.mak clean + rm internal/gc/*.o + + cd ${S}/dmd/bin + cat <<END > "dmd" +#!/bin/sh +${LOC}/bin/dmd.bin -I${LOC}/src/phobos -L${LOC}/lib/libphobos.a \$* +END +} + +src_install() { + cd ${S} + fperms guo=rx dmd/bin/dmd + mkdir "${D}/opt" + mv "${S}/dmd" "${D}/opt/dmd" +} + +pkg_postinst() { + einfo " " + einfo "The Phobos standard library has been built and " + einfo "enabled for your DMD compiler. Please modify " + einfo "/opt/dmd/bin/dmd as per your compiler requirements " + einfo "(as a replacement for dmd.conf) " + einfo " " + ewarn "*Please* run env-update and source /etc/profile " + ewarn "before using the D compiler! " + ewarn " " +} diff --git a/dev-libs/tango/Manifest b/dev-libs/tango/Manifest new file mode 100644 index 0000000..b60a78a --- /dev/null +++ b/dev-libs/tango/Manifest @@ -0,0 +1,8 @@ +DIST tango-0.98-src.tar.gz 1061913 RMD160 812cc624844dfe9fd8e5a2c333e6cbcdfc5f915f SHA1 79a65cc52a7d2e2ac17b4f266d6d26f60c257245 SHA256 bc04b0cfc8e0c69f845eea8e2d83e7eed1d6e006d892b96103372733caa7fc74 +EBUILD tango-0.98.ebuild 6144 RMD160 c5f82b779f02b74d4f2be29d3bbf7f22b82b6a85 SHA1 d2e8d1ec5889f23c1d0646f690ad286a600bf82e SHA256 1761f2e52a557820a86d579311521be9993ccf1d436f603e829c807c859cc41e +MD5 87eeb40da33da1ed56ce1315894f3ef2 tango-0.98.ebuild 6144 +RMD160 c5f82b779f02b74d4f2be29d3bbf7f22b82b6a85 tango-0.98.ebuild 6144 +SHA256 1761f2e52a557820a86d579311521be9993ccf1d436f603e829c807c859cc41e tango-0.98.ebuild 6144 +MD5 adaaaa74b3f502665772cc093697837b files/digest-tango-0.98 247 +RMD160 3af5b2b52506bc248890c3955ad7ae7d0c7c9882 files/digest-tango-0.98 247 +SHA256 f517a1f4d88e7cc8f6b890838d3a6f14cf9facd015fb0cb6190eab69e385aa11 files/digest-tango-0.98 247 diff --git a/dev-libs/tango/files/digest-tango-0.98 b/dev-libs/tango/files/digest-tango-0.98 new file mode 100644 index 0000000..5d479c7 --- /dev/null +++ b/dev-libs/tango/files/digest-tango-0.98 @@ -0,0 +1,3 @@ +MD5 9e2e5098420a3ea7481f9658dde008e8 tango-0.98-src.tar.gz 1061913 +RMD160 812cc624844dfe9fd8e5a2c333e6cbcdfc5f915f tango-0.98-src.tar.gz 1061913 +SHA256 bc04b0cfc8e0c69f845eea8e2d83e7eed1d6e006d892b96103372733caa7fc74 tango-0.98-src.tar.gz 1061913 diff --git a/dev-libs/tango/tango-0.98.ebuild b/dev-libs/tango/tango-0.98.ebuild new file mode 100644 index 0000000..7dff8ca --- /dev/null +++ b/dev-libs/tango/tango-0.98.ebuild @@ -0,0 +1,230 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils toolchain-funcs + +DESCRIPTION="Platform library for the D programming language" +HOMEPAGE="http://www.dsource.org/projects/tango/" +SRC_URI="http://downloads.dsource.org/projects/${PN}/${PV}/${P}-src.tar.gz" + +LICENSE="|| ( AFL-2.1 BSD )" +SLOT="0" +KEYWORDS="~x86" + +# Tango with GDC needs to be cleaned up +#IUSE="gdc" +IUSE="" + +DEPEND="!dev-libs/phobos" +RDEPEND="" +S=${WORKDIR}/${P}-src + +# Helper functions for compiling +tango_filter_file() { + FILE=$1 + if [ "`echo $FILE | grep win32`" -o "`echo $FILE | grep Win32`" ]; then + return 1 + fi + if [ "`echo $FILE | grep darwin`" ]; then + return 1 + fi + return 0 +} + +tango_compile_file() { + DC=$1 + FILENAME=$3 + OBJNAME=`echo $FILENAME | sed -e 's/\.d//' | sed -e 's/\//\./g'` + OBJNAME=${OBJNAME}.o + + if tango_filter_file $OBJNAME; then + $DC -c -inline -release -O -version=Posix -version=Tango -of$OBJNAME $FILENAME + ar -r lib/$2 $OBJNAME + rm $OBJNAME + fi +} + +tango_compile_library() { + cd ${S} + for fil in `find tango -name '*.d'` + do + tango_compile_file $1 $2 $fil + done + ranlib lib/$2 +} + +tango_compile_dmd() { + for f in "dmd-posix.mak common/tango/posix.mak compiler/dmd/posix.mak" + do + fperms guo=rw $f + sed -i -e "s:^DC=.*:DC=/opt/dmd/bin/dmd.bin:" $f + edos2unix $f + done + + OLDHOME=$HOME + export HOME=${S}/lib + make clean -fdmd-posix.mak + make lib doc install -fdmd-posix.mak || die "Compile failed!" + make clean -fdmd-posix.mak + export HOME=$OLDHOME + + tango_compile_library /opt/dmd/bin/dmd.bin libtango.a +} + +tango_compile_gdc() { + GDC_VER="`gdc --version | grep 'gdc' | sed 's/^.*gdc \([0-9]*\.[0-9]*\).*$/\1/'`" + GDC_MAJOR="`echo $GDC_VER | sed 's/\..*//'`" + GDC_MINOR="`echo $GDC_VER | sed 's/.*\.//'`" + + if [ "$GDC_MAJOR" = "0" -a "$GDC_MINOR" -lt "23" ]; then + eerror " " + eerror "This version of Tango requires GDC 0.23 or newer!" + eerror " " + die "Required version of GDC not found" + fi + + HOST_ARCH="`./compiler/gdc/config.guess | sed 's/-.*//'`" + ADD_CFLAGS= + if [ "$HOST_ARCH" = "powerpc" -a ! "`./compiler/gdc/config.guess | grep darwin`" ]; then + ADD_CFLAGS="-mregnames" + fi + + pushd ./compiler/gdc + ./configure || die "Configure failed!" + popd + + OLDHOME=$HOME + export HOME=${S}/lib + make clean -fgdc-posix.mak + make lib doc install -fgdc-posix.mak ADD_CFLAGS="$ADD_CFLAGS" || die "Compile failed!" + make clean -fgdc-posix.mak + export HOME=$OLDHOME + + tango_compile_library gdmd libgtango.a +} + +# Helper functions for installing +tango_install_dmd() { + LOC=/opt/dmd + cd ${S} + insinto ${LOC}/lib + doins ${S}/lib/*.a + insinto ${LOC}/include/d/tango + doins ${S}/object.di + mv ${S}/tango ${D}${LOC}/include/d/tango + mv ${S}/std ${D}${LOC}/include/d/tango + + cat <<END > "dmd" +#!/bin/sh +${LOC}/bin/dmd.bin -I${LOC}/include/d/tango -L${LOC}/lib/libtango.a -version=Tango -version=Posix \$* +END + fperms guo=rx dmd + mkdir ${D}${LOC}/bin + cp dmd ${D}${LOC}/bin +} + +tango_install_gdc() { + insinto /usr/$(get_libdir)/gcc/$CHOST/$(gcc-fullversion) + doins ${S}/lib/*.a + insinto /usr/include/d/$(gcc-fullversion) + doins ${S}/object.di + doins ${S}/tango/* +} + +pkg_setup() { + if use gdc; then + if ! built_with_use sys-devel/gcc d; then + eerror " " + eerror "You have enabled the gdc USE flag, but gcc was " + eerror "not compiled with the d USE flag. Either merge " + eerror "sys-devel/gcc with d enabled, or " + eerror "dev-lang/dmd-bin with the tango USE flag. " + eerror " " + die "No suitable D compiler found!" + else + if built_with_use dev-lang/dmd-bin tango; then + export ENABLE_LIBRARY="both" + einfo " " + einfo "dev-lang/dmd-bin with tango USE flag detected, " + einfo "the Tango standard library with be built and " + einfo "enabled for the DMD compiler. " + einfo " " + einfo "You have also used the gdc use flag, and " + einfo "Tango will be built and enabled for the GDC " + einfo "compiler. " + einfo " " + else + export ENABLE_LIBRARY="gdc" + einfo " " + einfo "The Tango standard library will be built and " + einfo "enabled for the GDC compiler. " + einfo " " + fi + fi + else + if ! built_with_use dev-lang/dmd-bin tango; then + eerror " " + eerror "dev-lang/dmd-bin was not built with the tango " + eerror "USE flag. Please enable it if you wish to use " + eerror "Tango with DMD. If you want to use Tango with " + eerror "GDC, please enable the gdc USE flag for this " + eerror "package. " + eerror " " + die "No suitable D compiler found!" + else + export ENABLE_LIBRARY="dmd" + einfo " " + einfo "the Tango standard library with be built and " + einfo "enabled for the DMD compiler. " + einfo " " + fi + fi +} + +src_compile() { + cd ${S}/lib + + case "$ENABLE_LIBRARY" in + + "dmd" ) + tango_compile_dmd + ;; + + "gdc" ) + tango_compile_gdc + ;; + + "both" ) + tango_compile_dmd + tango_compile_gdc + ;; + + esac +} + +src_install() { + case "$ENABLE_LIBRARY" in + + "dmd" ) + tango_install_dmd + ;; + + "gdc" ) + tango_install_gdc + ;; + + "both" ) + tango_install_dmd + tango_install_gdc + ;; + + esac +} + +pkg_postinst() { + einfo " " + einfo "*Please* run env-update && source /etc/profile " + einfo "before using your D compilers! " + einfo " " +} |