diff options
author | Alexis Ballier <aballier@gentoo.org> | 2008-10-15 16:08:56 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2008-10-15 16:08:56 +0000 |
commit | 3de9abf89654f0d9062b290d6bc1b16b6d627faa (patch) | |
tree | e2b986d122a0ebcee7733d2de2abab9bdd98456d /dev-lang/ocaml | |
parent | Fixed dependency and QA issue. Cleanup. (diff) | |
download | gentoo-2-3de9abf89654f0d9062b290d6bc1b16b6d627faa.tar.gz gentoo-2-3de9abf89654f0d9062b290d6bc1b16b6d627faa.tar.bz2 gentoo-2-3de9abf89654f0d9062b290d6bc1b16b6d627faa.zip |
New upstream beta release
(Portage version: 2.2_rc12/cvs/Linux 2.6.26.6 x86_64)
Diffstat (limited to 'dev-lang/ocaml')
-rw-r--r-- | dev-lang/ocaml/ChangeLog | 11 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch | 27 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch | 16 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch | 237 | ||||
-rw-r--r-- | dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild | 127 |
5 files changed, 417 insertions, 1 deletions
diff --git a/dev-lang/ocaml/ChangeLog b/dev-lang/ocaml/ChangeLog index 5c4e3ba93a73..ecdfa8fd2b14 100644 --- a/dev-lang/ocaml/ChangeLog +++ b/dev-lang/ocaml/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-lang/ocaml # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.149 2008/09/22 18:56:34 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.150 2008/10/15 16:08:56 aballier Exp $ + +*ocaml-3.11.0_beta1 (15 Oct 2008) + + 15 Oct 2008; Alexis Ballier <aballier@gentoo.org> + +files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch, + +files/ocaml-3.11.0_beta1-configure.patch, + +files/ocaml-3.11.0_beta1-exec-stack-fixes.patch, + +ocaml-3.11.0_beta1.ebuild: + New upstream beta release 22 Sep 2008; Raúl Porcel <armin76@gentoo.org> ocaml-3.10.2.ebuild: Re-add ~arm wrt #178256 diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch new file mode 100644 index 000000000000..53e2febe6681 --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch @@ -0,0 +1,27 @@ +As we now support LDFLAGS in NATIVECCLINKOPTS +it can happen that -Wl,--foo,--bar option is in that variable +As ocaml happens to call ld with NATIVECCLINKOPTS +we have to "translate" it so that ld doesn't bail out with unrecognized option +Initial patch from Julien Cristau : http://caml.inria.fr/mantis/view.php?id=4142 +Modified a bit to catch comma separated options +Index: ocaml-3.11.0+beta1/configure +=================================================================== +--- ocaml-3.11.0+beta1.orig/configure ++++ ocaml-3.11.0+beta1/configure +@@ -1503,6 +1503,7 @@ fi + bytecccompopts="$CFLAGS $bytecccompopts" + bytecclinkopts="$LDFLAGS $bytecclinkopts" + natdynlinkopts="$LDFLAGS $natdynlinkopts" ++nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts" + nativecclinkopts="$LDFLAGS $nativecclinkopts" + nativecccompopts="$CFLAGS $nativecccompopts" + nativeccprofopts="$nativecccompopts" +@@ -1553,7 +1554,7 @@ echo "DEBUGGER=$debugger" >> Makefile + echo "CC_PROFILE=$cc_profile" >> Makefile + echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile + echo "PARTIALLD=$partialld" >> Makefile +-echo "PACKLD=\$(PARTIALLD) \$(NATIVECCLINKOPTS) -o " >> Makefile ++echo "PACKLD=\$(PARTIALLD) $nativeccrawlinkopts -o " >> Makefile + echo "DLLCCCOMPOPTS=$dllccompopts" >> Makefile + echo "IFLEXDIR=$iflexdir" >> Makefile + echo "O=o" >> Makefile diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch new file mode 100644 index 000000000000..31f8620b251e --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch @@ -0,0 +1,16 @@ +Index: ocaml-3.11.0+beta1/configure +=================================================================== +--- ocaml-3.11.0+beta1.orig/configure ++++ ocaml-3.11.0+beta1/configure +@@ -1494,6 +1494,11 @@ fi + + # Final twiddling of compiler options to work around known bugs + ++bytecccompopts="$CFLAGS $bytecccompopts" ++bytecclinkopts="$LDFLAGS $bytecclinkopts" ++natdynlinkopts="$LDFLAGS $natdynlinkopts" ++nativecclinkopts="$LDFLAGS $nativecclinkopts" ++nativecccompopts="$CFLAGS $nativecccompopts" + nativeccprofopts="$nativecccompopts" + case "$buggycc" in + gcc.2.96) diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch new file mode 100644 index 000000000000..4b15a35e123d --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch @@ -0,0 +1,237 @@ +Index: ocaml-3.10.0/asmcomp/alpha/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/alpha/emit.mlp ++++ ocaml-3.10.0/asmcomp/alpha/emit.mlp +@@ -811,6 +811,11 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -843,6 +848,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly () = ++ nx_stack(); + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .text\n`; + ` .globl {emit_symbol lbl_end}\n`; +Index: ocaml-3.10.0/asmrun/alpha.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/alpha.S ++++ ocaml-3.10.0/asmrun/alpha.S +@@ -438,3 +438,7 @@ caml_system__frametable: + .word -1 /* negative frame size => use callback link */ + .word 0 /* no roots here */ + .align 3 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif +Index: ocaml-3.10.0/asmrun/arm.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/arm.S ++++ ocaml-3.10.0/asmrun/arm.S +@@ -337,3 +337,7 @@ caml_system__frametable: + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ + .align 2 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif +Index: ocaml-3.10.0/asmrun/hppa.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/hppa.S ++++ ocaml-3.10.0/asmrun/hppa.S +@@ -532,3 +532,8 @@ G(caml_system__frametable): + .long L104 + 3 /* return address into callback */ + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/ia64.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/ia64.S ++++ ocaml-3.10.0/asmrun/ia64.S +@@ -528,3 +528,8 @@ caml_system__frametable: + + .common caml_saved_bsp#, 8, 8 + .common caml_saved_rnat#, 8, 8 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/m68k.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/m68k.S ++++ ocaml-3.10.0/asmrun/m68k.S +@@ -242,3 +242,8 @@ _caml_system__frametable: + .long L107 | return address into callback + .word -1 | negative frame size => use callback link + .word 0 | no roots here ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/power-elf.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/power-elf.S ++++ ocaml-3.10.0/asmrun/power-elf.S +@@ -419,3 +419,7 @@ caml_system__frametable: + .short -1 /* negative size count => use callback link */ + .short 0 /* no roots here */ + ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/sparc.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/sparc.S ++++ ocaml-3.10.0/asmrun/sparc.S +@@ -405,3 +405,8 @@ Caml_system__frametable: + .type Caml_raise_exception, #function + .type Caml_system__frametable, #object + #endif ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmcomp/arm/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/arm/emit.mlp ++++ ocaml-3.10.0/asmcomp/arm/emit.mlp +@@ -642,6 +642,13 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -661,6 +668,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly () = ++ nx_stack(); + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .text\n`; + ` .global {emit_symbol lbl_end}\n`; +Index: ocaml-3.10.0/asmcomp/hppa/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/hppa/emit.mlp ++++ ocaml-3.10.0/asmcomp/hppa/emit.mlp +@@ -994,6 +994,12 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -1022,6 +1028,7 @@ let begin_assembly() = + + + let end_assembly() = ++ nx_stack(); + ` .code\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + declare_global lbl_end; +Index: ocaml-3.10.0/asmcomp/ia64/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/ia64/emit.mlp ++++ ocaml-3.10.0/asmcomp/ia64/emit.mlp +@@ -1306,6 +1306,11 @@ let data l = + ` .align 8\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -1315,6 +1320,7 @@ let begin_assembly() = + emit_define_symbol (Compilenv.make_symbol (Some "code_begin")) + + let end_assembly () = ++ nx_stack(); + ` .data\n`; + emit_define_symbol (Compilenv.make_symbol (Some "data_end")); + ` .text\n`; +Index: ocaml-3.10.0/asmcomp/power/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/power/emit.mlp ++++ ocaml-3.10.0/asmcomp/power/emit.mlp +@@ -916,6 +916,12 @@ let data l = + emit_string data_space; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "elf" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -932,6 +938,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly() = ++ nx_stack(); + if pic_externals then + (* Emit the pointers to external functions *) + StringSet.iter emit_external !external_functions; +Index: ocaml-3.10.0/asmcomp/sparc/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/sparc/emit.mlp ++++ ocaml-3.10.0/asmcomp/sparc/emit.mlp +@@ -741,6 +741,12 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -754,6 +760,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly() = ++ nx_stack(); + ` .text\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .global {emit_symbol lbl_end}\n`; diff --git a/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild b/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild new file mode 100644 index 000000000000..03d73bb5e68e --- /dev/null +++ b/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild,v 1.1 2008/10/15 16:08:56 aballier Exp $ + +inherit flag-o-matic eutils multilib versionator toolchain-funcs + +EAPI="1" + +MY_P="${P/_beta/+beta}" +DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family" +HOMEPAGE="http://www.ocaml.org/" +SRC_URI="http://caml.inria.fr/distrib/ocaml-$( get_version_component_range 1-2)/${MY_P}.tar.bz2" + +LICENSE="QPL-1.0 LGPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="emacs gdbm latex ncurses +ocamlopt tk X xemacs" + +DEPEND="tk? ( >=dev-lang/tk-3.3.3 ) + ncurses? ( sys-libs/ncurses ) + X? ( x11-libs/libX11 x11-proto/xproto ) + gdbm? ( sys-libs/gdbm )" + +PDEPEND="emacs? ( app-emacs/ocaml-mode ) + xemacs? ( app-xemacs/ocaml )" + +S="${WORKDIR}/${MY_P}" +pkg_setup() { + # dev-lang/ocaml creates its own objects but calls gcc for linking, which will + # results in relocations if gcc wants to create a PIE executable + if gcc-specs-pie ; then + append-ldflags -nopie + ewarn "Ocaml generates its own native asm, you're using a PIE compiler" + ewarn "We have appended -nopie to ocaml build options" + ewarn "because linking an executable with pie while the objects are not pic will not work" + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Fix the EXEC_STACK in ocaml compiled binaries (#153382) + epatch "${FILESDIR}"/${PN}-3.11.0_beta1-exec-stack-fixes.patch + + # The configure script doesn't inherit previous defined variables, + # overwriting previous declarations of bytecccompopts, bytecclinkopts, + # nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267. + epatch "${FILESDIR}"/${PN}-3.11.0_beta1-configure.patch + + # ocaml has automagics on libX11 and gdbm + # http://caml.inria.fr/mantis/view.php?id=4278 + epatch "${FILESDIR}/${PN}-3.10.0-automagic.patch" + + # Call ld with proper flags, different from gcc ones + # This happens when calling ocamlc -pack + # See comment in the patch + epatch "${FILESDIR}/${PN}-3.11.0_beta1-call-ld-with-proper-ldflags.patch" +} + +src_compile() { + local myconf="--host ${CHOST}" + + # It doesn't compile on alpha without this LDFLAGS + use alpha && append-ldflags "-Wl,--no-relax" + + use tk || myconf="${myconf} -no-tk" + use ncurses || myconf="${myconf} -no-curses" + use X || myconf="${myconf} -no-graph" + use gdbm || myconf="${myconf} -no-dbm" + + # ocaml uses a home-brewn configure script, preventing it to use econf. + RAW_LDFLAGS="$(raw-ldflags)" ./configure -prefix /usr \ + --bindir /usr/bin \ + --libdir /usr/$(get_libdir)/ocaml \ + --mandir /usr/share/man \ + --with-pthread ${myconf} || die "configure failed!" + + make world || die "make world failed!" + + # Native code generation can be disabled now + if use ocamlopt ; then + make opt || die "make opt failed!" + make opt.opt || die "make opt.opt failed!" + fi +} + +src_install() { + make BINDIR="${D}"/usr/bin \ + LIBDIR="${D}"/usr/$(get_libdir)/ocaml \ + MANDIR="${D}"/usr/share/man \ + install || die "make install failed!" + + # Install the compiler libs + dodir /usr/$(get_libdir)/ocaml/compiler-libs + insinto /usr/$(get_libdir)/ocaml/compiler-libs + doins {utils,typing,parsing}/*.{mli,cmi,cmo,cmx,o} + + # Symlink the headers to the right place + dodir /usr/include + dosym /usr/$(get_libdir)/ocaml/caml /usr/include/ + + # Remove ${D} from ld.conf, as the buildsystem isn't $(DESTDIR) aware + dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf + + dodoc Changes INSTALL README Upgrading + + # Create and envd entry for latex input files (this definitely belongs into + # CONTENT and not in pkg_postinst. + if use latex ; then + echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc + doenvd "${T}"/99ocamldoc + fi + + # Install ocaml-rebuild.sh script rather than keeping it in $PORTDIR + dosbin "${FILESDIR}/ocaml-rebuild.sh" +} + +pkg_postinst() { + echo + ewarn "OCaml is not binary compatible from version to version, so you" + ewarn "need to rebuild all packages depending on it, that are actually" + ewarn "installed on your system. To do so, you can run:" + ewarn "/usr/sbin/ocaml-rebuild.sh [-h | emerge options]" + ewarn "Which will call emerge on all old packages with the given options" + echo +} |