summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heim <phreak@gentoo.org>2007-04-18 06:27:54 +0000
committerChristian Heim <phreak@gentoo.org>2007-04-18 06:27:54 +0000
commitbd0151e4d2f5745247de0560b3ebe7a672582d2b (patch)
tree35742ddbe44122044b845cbb78f75d684928d328
parentRemoving dev-util/quilt from my overlay, as its updated in the main tree now. (diff)
downloadphreak-bd0151e4d2f5745247de0560b3ebe7a672582d2b.tar.gz
phreak-bd0151e4d2f5745247de0560b3ebe7a672582d2b.tar.bz2
phreak-bd0151e4d2f5745247de0560b3ebe7a672582d2b.zip
"Fixed" ebuilds for ocaml, to compile/work on hardened.
svn path=/; revision=308
-rw-r--r--hardened/dev-lang/ocaml/Manifest40
-rw-r--r--hardened/dev-lang/ocaml/files/digest-ocaml-3.08.33
-rw-r--r--hardened/dev-lang/ocaml/files/digest-ocaml-3.08.43
-rw-r--r--hardened/dev-lang/ocaml/files/digest-ocaml-3.09.23
-rw-r--r--hardened/dev-lang/ocaml/files/digest-ocaml-3.09.33
-rw-r--r--hardened/dev-lang/ocaml/files/ocaml-3.08.3-gcc4.patch20
-rw-r--r--hardened/dev-lang/ocaml/files/ocaml-rebuild.sh62
-rw-r--r--hardened/dev-lang/ocaml/ocaml-3.08.3.ebuild97
-rw-r--r--hardened/dev-lang/ocaml/ocaml-3.08.4.ebuild98
-rw-r--r--hardened/dev-lang/ocaml/ocaml-3.09.2.ebuild93
-rw-r--r--hardened/dev-lang/ocaml/ocaml-3.09.3.ebuild101
11 files changed, 523 insertions, 0 deletions
diff --git a/hardened/dev-lang/ocaml/Manifest b/hardened/dev-lang/ocaml/Manifest
new file mode 100644
index 0000000..b4f8026
--- /dev/null
+++ b/hardened/dev-lang/ocaml/Manifest
@@ -0,0 +1,40 @@
+AUX ocaml-3.08.3-gcc4.patch 710 RMD160 7c7399b1a1aa383815021721b4f4a5261137dc15 SHA1 19482bd2cc736a54645e0b48c82edd9863be0375 SHA256 007606bb38a7d66a003a94c9b45288055faacf5f15334a9ff6c33fdc91504e09
+MD5 c57fc46d92565b5d44c8c4f2a4a072d3 files/ocaml-3.08.3-gcc4.patch 710
+RMD160 7c7399b1a1aa383815021721b4f4a5261137dc15 files/ocaml-3.08.3-gcc4.patch 710
+SHA256 007606bb38a7d66a003a94c9b45288055faacf5f15334a9ff6c33fdc91504e09 files/ocaml-3.08.3-gcc4.patch 710
+AUX ocaml-rebuild.sh 1361 RMD160 a9c452fbea18de3b38d8240f887f8595e529643e SHA1 2a682ce872c51e66a5ab13160da16b0f6d8bd366 SHA256 a8004cd4bca96ab3fc595fcfd7dbe88903833f9e430149c3d04c9fda84362b64
+MD5 bcc5109143faee7e7b8f7f76bd4726a7 files/ocaml-rebuild.sh 1361
+RMD160 a9c452fbea18de3b38d8240f887f8595e529643e files/ocaml-rebuild.sh 1361
+SHA256 a8004cd4bca96ab3fc595fcfd7dbe88903833f9e430149c3d04c9fda84362b64 files/ocaml-rebuild.sh 1361
+DIST ocaml-3.08.3.tar.bz2 2026597 RMD160 83fcab89371f228c35d826eb204c80e3380ddf27 SHA1 2ebbc72faea2ae8b96a42c489ecbcf34df9dbe76 SHA256 20aca649bacd75728d3566ccb52bd7a2899208fbc6de8aceb3bf19a87894e539
+DIST ocaml-3.08.4.tar.bz2 2054019 RMD160 448ed9af56cacb9c32208d064e1c9732a2086bd2 SHA1 d9eb54611d24f9e1c33736f12c7ba87412057cbb SHA256 8d4322791d0dd424f355636ba50934ac17dbefde269736dad0da0683c8888684
+DIST ocaml-3.09.2.tar.bz2 2036341 RMD160 45edae84e5787775a5beed29a1ad2881f4df8505 SHA1 578c66707532882782735352a3628b78193da5e7 SHA256 2115d6a4e420b5517ed7313c64bd6bd93f610ec208250b7d025595376180b0b1
+DIST ocaml-3.09.3.tar.bz2 2038617 RMD160 fdc124218c556c62c897ee6720970279e2d5426b SHA1 5d63c6e0d13463f85c0d5147d641d2bceef87d6b SHA256 607842b4f4917a759f19541a421370a834f5b948855ca54cef40d22b19a0934f
+EBUILD ocaml-3.08.3.ebuild 2488 RMD160 4cf1c388cf4d47f3da95f45b00534da9e4a73a48 SHA1 075203a33c04d2b8f0dc8c5c22863435770bb1f2 SHA256 c139df17825c6e64b2d2558db88a68facf13e26e78cb0945cecf8725ec382b0a
+MD5 677c9a8ef5413896d4aafb1a7aab9513 ocaml-3.08.3.ebuild 2488
+RMD160 4cf1c388cf4d47f3da95f45b00534da9e4a73a48 ocaml-3.08.3.ebuild 2488
+SHA256 c139df17825c6e64b2d2558db88a68facf13e26e78cb0945cecf8725ec382b0a ocaml-3.08.3.ebuild 2488
+EBUILD ocaml-3.08.4.ebuild 2695 RMD160 09ed59e58bfa6c6236f587dcd6072fc046d90fbd SHA1 204301395b1bac6f87ae00a0037ba14f39e9c3d6 SHA256 c89612183151eb7c1684534d9fafeb42c60484a03abf71550e9275ef5447d128
+MD5 18a8cfc1382d4f81f8fc6986a764b33c ocaml-3.08.4.ebuild 2695
+RMD160 09ed59e58bfa6c6236f587dcd6072fc046d90fbd ocaml-3.08.4.ebuild 2695
+SHA256 c89612183151eb7c1684534d9fafeb42c60484a03abf71550e9275ef5447d128 ocaml-3.08.4.ebuild 2695
+EBUILD ocaml-3.09.2.ebuild 2548 RMD160 1c03958c935c1d6a1ae7a77c1504460c173698d4 SHA1 98a6cf1387f290f7474fe5b7e6893fba11de49ed SHA256 a0c8767f9e073c32bb8b8f3943ba4f290c23a0fa59438cb37d09cbebed81fd16
+MD5 19254bd62a38a5dad77c377f0fe7f650 ocaml-3.09.2.ebuild 2548
+RMD160 1c03958c935c1d6a1ae7a77c1504460c173698d4 ocaml-3.09.2.ebuild 2548
+SHA256 a0c8767f9e073c32bb8b8f3943ba4f290c23a0fa59438cb37d09cbebed81fd16 ocaml-3.09.2.ebuild 2548
+EBUILD ocaml-3.09.3.ebuild 2680 RMD160 ffc2d3caf9838ed6dc7055e1cdd3f57faf832215 SHA1 bd2c8ebebbae15181b60e78bb0ea47cfd92a8010 SHA256 32e17de192570940f9bcbe247771a6490676b07f5deac83560333ea58dc242fc
+MD5 73f9662aac22f9298aed95bc8eacdeda ocaml-3.09.3.ebuild 2680
+RMD160 ffc2d3caf9838ed6dc7055e1cdd3f57faf832215 ocaml-3.09.3.ebuild 2680
+SHA256 32e17de192570940f9bcbe247771a6490676b07f5deac83560333ea58dc242fc ocaml-3.09.3.ebuild 2680
+MD5 32e668c99988d463934c5ead1a603d29 files/digest-ocaml-3.08.3 244
+RMD160 0068922a3d2f5c6172d9dd866a1e1e1e85db8abe files/digest-ocaml-3.08.3 244
+SHA256 dab059cc4714a36ee9d9b3dd15b35dec829ec0fcfc952aed6936a2bd7b9e279b files/digest-ocaml-3.08.3 244
+MD5 616991884ec513ca3018b0505bdb5707 files/digest-ocaml-3.08.4 244
+RMD160 660afa0d675ca64d6bf0e8013af19fc169048733 files/digest-ocaml-3.08.4 244
+SHA256 f2fd468f6c4554ab21e0c0fa7e9a1d1bac5b3760d5184f4ffd53c5fecd90b82e files/digest-ocaml-3.08.4 244
+MD5 ea45ed7daaee5c9ecf53013b90f7a82f files/digest-ocaml-3.09.2 244
+RMD160 01eeb8fd583185a7d8bf4c76f4d13cdd2caad23a files/digest-ocaml-3.09.2 244
+SHA256 4799bbb3279e3ec6a3541cbc418388633fcb7d32dbe0177334675586a8afa029 files/digest-ocaml-3.09.2 244
+MD5 71f3dc5bc2ee57a403689b56bc1a85c1 files/digest-ocaml-3.09.3 244
+RMD160 e7f0898889b94faae3b1481555bac42e9298b370 files/digest-ocaml-3.09.3 244
+SHA256 19708f759185ed39623e03921462ba20fb6f3533268673d2bcd7dd07cef57350 files/digest-ocaml-3.09.3 244
diff --git a/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.3 b/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.3
new file mode 100644
index 0000000..40d13b5
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.3
@@ -0,0 +1,3 @@
+MD5 8b0b238fb4b059890457d3d35b138785 ocaml-3.08.3.tar.bz2 2026597
+RMD160 83fcab89371f228c35d826eb204c80e3380ddf27 ocaml-3.08.3.tar.bz2 2026597
+SHA256 20aca649bacd75728d3566ccb52bd7a2899208fbc6de8aceb3bf19a87894e539 ocaml-3.08.3.tar.bz2 2026597
diff --git a/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.4 b/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.4
new file mode 100644
index 0000000..14591ce
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/digest-ocaml-3.08.4
@@ -0,0 +1,3 @@
+MD5 96b8edeb6190d9f15c086c7decd277a9 ocaml-3.08.4.tar.bz2 2054019
+RMD160 448ed9af56cacb9c32208d064e1c9732a2086bd2 ocaml-3.08.4.tar.bz2 2054019
+SHA256 8d4322791d0dd424f355636ba50934ac17dbefde269736dad0da0683c8888684 ocaml-3.08.4.tar.bz2 2054019
diff --git a/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.2 b/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.2
new file mode 100644
index 0000000..c866959
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.2
@@ -0,0 +1,3 @@
+MD5 63428ce7e114520e8f529c9ca809a1b0 ocaml-3.09.2.tar.bz2 2036341
+RMD160 45edae84e5787775a5beed29a1ad2881f4df8505 ocaml-3.09.2.tar.bz2 2036341
+SHA256 2115d6a4e420b5517ed7313c64bd6bd93f610ec208250b7d025595376180b0b1 ocaml-3.09.2.tar.bz2 2036341
diff --git a/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.3 b/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.3
new file mode 100644
index 0000000..231a74a
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/digest-ocaml-3.09.3
@@ -0,0 +1,3 @@
+MD5 8b3744efd0d51b82d55b61d0e2bf0e2b ocaml-3.09.3.tar.bz2 2038617
+RMD160 fdc124218c556c62c897ee6720970279e2d5426b ocaml-3.09.3.tar.bz2 2038617
+SHA256 607842b4f4917a759f19541a421370a834f5b948855ca54cef40d22b19a0934f ocaml-3.09.3.tar.bz2 2038617
diff --git a/hardened/dev-lang/ocaml/files/ocaml-3.08.3-gcc4.patch b/hardened/dev-lang/ocaml/files/ocaml-3.08.3-gcc4.patch
new file mode 100644
index 0000000..b172ace
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/ocaml-3.08.3-gcc4.patch
@@ -0,0 +1,20 @@
+--- ocaml-3.08.3/otherlibs/num/bng_ia32.c.x86 2005-05-09 15:24:29.000000000 -0400
++++ ocaml-3.08.3/otherlibs/num/bng_ia32.c 2005-05-09 22:02:50.000000000 -0400
+@@ -121,7 +121,7 @@
+ "leal 4(%1), %1 \n\t"
+ "decl %2 \n\t"
+ "jnz 1b"
+- : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&r" (out)
++ : "+&r" (a), "+&r" (b), "+m" (blen), "+&r" (out)
+ : "rm" (d)
+ : "eax", "edx");
+ }
+@@ -164,7 +164,7 @@
+ "leal 4(%1), %1 \n\t"
+ "decl %2 \n\t"
+ "jnz 1b"
+- : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&rm" (out), "=&r" (tmp)
++ : "+&r" (a), "+&r" (b), "+m" (blen), "+m" (out), "=&r" (tmp)
+ : "rm" (d)
+ : "eax", "edx");
+ }
diff --git a/hardened/dev-lang/ocaml/files/ocaml-rebuild.sh b/hardened/dev-lang/ocaml/files/ocaml-rebuild.sh
new file mode 100644
index 0000000..fa76994
--- /dev/null
+++ b/hardened/dev-lang/ocaml/files/ocaml-rebuild.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+# run like this: ocaml-rebuild.sh [-h | -f] [emerge_options]
+
+emerge=/usr/bin/emerge
+
+if [ "$1" = "-h" ]
+then
+ echo "usage: ocaml-rebuild.sh [-h | -f(orce)] [emerge_options]"
+ echo "With -f, the packages will first be unmerged and then emerged"
+ echo "with the given options to ensuree correct dependancy analysis."
+ echo "Otherwise emerge is run with the --pretend flag and the given"
+ echo "options."
+ echo "It is recommended to keep the list of rebuilt packages printed"
+ echo "in pretend mode in case something go wrong"
+ exit 1
+fi
+
+if [ "$1" = "-f" ]
+then
+ pretend=0
+ shift
+else
+ pretend=1
+fi
+
+depends=`find /var/db/pkg -name DEPEND -exec grep -l 'dev-lang/ocaml\\|dev-ml/findlib' {} \;`
+
+for dep in $depends
+do
+ dir=`dirname $dep`
+ pkg=`basename $dir`
+ category=`cat $dir/CATEGORY`
+ slot=`cat $dir/SLOT`
+
+ toclean="=$category/$pkg $toclean"
+ tocleanstr="\"$category/$pkg\" $tocleanstr"
+
+ if [ $slot -eq 0 ]
+ then
+ tobuild=">=$category/$pkg $tobuild"
+ tobuildstr="\">=$category/$pkg\" $tobuildstr"
+ else
+ tobuild="=$category/$pkg $tobuild"
+ tobuildstr="\"=$category/$pkg\" $tobuildstr"
+ fi
+done
+
+echo Cleaning $tocleanstr
+echo Building $tobuildstr
+
+if [ "$toclean" != "" ]
+then
+ if [ $pretend -eq 1 ]
+ then
+ $emerge --pretend $@ $tobuild
+ else
+ $emerge unmerge $toclean
+ $emerge $@ $tobuild
+ fi
+else
+ echo "Nothing to update"
+fi
diff --git a/hardened/dev-lang/ocaml/ocaml-3.08.3.ebuild b/hardened/dev-lang/ocaml/ocaml-3.08.3.ebuild
new file mode 100644
index 0000000..28f5cf4
--- /dev/null
+++ b/hardened/dev-lang/ocaml/ocaml-3.08.3.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.08.3.ebuild,v 1.16 2007/02/17 19:16:10 grobian Exp $
+
+inherit flag-o-matic eutils multilib toolchain-funcs
+
+DESCRIPTION="fast modern type-inferring functional programming language descended from the ML (Meta Language) family"
+HOMEPAGE="http://www.ocaml.org/"
+
+SRC_URI="http://caml.inria.fr/distrib/ocaml-3.08/${P}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+SLOT="0"
+KEYWORDS="alpha ~amd64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="tk latex"
+
+DEPEND="virtual/libc
+ tk? ( >=dev-lang/tk-3.3.3 )"
+
+pkg_setup() {
+ ewarn
+ ewarn "Building ocaml with unsafe CFLAGS can have unexpected results"
+ ewarn "Please retry building with safer CFLAGS before reporting bugs"
+ ewarn
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ #GCC4 patch
+ epatch ${FILESDIR}/${P}-gcc4.patch
+}
+
+src_compile() {
+# gcc-specs-pie && append-flags -nopie
+# gcc-specs-ssp && append-flags -fno-stack-protector
+# filter-flags "-fstack-protector -pie"
+ append-flags -fPIE
+ replace-flags "-O?" -O2
+
+ local myconf
+ use tk || myconf="-no-tk"
+
+ # Fix for bug #23767.
+ if [ "${ARCH}" = "sparc" ]; then
+ myconf="${myconf} -host sparc-unknown-linux-gnu"
+ fi
+
+ # Fix for bug #46703
+ export LC_ALL=C
+
+ ./configure -prefix /usr \
+ -bindir /usr/bin \
+ -libdir /usr/$(get_libdir)/ocaml \
+ -mandir /usr/share/man \
+ --with-pthread ${myconf} || die
+
+ sed -i -e "s/\(BYTECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+ sed -i -e "s/\(NATIVECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+
+ make world || die
+
+ # Native code generation unsupported on some archs
+ if ! use ppc64 ; then
+ make opt || die
+ make opt.opt || die
+ fi
+}
+
+src_install() {
+ make BINDIR=${D}/usr/bin \
+ LIBDIR=${D}/usr/$(get_libdir)/ocaml \
+ MANDIR=${D}/usr/share/man \
+ install || die
+
+ # silly, silly makefiles
+ dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf
+
+ # documentation
+ dodoc Changes INSTALL LICENSE README Upgrading
+}
+
+pkg_postinst() {
+ if use latex; then
+ echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > /etc/env.d/99ocamldoc
+ fi
+
+ echo
+ elog "OCaml is not binary compatible from version to version,"
+ elog "so you (may) need to rebuild all packages depending on it that"
+ elog "are actually installed on your system."
+ elog "To do so, you can run: "
+ elog "sh ${FILESDIR}/ocaml-rebuild.sh [-h | emerge options]"
+ elog "Which will call emerge on all old packages with the given options"
+ echo
+}
diff --git a/hardened/dev-lang/ocaml/ocaml-3.08.4.ebuild b/hardened/dev-lang/ocaml/ocaml-3.08.4.ebuild
new file mode 100644
index 0000000..8fcb129
--- /dev/null
+++ b/hardened/dev-lang/ocaml/ocaml-3.08.4.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.08.4.ebuild,v 1.14 2007/02/17 19:16:10 grobian Exp $
+
+inherit flag-o-matic eutils multilib toolchain-funcs
+
+DESCRIPTION="fast modern type-inferring functional programming language descended from the ML (Meta Language) family"
+HOMEPAGE="http://www.ocaml.org/"
+
+SRC_URI="http://caml.inria.fr/distrib/ocaml-3.08/${P}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~ppc ~ppc64 -s390 sparc ~x86"
+IUSE="tk latex"
+
+DEPEND="virtual/libc
+ tk? ( >=dev-lang/tk-3.3.3 )"
+
+pkg_setup() {
+ ewarn
+ ewarn "Building ocaml with unsafe CFLAGS can have unexpected results"
+ ewarn "Please retry building with safer CFLAGS before reporting bugs"
+ ewarn "Likewise, building with a hardened gcc is not possible."
+ ewarn
+}
+
+src_compile() {
+# gcc-specs-pie && append-flags -nopie
+# gcc-specs-ssp && append-flags -fno-stack-protector
+# filter-flags "-fstack-protector -pie"
+ append-flags -fPIE
+ replace-flags "-O?" -O2
+
+ local myconf
+ use tk || myconf="-no-tk"
+
+ # Fix for bug #23767.
+ if [ "${ARCH}" = "sparc" ]; then
+ myconf="${myconf} -host sparc-unknown-linux-gnu"
+ fi
+
+ # Fix for bug #46703
+ export LC_ALL=C
+
+ ./configure -prefix /usr \
+ -bindir /usr/bin \
+ -libdir /usr/$(get_libdir)/ocaml \
+ -mandir /usr/share/man \
+ --with-pthread ${myconf} || die
+
+ sed -i -e "s/\(BYTECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+ sed -i -e "s/\(NATIVECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+
+ make world || die
+ # Native code generation unsupported on some archs
+ if ! use ppc64 ; then
+ make opt || die
+ make opt.opt || die
+ fi
+}
+
+src_install() {
+ make BINDIR=${D}/usr/bin \
+ LIBDIR=${D}/usr/$(get_libdir)/ocaml \
+ MANDIR=${D}/usr/share/man \
+ install || die
+
+ # compiler libs
+ dodir /usr/lib/ocaml/compiler-libs
+ insinto /usr/lib/ocaml/compiler-libs
+ doins {utils,typing,parsing}/*.{mli,cmi,cmo,cmx,o}
+
+ # headers
+ dodir /usr/include
+ dosym /usr/include/caml /usr/lib/ocaml/caml
+
+ # silly, silly makefiles
+ dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf
+
+ # documentation
+ dodoc Changes INSTALL LICENSE README Upgrading
+}
+
+pkg_postinst() {
+ if use latex; then
+ echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > /etc/env.d/99ocamldoc
+ fi
+
+ echo
+ elog "OCaml is not binary compatible from version to version,"
+ elog "so you (may) need to rebuild all packages depending on it that"
+ elog "are actually installed on your system."
+ elog "To do so, you can run: "
+ elog "sh ${FILESDIR}/ocaml-rebuild.sh [-h | emerge options]"
+ elog "Which will call emerge on all old packages with the given options"
+ echo
+}
diff --git a/hardened/dev-lang/ocaml/ocaml-3.09.2.ebuild b/hardened/dev-lang/ocaml/ocaml-3.09.2.ebuild
new file mode 100644
index 0000000..83b8ca4
--- /dev/null
+++ b/hardened/dev-lang/ocaml/ocaml-3.09.2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.09.2.ebuild,v 1.11 2007/02/06 08:26:45 genone Exp $
+
+inherit flag-o-matic eutils multilib toolchain-funcs
+
+DESCRIPTION="fast modern type-inferring functional programming language descended from the ML (Meta Language) family"
+HOMEPAGE="http://www.ocaml.org/"
+
+SRC_URI="http://caml.inria.fr/distrib/ocaml-3.09/${P}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 sparc x86"
+IUSE="tk latex"
+
+DEPEND="virtual/libc
+ tk? ( >=dev-lang/tk-3.3.3 )"
+
+pkg_setup() {
+ ewarn
+ ewarn "Building ocaml with unsafe CFLAGS can have unexpected results"
+ ewarn "Please retry building with safer CFLAGS before reporting bugs"
+ ewarn "Likewise, building with a hardened gcc is not possible."
+ ewarn
+}
+
+src_compile() {
+# gcc-specs-pie && append-flags -nopie
+# gcc-specs-ssp && append-flags -fno-stack-protector
+# filter-flags "-fstack-protector -pie"
+ append-flags -fPIE
+ replace-flags "-O?" -O2
+
+ local myconf
+ use tk || myconf="-no-tk"
+
+ # Fix for bug #46703
+ export LC_ALL=C
+
+ ./configure -prefix /usr \
+ -bindir /usr/bin \
+ -libdir /usr/$(get_libdir)/ocaml \
+ -mandir /usr/share/man \
+ --with-pthread ${myconf} || die
+
+ sed -i -e "s/\(BYTECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+ sed -i -e "s/\(NATIVECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+
+ make world || die
+ # Native code generation unsupported on some archs
+ if ! use ppc64 ; then
+ make opt || die
+ make opt.opt || die
+ fi
+}
+
+src_install() {
+ make BINDIR=${D}/usr/bin \
+ LIBDIR=${D}/usr/$(get_libdir)/ocaml \
+ MANDIR=${D}/usr/share/man \
+ install || die
+
+ # compiler libs
+ dodir /usr/lib/ocaml/compiler-libs
+ insinto /usr/lib/ocaml/compiler-libs
+ doins {utils,typing,parsing}/*.{mli,cmi,cmo,cmx,o}
+
+ # headers
+ dodir /usr/include
+ dosym /usr/lib/ocaml/caml /usr/include/
+
+ # silly, silly makefiles
+ dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf
+
+ # documentation
+ dodoc Changes INSTALL LICENSE README Upgrading
+}
+
+pkg_postinst() {
+ if use latex; then
+ echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > /etc/env.d/99ocamldoc
+ fi
+
+ echo
+ elog "OCaml is not binary compatible from version to version,"
+ elog "so you (may) need to rebuild all packages depending on it that"
+ elog "are actually installed on your system."
+ elog "To do so, you can run: "
+ elog "sh ${FILESDIR}/ocaml-rebuild.sh [-h | emerge options]"
+ elog "Which will call emerge on all old packages with the given options"
+ echo
+}
diff --git a/hardened/dev-lang/ocaml/ocaml-3.09.3.ebuild b/hardened/dev-lang/ocaml/ocaml-3.09.3.ebuild
new file mode 100644
index 0000000..714e365
--- /dev/null
+++ b/hardened/dev-lang/ocaml/ocaml-3.09.3.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.09.3.ebuild,v 1.9 2007/04/15 20:17:05 corsair Exp $
+
+inherit flag-o-matic eutils multilib toolchain-funcs
+
+DESCRIPTION="fast modern type-inferring functional programming language descended from the ML (Meta Language) family"
+HOMEPAGE="http://www.ocaml.org/"
+
+SRC_URI="http://caml.inria.fr/distrib/ocaml-3.09/${P}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="tk latex"
+
+DEPEND="virtual/libc
+ tk? ( >=dev-lang/tk-3.3.3 )"
+
+pkg_setup() {
+ ewarn
+ ewarn "Building ocaml with unsafe CFLAGS can have unexpected results"
+ ewarn "Please retry building with safer CFLAGS before reporting bugs"
+ ewarn "Likewise, building with a hardened gcc is not possible."
+ ewarn
+}
+
+src_compile() {
+# gcc-specs-pie && append-flags -nopie
+# gcc-specs-ssp && append-flags -fno-stack-protector
+# filter-flags "-fstack-protector -pie"
+ append-flags -fPIE
+ replace-flags "-O?" -O2
+
+ local myconf
+ use tk || myconf="-no-tk"
+
+ # Fix for kernel_arch != system_ach (bug #135641)
+ myconf="${myconf} -host ${CHOST}"
+
+ # Fix for bug #46703
+ export LC_ALL=C
+
+ ./configure -prefix /usr \
+ -bindir /usr/bin \
+ -libdir /usr/$(get_libdir)/ocaml \
+ -mandir /usr/share/man \
+ --with-pthread ${myconf} || die
+
+ sed -i -e "s/\(BYTECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+ sed -i -e "s/\(NATIVECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile
+
+ make world || die
+
+ # Native code generation unsupported on some archs
+ if ! use ppc64 ; then
+ make opt || die
+ make opt.opt || die
+ fi
+}
+
+src_test() {
+ make bootstrap
+}
+
+src_install() {
+ make BINDIR=${D}/usr/bin \
+ LIBDIR=${D}/usr/$(get_libdir)/ocaml \
+ MANDIR=${D}/usr/share/man \
+ install || die
+
+ # compiler libs
+ dodir /usr/lib/ocaml/compiler-libs
+ insinto /usr/lib/ocaml/compiler-libs
+ doins {utils,typing,parsing}/*.{mli,cmi,cmo,cmx,o}
+
+ # headers
+ dodir /usr/include
+ dosym /usr/lib/ocaml/caml /usr/include/
+
+ # silly, silly makefiles
+ dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf
+
+ # documentation
+ dodoc Changes INSTALL LICENSE README Upgrading
+}
+
+pkg_postinst() {
+ if use latex; then
+ echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > /etc/env.d/99ocamldoc
+ fi
+
+ echo
+ elog "OCaml is not binary compatible from version to version,"
+ elog "so you (may) need to rebuild all packages depending on it that"
+ elog "are actually installed on your system."
+ elog "To do so, you can run: "
+ elog "sh ${FILESDIR}/ocaml-rebuild.sh [-h | emerge options]"
+ elog "Which will call emerge on all old packages with the given options"
+ echo
+}