diff --git a/dev-lang/moarvm/files/Configure-2016.04.patch b/dev-lang/moarvm/files/Configure-2016.04.patch new file mode 100644 index 0000000..6fd46c2 --- /dev/null +++ b/dev-lang/moarvm/files/Configure-2016.04.patch @@ -0,0 +1,145 @@ +diff --git a/Configure.pl b/Configure.pl +index 72a5dad..f829d5c 100755 +--- a/Configure.pl ++++ b/Configure.pl +@@ -32,7 +32,7 @@ GetOptions(\%args, qw( + os=s shell=s toolchain=s compiler=s + ar=s cc=s ld=s make=s has-sha has-libuv + static has-libtommath has-libatomic_ops +- has-dyncall has-libffi ++ has-dyncall has-libffi pkgconfig=s + build=s host=s big-endian jit! enable-jit lua=s has-dynasm + prefix=s bindir=s libdir=s mastdir=s make-install asan ubsan), + 'no-optimize|nooptimize' => sub { $args{optimize} = 0 }, +@@ -99,6 +99,7 @@ $config{config} = join ' ', map { / / ? "\"$_\"" : $_ } @args; + $config{osname} = $^O; + $config{osvers} = $Config{osvers}; + $config{lua} = $args{lua} // './3rdparty/dynasm/minilua@exe@'; ++$config{pkgconfig} = $args{pkgconfig} // '/usr/bin/pkg-config'; + + # set options that take priority over all others + my @keys = qw( ar cc ld make ); +@@ -164,12 +165,33 @@ if (-e '3rdparty/libuv/src/unix/threadpool' . $defaults{obj} + system($defaults{make}, 'realclean') + } + ++# test whether pkg-config works ++if (-e "$config{pkgconfig}") { ++ print("\nTesting pkgconfig ... "); ++ system("$config{pkgconfig}", "--version"); ++ if ( $? == 0 ) { ++ $config{pkgconfig_works} = 1; ++ } else { ++ $config{pkgconfig_works} = 0; ++ } ++} ++ + # conditionally set include dirs and install rules + $config{cincludes} //= ''; + $config{install} //= ''; + if ($args{'has-libuv'}) { + $defaults{-thirdparty}->{uv} = undef; + unshift @{$config{usrlibs}}, 'uv'; ++ if ($config{pkgconfig_works}) { ++ my $result = `$config{pkgconfig} --cflags libuv`; ++ if ( $? == 0 ) { ++ $result =~ s/\n/ /g; ++ $config{cincludes} .= ' ' . "$result"; ++ print("Adding extra include for libuv: $result\n"); ++ } else { ++ print("Error occured when running $config{pkgconfig} --cflags libuv.\n"); ++ } ++ } + } + else { + $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libuv/include' +@@ -181,6 +203,16 @@ else { + if ($args{'has-libatomic_ops'}) { + $defaults{-thirdparty}->{lao} = undef; + unshift @{$config{usrlibs}}, 'atomic_ops'; ++ if ($config{pkgconfig_works}) { ++ my $result = `$config{pkgconfig} --cflags atomic_ops`; ++ if ( $? == 0 ) { ++ $result =~ s/\n/ /g; ++ $config{cincludes} .= ' ' . "$result"; ++ print("Adding extra include for atomic_ops: $result\n"); ++ } else { ++ print("Error occured when running $config{pkgconfig} --cflags atomic_ops.\n"); ++ } ++ } + } + else { + $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libatomic_ops/src'; +@@ -216,7 +248,8 @@ if ($args{'has-libtommath'}) { + } + else { + $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libtommath'; +- $config{install} .= "\t\$(CP) 3rdparty/libtommath/*.h \$(DESTDIR)\$(PREFIX)/include/libtommath\n"; ++ $config{install} .= "\t\$(MKPATH) \$(DESTDIR)\$(PREFIX)/include/libtommath\n" ++ . "\t\$(CP) 3rdparty/libtommath/*.h \$(DESTDIR)\$(PREFIX)/include/libtommath\n"; + } + + if ($args{'has-dynasm'}) { +@@ -232,6 +265,16 @@ if ($args{'has-libffi'}) { + $config{nativecall_backend} = 'libffi'; + unshift @{$config{usrlibs}}, 'ffi'; + push @{$config{defs}}, 'HAVE_LIBFFI'; ++ if ($config{pkgconfig_works}) { ++ my $result = `$config{pkgconfig} --cflags libffi`; ++ if ( $? == 0 ) { ++ $result =~ s/\n/ /g; ++ $config{cincludes} .= ' ' . "$result"; ++ print("Adding extra include for libffi: $result\n"); ++ } else { ++ print("Error occured when running $config{pkgconfig} --cflags libffi.\n"); ++ } ++ } + } + elsif ($args{'has-dyncall'}) { + unshift @{$config{usrlibs}}, 'dyncall_s', 'dyncallback_s', 'dynload_s'; +@@ -364,6 +407,7 @@ my $order = $config{be} ? 'big endian' : 'little endian'; + print "\n", < '-fPIC', + ldshared => '-shared @ccshared@', + moarshared => '', +- ldrpath => '-Wl,-rpath,@libdir@ -Wl,-rpath,@prefix@/share/perl6/site/lib', ++ ldrpath => '-Wl,-rpath,/@libdir@ -Wl,-rpath,@prefix@/share/perl6/site/lib', + + arflags => 'rcs', + arout => '', diff --git a/dev-lang/moarvm/metadata.xml b/dev-lang/moarvm/metadata.xml index 2a28219..2898edb 100644 --- a/dev-lang/moarvm/metadata.xml +++ b/dev-lang/moarvm/metadata.xml @@ -2,14 +2,22 @@ - patrick@gentoo.org - Patrick Lauer + patrick@gentoo.org + Patrick Lauer - perl@gentoo.org - Gentoo Perl Project + perl@gentoo.org + Gentoo Perl Project + + Enable clang's Address Sanitizer functionality. Expect longer compile time. + Use clang compiler instead of GCC + Enable Just-In-Time-Compiler. Has no effect except on AMD64 and Darwin. + Enable optimization via CFLAGS + Link against the system's shared libraries + Enable clang's Undefined Behavior Sanitizer functionality. Expect longer compile time. + - MoarVM/MoarVM + MoarVM/MoarVM diff --git a/dev-lang/moarvm/moarvm-2016.04-r1.ebuild b/dev-lang/moarvm/moarvm-2016.04-r1.ebuild new file mode 100644 index 0000000..7b75a88 --- /dev/null +++ b/dev-lang/moarvm/moarvm-2016.04-r1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit flag-o-matic + +MY_PN="MoarVM" +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git" + inherit git-r3 + KEYWORDS="" + S="${WORKDIR}/${P}" +else + SRC_URI="https://moarvm.org/releases/${MY_PN}-${PV}.tar.gz" + KEYWORDS="~amd64 ~x86" + S="${WORKDIR}/${MY_PN}-${PV}" +fi + +DESCRIPTION="A 6model-based VM for NQP and Rakudo Perl 6" +HOMEPAGE="http://moarvm.org" +LICENSE="Artistic-2" +SLOT="0" +IUSE="asan clang debug doc +jit static-libs +system-libs optimize ubsan" + +RDEPEND="dev-libs/libatomic_ops + dev-libs/libtommath + dev-libs/libuv + jit? ( dev-lang/lua:0[deprecated] + dev-lua/LuaBitOp ) + virtual/libffi" +DEPEND="${RDEPEND} + clang? ( >=sys-devel/clang-3.1 ) + dev-lang/perl" + +PATCHES=( "${FILESDIR}/Configure-2016.04.patch" ) +DOCS=( CREDITS README.markdown ) + +# Tests are conducted via nqp +RESTRICT=test + +src_prepare() { + eapply "${PATCHES[@]}" + eapply_user + use doc && DOCS+=( docs/* ) +} + +src_configure() { + local myconfigargs=( + "--prefix=/usr" + "--libdir=$(get_libdir)" + "--compiler=$(usex clang clang gcc)" + "$(usex asan --asan)" + "$(usex debug --debug --no-debug)" + "$(usex jit --lua=/usr/bin/lua --no-jit)" + "$(usex optimize --optimize= --no-optimize)" + "$(usex static-libs --static)" + "$(usex system-libs --has-libtommath)" + "$(usex system-libs --has-libuv)" + "$(usex system-libs --has-libatomic_ops)" + "$(usex system-libs --has-libffi)" + "$(usex ubsan --ubsan)" + ) + use optimize && filter-flags '-O*' + + perl Configure.pl "${myconfigargs[@]}" || die +} diff --git a/dev-lang/moarvm/moarvm-9999.ebuild b/dev-lang/moarvm/moarvm-9999.ebuild index 0b704eb..7b75a88 100644 --- a/dev-lang/moarvm/moarvm-9999.ebuild +++ b/dev-lang/moarvm/moarvm-9999.ebuild @@ -1,36 +1,68 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=5 +EAPI=6 -inherit eutils git-r3 +inherit flag-o-matic MY_PN="MoarVM" +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git" + inherit git-r3 + KEYWORDS="" + S="${WORKDIR}/${P}" +else + SRC_URI="https://moarvm.org/releases/${MY_PN}-${PV}.tar.gz" + KEYWORDS="~amd64 ~x86" + S="${WORKDIR}/${MY_PN}-${PV}" +fi DESCRIPTION="A 6model-based VM for NQP and Rakudo Perl 6" -HOMEPAGE="https://github.com/MoarVM/MoarVM" -EGIT_REPO_URI="https://github.com/MoarVM/MoarVM.git" - +HOMEPAGE="http://moarvm.org" LICENSE="Artistic-2" SLOT="0" -KEYWORDS="" -IUSE="doc" +IUSE="asan clang debug doc +jit static-libs +system-libs optimize ubsan" -RDEPEND="" +RDEPEND="dev-libs/libatomic_ops + dev-libs/libtommath + dev-libs/libuv + jit? ( dev-lang/lua:0[deprecated] + dev-lua/LuaBitOp ) + virtual/libffi" DEPEND="${RDEPEND} + clang? ( >=sys-devel/clang-3.1 ) dev-lang/perl" +PATCHES=( "${FILESDIR}/Configure-2016.04.patch" ) +DOCS=( CREDITS README.markdown ) + +# Tests are conducted via nqp +RESTRICT=test + src_prepare() { - epatch "${FILESDIR}/Configure-9999.patch" || die + eapply "${PATCHES[@]}" + eapply_user + use doc && DOCS+=( docs/* ) } src_configure() { - # this is quite badong, but wtf build system - echo "2013.10-145-gec52026" >> VERSION - perl Configure.pl --prefix="${D}/usr"|| die -} + local myconfigargs=( + "--prefix=/usr" + "--libdir=$(get_libdir)" + "--compiler=$(usex clang clang gcc)" + "$(usex asan --asan)" + "$(usex debug --debug --no-debug)" + "$(usex jit --lua=/usr/bin/lua --no-jit)" + "$(usex optimize --optimize= --no-optimize)" + "$(usex static-libs --static)" + "$(usex system-libs --has-libtommath)" + "$(usex system-libs --has-libuv)" + "$(usex system-libs --has-libatomic_ops)" + "$(usex system-libs --has-libffi)" + "$(usex ubsan --ubsan)" + ) + use optimize && filter-flags '-O*' -src_install() { - make install + perl Configure.pl "${myconfigargs[@]}" || die } diff --git a/dev-lang/nqp/files/enable-external-jars.patch b/dev-lang/nqp/files/enable-external-jars.patch new file mode 100644 index 0000000..cf5d4bd --- /dev/null +++ b/dev-lang/nqp/files/enable-external-jars.patch @@ -0,0 +1,214 @@ +diff --git a/Configure.pl b/Configure.pl +index 2064ac8..73e2d27 100755 +--- a/Configure.pl ++++ b/Configure.pl +@@ -34,6 +34,7 @@ MAIN: { + 'no-clean', + 'with-parrot=s', 'gen-parrot:s', 'parrot-config=s', 'parrot-option=s@', + 'with-moar=s', 'gen-moar:s', 'moar-option=s@', ++ 'with-asm=s', 'with-asm-tree=s', 'with-jline=s', 'with-jna=s', + 'make-install!', 'makefile-timing!', + 'git-protocol=s', + 'git-depth=s', 'git-reference=s',); +@@ -50,6 +51,53 @@ MAIN: { + "Use --prefix to specify a directory in which parrot is installed."; + } + ++ if ($options{'with-asm'}) { ++ if ($options{'with-asm'} ne '-') { ++ $config{'asm'} = $options{'with-asm'}; ++ } ++ } else { ++ $config{'asm'} = "3rdparty/asm/asm-4.1.jar"; ++ } ++ if ($options{'with-asm-tree'}) { ++ if ($options{'with-asm-tree'} ne '-') { ++ $config{'asmtree'} = $options{'with-asm-tree'}; ++ } ++ } else { ++ $config{'asmtree'} = "3rdparty/asm/asm-tree-4.1.jar"; ++ } ++ if ($options{'with-jline'}) { ++ if ($options{'with-jline'} ne '-') { ++ $config{'jline'} = $options{'with-jline'}; ++ } ++ } else { ++ $config{'jline'} = "3rdparty/jline/jline-1.0.jar"; ++ } ++ if ($options{'with-jna'}) { ++ if ($options{'with-jna'} ne '-') { ++ $config{'jna'} = $options{'with-jna'}; ++ } ++ } else { ++ $config{'jna'} = "3rdparty/jna/jna.jar"; ++ } ++ ++ if ($^O eq 'MSWin32') { ++ $config{'asmfile'} = $config{'asm'}; ++ $config{'asmfile'} =~ s/.*\\//; ++ $config{'jlinefile'} = $config{'jline'}; ++ $config{'jlinefile'} =~ s/.*\\//; ++ } else { ++ $config{'asmfile'} = $config{'asm'}; ++ $config{'asmfile'} =~ s/.*\///; ++ $config{'jlinefile'} = $config{'jline'}; ++ $config{'jlinefile'} =~ s/.*\///; ++ } ++ ++ fill_template_file( ++ 'tools/build/install-jvm-runner.pl.in', ++ 'tools/build/install-jvm-runner.pl', ++ %config, ++ ); ++ + my $default_backend; + my @backends; + my %backends; +@@ -357,6 +405,11 @@ General Options: + --gen-moar Download and build a copy of MoarVM to use + --moar-option='--option=value' + Options to pass to MoarVM configuration for --gen-moar ++ --with-asm='/path/to/jar' ++ --with-asm-tree='/path/to/jar' ++ --with-jline='/path/to/jar' ++ --with-jna='/path/to/jar' ++ Provide paths to already installed jars + --git-protocol={ssh,https,git} + Protocol to use for git clone. Default: https + --make-install Immediately run `MAKE install` after configuring +diff --git a/tools/build/Makefile-JVM.in b/tools/build/Makefile-JVM.in +index 27959ad..c19965a 100644 +--- a/tools/build/Makefile-JVM.in ++++ b/tools/build/Makefile-JVM.in +@@ -2,7 +2,6 @@ BAT = @bat@ + JAVA = java + JAVAC = javac + JAR = jar +-ASM = 3rdparty/asm/ + J_RUNNER = nqp-j$(BAT) + + NQP_JAR_DIR = $(NQP_LANG_DIR)/runtime +@@ -18,7 +17,11 @@ RUNTIME_JAVAS = \ + + RUNTIME_JAR = nqp-runtime.jar + +-THIRDPARTY_JARS = $(ASM)asm-4.1.jar@cpsep@$(ASM)asm-tree-4.1.jar@cpsep@3rdparty/jline/jline-1.0.jar@cpsep@3rdparty/jna/jna.jar ++ASM = @asm@ ++ASMTREE = @asmtree@ ++JLINE = @jline@ ++JNA = @jna@ ++THIRDPARTY_JARS = $(ASM)@cpsep@$(ASMTREE)@cpsep@$(JLINE)@cpsep@$(JNA) + J_STAGE0 = src/vm/jvm/stage0 + J_STAGE1 = $(JVM_BUILD_DIR)/stage1 + J_STAGE2 = $(JVM_BUILD_DIR)/stage2 +@@ -80,8 +83,8 @@ j-install: j-all + $(MKPATH) $(DESTDIR)$(BIN_DIR) + $(MKPATH) $(DESTDIR)$(NQP_JAR_DIR) + $(MKPATH) $(DESTDIR)$(NQP_LIB_DIR) +- $(CP) 3rdparty/asm/asm-4.1.jar 3rdparty/asm/asm-tree-4.1.jar $(DESTDIR)$(NQP_JAR_DIR) +- $(CP) 3rdparty/jline/jline-1.0.jar 3rdparty/jna/jna.jar $(DESTDIR)$(NQP_JAR_DIR) ++ $(CP) $(ASM) $(ASMTREE) $(DESTDIR)$(NQP_JAR_DIR) ++ $(CP) $(JLINE) $(JNA) $(DESTDIR)$(NQP_JAR_DIR) + $(CP) $(RUNTIME_JAR) $(DESTDIR)$(NQP_JAR_DIR) + $(CP) $(NQP_MO_JAR) $(MODULE_LOADER_JAR) $(DESTDIR)$(NQP_LIB_DIR) + $(CP) $(CORE_SETTING_JAR) $(QASTNODE_JAR) $(QREGEX_JAR) $(DESTDIR)$(NQP_LIB_DIR) +diff --git a/tools/build/install-jvm-runner.pl b/tools/build/install-jvm-runner.pl +deleted file mode 100644 +index 14541d6..0000000 +--- a/tools/build/install-jvm-runner.pl ++++ /dev/null +@@ -1,44 +0,0 @@ +-#!/usr/bin/perl +-# Copyright (C) 2013, The Perl Foundation. +- +-use strict; +-use warnings; +-use 5.008; +-use File::Spec; +- +-my ($destdir, $prefix) = @ARGV; +-my $realpath = $destdir.$prefix; +- +-unless (File::Spec->file_name_is_absolute($prefix)) { +- $prefix = File::Spec->rel2abs($prefix); +-} +- +-if ($^O eq 'MSWin32') { +- my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime'); +- my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib'); +- my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat'); +- +- open my $fh, ">", $install_to +- or die "Could not open $install_to: $!"; +- print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' . +- "$jar_dir\\asm-4.1.jar;$jar_dir\\jline-1.0.jar;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n"; +- close $fh +- or die "Could not close $install_to: $!"; +-} +-else { +- my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/); +- my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime'); +- my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib'); +- my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/asm-4.1.jar:$jar_dir/jline-1.0.jar:$lib_dir/nqp.jar"; +- my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j'); +- +- open my $fh, ">", $install_to +- or die "Could not open $install_to: $!"; +- print $fh "#!/bin/sh\n"; +- print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n"; +- print $fh ": \${NQP_JARS:=\"$jars\"}\n"; +- print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n"; +- close $fh +- or die "Could not close $install_to: $!"; +- chmod 0755, $install_to; +-} +diff --git a/tools/build/install-jvm-runner.pl.in b/tools/build/install-jvm-runner.pl.in +new file mode 100644 +index 0000000..92a1109 +--- /dev/null ++++ b/tools/build/install-jvm-runner.pl.in +@@ -0,0 +1,44 @@ ++#!/usr/bin/perl ++# Copyright (C) 2013, The Perl Foundation. ++ ++use strict; ++use warnings; ++use 5.008; ++use File::Spec; ++ ++my ($destdir, $prefix) = @ARGV; ++my $realpath = $destdir.$prefix; ++ ++unless (File::Spec->file_name_is_absolute($prefix)) { ++ $prefix = File::Spec->rel2abs($prefix); ++} ++ ++if ($^O eq 'MSWin32') { ++ my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime'); ++ my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib'); ++ my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat'); ++ ++ open my $fh, ">", $install_to ++ or die "Could not open $install_to: $!"; ++ print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' . ++ "$jar_dir\\@asmfile@;$jar_dir\\@jlinefile@;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n"; ++ close $fh ++ or die "Could not close $install_to: $!"; ++} ++else { ++ my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/); ++ my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime'); ++ my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib'); ++ my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/@asmfile@:$jar_dir/@jlinefile@:$lib_dir/nqp.jar"; ++ my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j'); ++ ++ open my $fh, ">", $install_to ++ or die "Could not open $install_to: $!"; ++ print $fh "#!/bin/sh\n"; ++ print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n"; ++ print $fh ": \${NQP_JARS:=\"$jars\"}\n"; ++ print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n"; ++ close $fh ++ or die "Could not close $install_to: $!"; ++ chmod 0755, $install_to; ++} diff --git a/dev-lang/nqp/metadata.xml b/dev-lang/nqp/metadata.xml index a710c2f..4e5de95 100644 --- a/dev-lang/nqp/metadata.xml +++ b/dev-lang/nqp/metadata.xml @@ -2,17 +2,18 @@ - patrick@gentoo.org - Patrick Lauer + patrick@gentoo.org + Patrick Lauer - perl@gentoo.org - Gentoo Perl Project + perl@gentoo.org + Gentoo Perl Project - Build the MoarVM backend (experimental/broken) + Toggle usage of the clang compiler in conjunction with MoarVM + Build the MoarVM backend (experimental/broken) - perl6/nqp + perl6/nqp diff --git a/dev-lang/nqp/nqp-2016.04-r1.ebuild b/dev-lang/nqp/nqp-2016.04-r1.ebuild new file mode 100644 index 0000000..4354072 --- /dev/null +++ b/dev-lang/nqp/nqp-2016.04-r1.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit java-pkg-2 + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/perl6/${PN}.git" + inherit git-r3 + KEYWORDS="" +else + SRC_URI="https://github.com/perl6/${PN}/tarball/${PV} -> ${P}.tar.gz" + KEYWORDS="~x86 ~amd64" +fi + +DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler" +HOMEPAGE="http://rakudo.org/" + +LICENSE="Artistic-2" +SLOT="0" +IUSE="doc clang java +moar test" +REQUIRED_USE="|| ( java moar )" + +RDEPEND="java? ( >=virtual/jre-1.7:* + dev-java/asm:4 + dev-java/jline:0 ) + moar? ( ~dev-lang/moarvm-${PV}[clang=] ) + dev-libs/libffi" +DEPEND="${RDEPEND} + clang? ( sys-devel/clang ) + java? ( >=virtual/jdk-1.7:* ) + dev-lang/perl" +PATCHES=( "${FILESDIR}/enable-external-jars.patch" ) + +pkg_setup() { + use java && java-pkg-2_pkg_setup +} + +src_prepare() { + eapply "${PATCHES[@]}" + eapply_user + use java && java-pkg-2_src_prepare +} + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + else + unpack ${A} + mv "${WORKDIR}/perl6-nqp-"* "${WORKDIR}/${P}" || die + fi +} + +src_configure() { + # 2016.04 doesn't like our jna-3.4.1 + # keep testing against it + local backends + use java && backends+="jvm," + use moar && backends+="moar" + local myconfargs=( + "--backend=${backends}" + "--with-asm=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm\.jar$')" + "--with-asm-tree=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm-tree\.jar$')" + "--with-jline=$(echo $(java-pkg_getjars jline) | tr : '\n' | grep '/jline\.jar$')" + "--prefix=/usr" ) + perl Configure.pl "${myconfargs[@]}" || die +} + +src_compile() { + MAKEOPTS=-j1 emake +} + +src_test() { + MAKEOPTS=-j1 emake test +} + +src_install() { + emake DESTDIR="${ED}" install || die + + dodoc CREDITS README.pod || die + + if use doc; then + dodoc -r docs/* || die + fi +} diff --git a/dev-lang/nqp/nqp-9999.ebuild b/dev-lang/nqp/nqp-9999.ebuild new file mode 100644 index 0000000..4354072 --- /dev/null +++ b/dev-lang/nqp/nqp-9999.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit java-pkg-2 + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/perl6/${PN}.git" + inherit git-r3 + KEYWORDS="" +else + SRC_URI="https://github.com/perl6/${PN}/tarball/${PV} -> ${P}.tar.gz" + KEYWORDS="~x86 ~amd64" +fi + +DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler" +HOMEPAGE="http://rakudo.org/" + +LICENSE="Artistic-2" +SLOT="0" +IUSE="doc clang java +moar test" +REQUIRED_USE="|| ( java moar )" + +RDEPEND="java? ( >=virtual/jre-1.7:* + dev-java/asm:4 + dev-java/jline:0 ) + moar? ( ~dev-lang/moarvm-${PV}[clang=] ) + dev-libs/libffi" +DEPEND="${RDEPEND} + clang? ( sys-devel/clang ) + java? ( >=virtual/jdk-1.7:* ) + dev-lang/perl" +PATCHES=( "${FILESDIR}/enable-external-jars.patch" ) + +pkg_setup() { + use java && java-pkg-2_pkg_setup +} + +src_prepare() { + eapply "${PATCHES[@]}" + eapply_user + use java && java-pkg-2_src_prepare +} + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + else + unpack ${A} + mv "${WORKDIR}/perl6-nqp-"* "${WORKDIR}/${P}" || die + fi +} + +src_configure() { + # 2016.04 doesn't like our jna-3.4.1 + # keep testing against it + local backends + use java && backends+="jvm," + use moar && backends+="moar" + local myconfargs=( + "--backend=${backends}" + "--with-asm=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm\.jar$')" + "--with-asm-tree=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm-tree\.jar$')" + "--with-jline=$(echo $(java-pkg_getjars jline) | tr : '\n' | grep '/jline\.jar$')" + "--prefix=/usr" ) + perl Configure.pl "${myconfargs[@]}" || die +} + +src_compile() { + MAKEOPTS=-j1 emake +} + +src_test() { + MAKEOPTS=-j1 emake test +} + +src_install() { + emake DESTDIR="${ED}" install || die + + dodoc CREDITS README.pod || die + + if use doc; then + dodoc -r docs/* || die + fi +} diff --git a/dev-lang/rakudo/files/rakudo-2016.04-Makefile.in.patch b/dev-lang/rakudo/files/rakudo-2016.04-Makefile.in.patch new file mode 100644 index 0000000..adafa0d --- /dev/null +++ b/dev-lang/rakudo/files/rakudo-2016.04-Makefile.in.patch @@ -0,0 +1,17 @@ +diff -Naur a/tools/build/Makefile-Moar.in b/tools/build/Makefile-Moar.in +--- a/tools/build/Makefile-Moar.in 2016-02-02 14:27:13.000000000 +0100 ++++ b/tools/build/Makefile-Moar.in 2016-04-22 15:01:35.338534944 +0200 +@@ -87,11 +87,11 @@ + $(M_CC) @moar::ccswitch@ @moar::ccshared@ $(M_CFLAGS) -I$(PREFIX)/include/libatomic_ops \ + -I$(PREFIX)/include/dyncall -I$(PREFIX)/include/moar \ + -I$(PREFIX)/include/sha1 -I$(PREFIX)/include/tinymt -I$(PREFIX)/include/libtommath \ +- -I$(PREFIX)/include/libuv -I$(PREFIX)/include @moar::ccout@$(M_PERL6_OPS_OBJ) $(M_PERL6_OPS_SRC) ++ -I$(PREFIX)/include/libuv -I$(PREFIX)/include @moar::cincludes@ @moar::ccout@$(M_PERL6_OPS_OBJ) $(M_PERL6_OPS_SRC) + $(M_CC) @moar::ccswitch@ @moar::ccshared@ $(M_CFLAGS) -I$(PREFIX)/include/libatomic_ops \ + -I$(PREFIX)/include/dyncall -I$(PREFIX)/include/moar \ + -I$(PREFIX)/include/sha1 -I$(PREFIX)/include/tinymt -I$(PREFIX)/include/libtommath \ +- -I$(PREFIX)/include/libuv -I$(PREFIX)/include @moar::ccout@$(M_PERL6_CONT_OBJ) $(M_PERL6_CONT_SRC) ++ -I$(PREFIX)/include/libuv -I$(PREFIX)/include @moar::cincludes@ @moar::ccout@$(M_PERL6_CONT_OBJ) $(M_PERL6_CONT_SRC) + $(M_LD) @moar::ldswitch@ -L@moar::libdir@ @moar::ldshared@ $(M_LDFLAGS) @moar::ldout@$(M_PERL6_OPS_DLL) $(M_PERL6_OPS_OBJ) $(M_PERL6_CONT_OBJ) -lmoar @moarimplib@ + + $(PERL6_ML_MOAR): src/Perl6/ModuleLoader.nqp src/vm/moar/ModuleLoaderVMConfig.nqp diff --git a/dev-lang/rakudo/metadata.xml b/dev-lang/rakudo/metadata.xml index 5a5e997..6f00a12 100644 --- a/dev-lang/rakudo/metadata.xml +++ b/dev-lang/rakudo/metadata.xml @@ -5,8 +5,12 @@ patrick@gentoo.org Patrick Lauer - - perl@gentoo.org - Gentoo Perl Project - + + perl@gentoo.org + Gentoo Perl Project + + + Use Clang to compile the MoarVM backend + Use the MoarVM as backend + diff --git a/dev-lang/rakudo/rakudo-2016.04-r1.ebuild b/dev-lang/rakudo/rakudo-2016.04-r1.ebuild new file mode 100644 index 0000000..c6696c6 --- /dev/null +++ b/dev-lang/rakudo/rakudo-2016.04-r1.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit java-pkg-2 + +DESCRIPTION="A compiler for the Perl 6 programming language" +HOMEPAGE="http://rakudo.org" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/rakudo/${PN}.git" + inherit git-r3 + KEYWORDS="" +else + SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="Artistic-2" +SLOT="0" +# TODO: add USE="javascript" once that's usable in nqp +IUSE="clang java moar test" + +RDEPEND="~dev-lang/nqp-${PV}:=[java=,moar=,clang=]" +DEPEND="${RDEPEND} + clang? ( sys-devel/clang ) + >=dev-lang/perl-5.10" + +REQUIRED_USE="|| ( java moar )" +PATCHES=( "${FILESDIR}/${PN}-2016.04-Makefile.in.patch" ) + +pkg_pretend() { + if has_version dev-lang/rakudo && use java; then + die "Rakudo is known to fail compilation with the jvm backend if it's already installed." + fi +} + +pkg_setup() { + use java && java-pkg-2_pkg_setup +} + +src_prepare() { + eapply "${PATCHES[@]}" + + # yup, this is ugly. but emake doesn't respect DESTDIR. + for i in Moar JVM; do + echo "DESTDIR = ${D}" > "${T}/Makefile-${i}.in" || die + cat "${S}/tools/build/Makefile-${i}.in" >> "${T}/Makefile-${i}.in" || die + mv "${T}/Makefile-${i}.in" "${S}/tools/build/Makefile-${i}.in" || die + done + + eapply_user + use java && java-pkg-2_src_prepare +} + +src_configure() { + local backends + use java && backends+="jvm," + use moar && backends+="moar," + local myargs=( "--prefix=/usr" + "--sysroot=/" + "--sdkroot=/" + "--make-install" + "--sdkroot=/" + "--backends=${backends}" + ) + perl Configure.pl "${myargs[@]}" +} + +src_compile() { + emake DESTDIR="${D}" +} + +src_test() { + export RAKUDO_PRECOMP_PREFIX=$(mktemp -d) + default +} + +src_install() { + emake DESTDIR="${D}" install +} diff --git a/dev-lang/rakudo/rakudo-9999.ebuild b/dev-lang/rakudo/rakudo-9999.ebuild new file mode 100644 index 0000000..1dcb10a --- /dev/null +++ b/dev-lang/rakudo/rakudo-9999.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit java-pkg-2 + +DESCRIPTION="A compiler for the Perl 6 programming language" +HOMEPAGE="http://rakudo.org" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/rakudo/${PN}.git" + inherit git-r3 + KEYWORDS="" +else + SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="Artistic-2" +SLOT="0" +# TODO: add USE="javascript" once that's usable in nqp +IUSE="clang java moar test" + +RDEPEND="~dev-lang/nqp-${PV}:=[java=,moar=,clang=]" +DEPEND="${RDEPEND} + clang? ( sys-devel/clang ) + >=dev-lang/perl-5.10" + +REQUIRED_USE="|| ( java moar )" +PATCHES=( "${FILESDIR}/${PN}-2016.04-Makefile.in.patch" ) + +pkg_pretend() { + if has_version dev-lang/rakudo && use java; then + die "Rakudo is known to fail compilation with the jvm backend if it's already installed." + fi +} + +pkg_setup() { + use java && java-pkg-2_pkg_setup +} + +src_prepare() { + eapply "${PATCHES[@]}" + + # yup, this is ugly. but emake doesn't respect DESTDIR. + for i in Moar JVM; do + echo "DESTDIR = ${D}" > "${T}/Makefile-${i}.in" || die + cat "${S}/tools/build/Makefile-${i}.in" >> "${T}/Makefile-${i}.in" || die + mv "${T}/Makefile-${i}.in" "${S}/tools/build/Makefile-${i}.in" || die + done + + eapply_user + use java && java-pkg-2_src_prepare +} + +src_configure() { + local backends + use java && backends+="jvm," + use moar && backends+="moar," + local myargs=( "--prefix=/usr" + "--sysroot=/" + "--sdkroot=/" + "--make-install" + "--sdkroot=/" + "--backends=${backends}" + ) + perl Configure.pl "${myargs[@]}" +} + +src_compile() { + emake DESTDIR="${D}" +} + +src_test() { + export RAKUDO_PRECOMP_PREFIX=$(mktemp -d) + default +} + +src_install() { + emake DESTDIR="${D}" install +} diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask index 802eac7..af629db 100644 --- a/profiles/base/package.use.mask +++ b/profiles/base/package.use.mask @@ -5,6 +5,11 @@ # This file requires >=portage-2.1.1 # New entries go on top. +# Matthew Brewer (4 May 2016) +# Upstream supports using Clang's address sanitizer, but apparently +# invokes it wrong. +dev-lang/moarvm asan + # Michael Palimaka (05 May 2016) # Doesn't work media-libs/openimageio python