Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 580732 | Differences between
and this patch

Collapse All | Expand All

(-)a/dev-lang/moarvm/files/Configure-2016.04.patch (+145 lines)
Line 0 Link Here
1
diff --git a/Configure.pl b/Configure.pl
2
index 72a5dad..f829d5c 100755
3
--- a/Configure.pl
4
+++ b/Configure.pl
5
@@ -32,7 +32,7 @@ GetOptions(\%args, qw(
6
     os=s shell=s toolchain=s compiler=s
7
     ar=s cc=s ld=s make=s has-sha has-libuv
8
     static has-libtommath has-libatomic_ops
9
-    has-dyncall has-libffi
10
+    has-dyncall has-libffi pkgconfig=s
11
     build=s host=s big-endian jit! enable-jit lua=s has-dynasm
12
     prefix=s bindir=s libdir=s mastdir=s make-install asan ubsan),
13
     'no-optimize|nooptimize' => sub { $args{optimize} = 0 },
14
@@ -99,6 +99,7 @@ $config{config} = join ' ', map { / / ? "\"$_\"" : $_ } @args;
15
 $config{osname} = $^O;
16
 $config{osvers} = $Config{osvers};
17
 $config{lua} = $args{lua} // './3rdparty/dynasm/minilua@exe@';
18
+$config{pkgconfig} = $args{pkgconfig} // '/usr/bin/pkg-config';
19
 
20
 # set options that take priority over all others
21
 my @keys = qw( ar cc ld make );
22
@@ -164,12 +165,33 @@ if (-e '3rdparty/libuv/src/unix/threadpool' . $defaults{obj}
23
     system($defaults{make}, 'realclean')
24
 }
25
 
26
+# test whether pkg-config works
27
+if (-e "$config{pkgconfig}") {
28
+    print("\nTesting pkgconfig ... ");
29
+    system("$config{pkgconfig}", "--version");
30
+    if ( $? == 0 ) {
31
+        $config{pkgconfig_works} = 1;
32
+    } else {
33
+        $config{pkgconfig_works} = 0;
34
+    }
35
+}
36
+
37
 # conditionally set include dirs and install rules
38
 $config{cincludes} //= '';
39
 $config{install}   //= '';
40
 if ($args{'has-libuv'}) {
41
     $defaults{-thirdparty}->{uv} = undef;
42
     unshift @{$config{usrlibs}}, 'uv';
43
+    if ($config{pkgconfig_works}) {
44
+        my $result = `$config{pkgconfig} --cflags libuv`;
45
+        if ( $? == 0 ) {
46
+            $result =~ s/\n/ /g;
47
+            $config{cincludes} .= ' ' . "$result";
48
+            print("Adding extra include for libuv: $result\n");
49
+        } else {
50
+            print("Error occured when running $config{pkgconfig} --cflags libuv.\n");
51
+        }
52
+    }
53
 }
54
 else {
55
     $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libuv/include'
56
@@ -181,6 +203,16 @@ else {
57
 if ($args{'has-libatomic_ops'}) {
58
     $defaults{-thirdparty}->{lao} = undef;
59
     unshift @{$config{usrlibs}}, 'atomic_ops';
60
+    if ($config{pkgconfig_works}) {
61
+        my $result = `$config{pkgconfig} --cflags atomic_ops`;
62
+        if ( $? == 0 ) {
63
+            $result =~ s/\n/ /g;
64
+            $config{cincludes} .= ' ' . "$result";
65
+            print("Adding extra include for atomic_ops: $result\n");
66
+        } else {
67
+            print("Error occured when running $config{pkgconfig} --cflags atomic_ops.\n");
68
+        }
69
+    }
70
 }
71
 else {
72
     $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libatomic_ops/src';
73
@@ -216,7 +248,8 @@ if ($args{'has-libtommath'}) {
74
 }
75
 else {
76
     $config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/libtommath';
77
-    $config{install}   .= "\t\$(CP) 3rdparty/libtommath/*.h \$(DESTDIR)\$(PREFIX)/include/libtommath\n";
78
+    $config{install}   .= "\t\$(MKPATH) \$(DESTDIR)\$(PREFIX)/include/libtommath\n"
79
+                        . "\t\$(CP) 3rdparty/libtommath/*.h \$(DESTDIR)\$(PREFIX)/include/libtommath\n";
80
 }
81
 
82
 if ($args{'has-dynasm'}) {
83
@@ -232,6 +265,16 @@ if ($args{'has-libffi'}) {
84
     $config{nativecall_backend} = 'libffi';
85
     unshift @{$config{usrlibs}}, 'ffi';
86
     push @{$config{defs}}, 'HAVE_LIBFFI';
87
+    if ($config{pkgconfig_works}) {
88
+        my $result = `$config{pkgconfig} --cflags libffi`;
89
+        if ( $? == 0 ) {
90
+            $result =~ s/\n/ /g;
91
+            $config{cincludes} .= ' ' . "$result";
92
+            print("Adding extra include for libffi: $result\n");
93
+        } else {
94
+            print("Error occured when running $config{pkgconfig} --cflags libffi.\n");
95
+        }
96
+    }
97
 }
98
 elsif ($args{'has-dyncall'}) {
99
     unshift @{$config{usrlibs}}, 'dyncall_s', 'dyncallback_s', 'dynload_s';
100
@@ -364,6 +407,7 @@ my $order = $config{be} ? 'big endian' : 'little endian';
101
 print "\n", <<TERM, "\n";
102
         make: $config{make}
103
      compile: $config{cc} $config{cflags}
104
+    includes: $config{cincludes}
105
         link: $config{ld} $config{ldflags}
106
         libs: $config{ldlibs}
107
 
108
@@ -873,6 +917,10 @@ Build and install MoarVM in addition to configuring it.
109
 
110
 =item --has-libffi
111
 
112
+=item --pkgconfig=/path/to/pkgconfig/executable
113
+
114
+Provide path to the pkgconfig executable. Default: /usr/bin/pkg-config
115
+
116
 =item --no-jit
117
 
118
 Disable JIT compiler, which is enabled by default to JIT-compile hot frames.
119
diff --git a/build/Makefile.in b/build/Makefile.in
120
index 56a4c8a..b94e847 100644
121
--- a/build/Makefile.in
122
+++ b/build/Makefile.in
123
@@ -454,9 +454,6 @@ install: all
124
 	$(CP) src/strings/*.h $(DESTDIR)$(PREFIX)/include/moar/strings
125
 	$(CP) src/jit/*.h $(DESTDIR)$(PREFIX)/include/moar/jit
126
 	$(CP) src/instrument/*.h $(DESTDIR)$(PREFIX)/include/moar/instrument
127
-	$(MKPATH) $(DESTDIR)$(PREFIX)/include/libuv
128
-	$(MKPATH) $(DESTDIR)$(PREFIX)/include/libtommath
129
-	$(CP) 3rdparty/libuv/include/*.h $(DESTDIR)$(PREFIX)/include/libuv
130
 @install@
131
 
132
 lib: @moar@
133
diff --git a/build/setup.pm b/build/setup.pm
134
index 324cc88..c87d79e 100755
135
--- a/build/setup.pm
136
+++ b/build/setup.pm
137
@@ -125,7 +125,7 @@ our %TC_POSIX = (
138
     ccshared   => '-fPIC',
139
     ldshared   => '-shared @ccshared@',
140
     moarshared => '',
141
-    ldrpath    => '-Wl,-rpath,@libdir@ -Wl,-rpath,@prefix@/share/perl6/site/lib',
142
+    ldrpath    => '-Wl,-rpath,/@libdir@ -Wl,-rpath,@prefix@/share/perl6/site/lib',
143
 
144
     arflags => 'rcs',
145
     arout   => '',
(-)a/dev-lang/moarvm/metadata.xml (-5 / +13 lines)
Lines 2-15 Link Here
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
3
<pkgmetadata>
4
  <maintainer type="person">
4
  <maintainer type="person">
5
    <email>patrick@gentoo.org</email>
5
	<email>patrick@gentoo.org</email>
6
    <name>Patrick Lauer</name>
6
	<name>Patrick Lauer</name>
7
  </maintainer>
7
  </maintainer>
8
  <maintainer type="project">
8
  <maintainer type="project">
9
    <email>perl@gentoo.org</email>
9
	<email>perl@gentoo.org</email>
10
    <name>Gentoo Perl Project</name>
10
	<name>Gentoo Perl Project</name>
11
  </maintainer>
11
  </maintainer>
12
  <use>
13
	<flag name="asan">Enable clang's Address Sanitizer functionality. Expect longer compile time.</flag>
14
	<flag name="clang">Use clang compiler instead of GCC</flag>
15
	<flag name="jit">Enable Just-In-Time-Compiler. Has no effect except on AMD64 and Darwin.</flag>
16
	<flag name="optimize">Enable optimization via CFLAGS</flag>
17
	<flag name="system-libs">Link against the system's shared libraries</flag>
18
	<flag name="ubsan">Enable clang's Undefined Behavior Sanitizer functionality. Expect longer compile time.</flag>
19
  </use>
12
  <upstream>
20
  <upstream>
13
    <remote-id type="github">MoarVM/MoarVM</remote-id>
21
	<remote-id type="github">MoarVM/MoarVM</remote-id>
14
  </upstream>
22
  </upstream>
15
</pkgmetadata>
23
</pkgmetadata>
(-)a/dev-lang/moarvm/moarvm-2016.04-r1.ebuild (+68 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=6
6
7
inherit flag-o-matic
8
9
MY_PN="MoarVM"
10
if [[ ${PV} == "9999" ]]; then
11
	EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
12
	inherit git-r3
13
	KEYWORDS=""
14
	S="${WORKDIR}/${P}"
15
else
16
	SRC_URI="https://moarvm.org/releases/${MY_PN}-${PV}.tar.gz"
17
	KEYWORDS="~amd64 ~x86"
18
	S="${WORKDIR}/${MY_PN}-${PV}"
19
fi
20
21
DESCRIPTION="A 6model-based VM for NQP and Rakudo Perl 6"
22
HOMEPAGE="http://moarvm.org"
23
LICENSE="Artistic-2"
24
SLOT="0"
25
IUSE="asan clang debug doc +jit static-libs +system-libs optimize ubsan"
26
27
RDEPEND="dev-libs/libatomic_ops
28
		dev-libs/libtommath
29
		dev-libs/libuv
30
		jit? ( dev-lang/lua:0[deprecated]
31
			dev-lua/LuaBitOp )
32
		virtual/libffi"
33
DEPEND="${RDEPEND}
34
	clang? ( >=sys-devel/clang-3.1 )
35
	dev-lang/perl"
36
37
PATCHES=( "${FILESDIR}/Configure-2016.04.patch" )
38
DOCS=( CREDITS README.markdown )
39
40
# Tests are conducted via nqp
41
RESTRICT=test
42
43
src_prepare() {
44
	eapply "${PATCHES[@]}"
45
	eapply_user
46
	use doc && DOCS+=( docs/* )
47
}
48
49
src_configure() {
50
	local myconfigargs=(
51
		"--prefix=/usr"
52
		"--libdir=$(get_libdir)"
53
		"--compiler=$(usex clang clang gcc)"
54
		"$(usex asan        --asan)"
55
		"$(usex debug       --debug            --no-debug)"
56
		"$(usex jit         --lua=/usr/bin/lua --no-jit)"
57
		"$(usex optimize    --optimize=        --no-optimize)"
58
		"$(usex static-libs --static)"
59
		"$(usex system-libs --has-libtommath)"
60
		"$(usex system-libs --has-libuv)"
61
		"$(usex system-libs --has-libatomic_ops)"
62
		"$(usex system-libs --has-libffi)"
63
		"$(usex ubsan       --ubsan)"
64
	)
65
	use optimize && filter-flags '-O*'
66
67
	perl Configure.pl "${myconfigargs[@]}" || die
68
}
(-)a/dev-lang/moarvm/moarvm-9999.ebuild (-16 / +48 lines)
Lines 1-36 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
3
# $Id$
4
4
5
EAPI=5
5
EAPI=6
6
6
7
inherit eutils git-r3
7
inherit flag-o-matic
8
8
9
MY_PN="MoarVM"
9
MY_PN="MoarVM"
10
if [[ ${PV} == "9999" ]]; then
11
	EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
12
	inherit git-r3
13
	KEYWORDS=""
14
	S="${WORKDIR}/${P}"
15
else
16
	SRC_URI="https://moarvm.org/releases/${MY_PN}-${PV}.tar.gz"
17
	KEYWORDS="~amd64 ~x86"
18
	S="${WORKDIR}/${MY_PN}-${PV}"
19
fi
10
20
11
DESCRIPTION="A 6model-based VM for NQP and Rakudo Perl 6"
21
DESCRIPTION="A 6model-based VM for NQP and Rakudo Perl 6"
12
HOMEPAGE="https://github.com/MoarVM/MoarVM"
22
HOMEPAGE="http://moarvm.org"
13
EGIT_REPO_URI="https://github.com/MoarVM/MoarVM.git"
14
15
LICENSE="Artistic-2"
23
LICENSE="Artistic-2"
16
SLOT="0"
24
SLOT="0"
17
KEYWORDS=""
25
IUSE="asan clang debug doc +jit static-libs +system-libs optimize ubsan"
18
IUSE="doc"
19
26
20
RDEPEND=""
27
RDEPEND="dev-libs/libatomic_ops
28
		dev-libs/libtommath
29
		dev-libs/libuv
30
		jit? ( dev-lang/lua:0[deprecated]
31
			dev-lua/LuaBitOp )
32
		virtual/libffi"
21
DEPEND="${RDEPEND}
33
DEPEND="${RDEPEND}
34
	clang? ( >=sys-devel/clang-3.1 )
22
	dev-lang/perl"
35
	dev-lang/perl"
23
36
37
PATCHES=( "${FILESDIR}/Configure-2016.04.patch" )
38
DOCS=( CREDITS README.markdown )
39
40
# Tests are conducted via nqp
41
RESTRICT=test
42
24
src_prepare() {
43
src_prepare() {
25
	epatch "${FILESDIR}/Configure-9999.patch" || die
44
	eapply "${PATCHES[@]}"
45
	eapply_user
46
	use doc && DOCS+=( docs/* )
26
}
47
}
27
48
28
src_configure() {
49
src_configure() {
29
	 # this is quite badong, but wtf build system
50
	local myconfigargs=(
30
	echo "2013.10-145-gec52026" >> VERSION
51
		"--prefix=/usr"
31
	perl Configure.pl --prefix="${D}/usr"|| die
52
		"--libdir=$(get_libdir)"
32
}
53
		"--compiler=$(usex clang clang gcc)"
54
		"$(usex asan        --asan)"
55
		"$(usex debug       --debug            --no-debug)"
56
		"$(usex jit         --lua=/usr/bin/lua --no-jit)"
57
		"$(usex optimize    --optimize=        --no-optimize)"
58
		"$(usex static-libs --static)"
59
		"$(usex system-libs --has-libtommath)"
60
		"$(usex system-libs --has-libuv)"
61
		"$(usex system-libs --has-libatomic_ops)"
62
		"$(usex system-libs --has-libffi)"
63
		"$(usex ubsan       --ubsan)"
64
	)
65
	use optimize && filter-flags '-O*'
33
66
34
src_install() {
67
	perl Configure.pl "${myconfigargs[@]}" || die
35
	make install
36
}
68
}
(-)a/dev-lang/nqp/files/enable-external-jars.patch (+214 lines)
Line 0 Link Here
1
diff --git a/Configure.pl b/Configure.pl
2
index 2064ac8..73e2d27 100755
3
--- a/Configure.pl
4
+++ b/Configure.pl
5
@@ -34,6 +34,7 @@ MAIN: {
6
                'no-clean',
7
                'with-parrot=s', 'gen-parrot:s', 'parrot-config=s', 'parrot-option=s@',
8
                'with-moar=s', 'gen-moar:s', 'moar-option=s@',
9
+               'with-asm=s', 'with-asm-tree=s', 'with-jline=s', 'with-jna=s',
10
                'make-install!', 'makefile-timing!',
11
                'git-protocol=s',
12
                'git-depth=s', 'git-reference=s',);
13
@@ -50,6 +51,53 @@ MAIN: {
14
               "Use --prefix to specify a directory in which parrot is installed.";
15
     }
16
 
17
+    if ($options{'with-asm'}) {
18
+        if ($options{'with-asm'} ne '-') {
19
+            $config{'asm'} = $options{'with-asm'};
20
+        }
21
+    } else {
22
+        $config{'asm'} = "3rdparty/asm/asm-4.1.jar";
23
+    }
24
+    if ($options{'with-asm-tree'}) {
25
+        if ($options{'with-asm-tree'} ne '-') {
26
+            $config{'asmtree'} = $options{'with-asm-tree'};
27
+        }
28
+    } else {
29
+        $config{'asmtree'} = "3rdparty/asm/asm-tree-4.1.jar";
30
+    }
31
+    if ($options{'with-jline'}) {
32
+        if ($options{'with-jline'} ne '-') {
33
+            $config{'jline'} = $options{'with-jline'};
34
+        }
35
+    } else {
36
+        $config{'jline'} = "3rdparty/jline/jline-1.0.jar";
37
+    }
38
+    if ($options{'with-jna'}) {
39
+        if ($options{'with-jna'} ne '-') {
40
+            $config{'jna'} = $options{'with-jna'};
41
+        }
42
+    } else {
43
+        $config{'jna'} = "3rdparty/jna/jna.jar";
44
+    }
45
+
46
+    if ($^O eq 'MSWin32') {
47
+        $config{'asmfile'} = $config{'asm'};
48
+        $config{'asmfile'} =~ s/.*\\//;
49
+        $config{'jlinefile'} = $config{'jline'};
50
+        $config{'jlinefile'} =~ s/.*\\//;
51
+    } else {
52
+        $config{'asmfile'} = $config{'asm'};
53
+        $config{'asmfile'} =~ s/.*\///;
54
+        $config{'jlinefile'} = $config{'jline'};
55
+        $config{'jlinefile'} =~ s/.*\///;
56
+    }
57
+
58
+    fill_template_file(
59
+        'tools/build/install-jvm-runner.pl.in',
60
+        'tools/build/install-jvm-runner.pl',
61
+        %config,
62
+    );
63
+
64
     my $default_backend;
65
     my @backends;
66
     my %backends;
67
@@ -357,6 +405,11 @@ General Options:
68
     --gen-moar         Download and build a copy of MoarVM to use
69
     --moar-option='--option=value'
70
                        Options to pass to MoarVM configuration for --gen-moar
71
+    --with-asm='/path/to/jar'
72
+    --with-asm-tree='/path/to/jar'
73
+    --with-jline='/path/to/jar'
74
+    --with-jna='/path/to/jar'
75
+                       Provide paths to already installed jars
76
     --git-protocol={ssh,https,git}
77
                        Protocol to use for git clone. Default: https
78
     --make-install     Immediately run `MAKE install` after configuring
79
diff --git a/tools/build/Makefile-JVM.in b/tools/build/Makefile-JVM.in
80
index 27959ad..c19965a 100644
81
--- a/tools/build/Makefile-JVM.in
82
+++ b/tools/build/Makefile-JVM.in
83
@@ -2,7 +2,6 @@ BAT    = @bat@
84
 JAVA   = java
85
 JAVAC  = javac
86
 JAR    = jar
87
-ASM    = 3rdparty/asm/
88
 J_RUNNER = nqp-j$(BAT)
89
 
90
 NQP_JAR_DIR = $(NQP_LANG_DIR)/runtime
91
@@ -18,7 +17,11 @@ RUNTIME_JAVAS = \
92
 
93
 RUNTIME_JAR = nqp-runtime.jar
94
 
95
-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
96
+ASM = @asm@
97
+ASMTREE = @asmtree@
98
+JLINE = @jline@
99
+JNA = @jna@
100
+THIRDPARTY_JARS = $(ASM)@cpsep@$(ASMTREE)@cpsep@$(JLINE)@cpsep@$(JNA)
101
 J_STAGE0 = src/vm/jvm/stage0
102
 J_STAGE1 = $(JVM_BUILD_DIR)/stage1
103
 J_STAGE2 = $(JVM_BUILD_DIR)/stage2
104
@@ -80,8 +83,8 @@ j-install: j-all
105
 	$(MKPATH) $(DESTDIR)$(BIN_DIR)
106
 	$(MKPATH) $(DESTDIR)$(NQP_JAR_DIR)
107
 	$(MKPATH) $(DESTDIR)$(NQP_LIB_DIR)
108
-	$(CP) 3rdparty/asm/asm-4.1.jar 3rdparty/asm/asm-tree-4.1.jar  $(DESTDIR)$(NQP_JAR_DIR)
109
-	$(CP) 3rdparty/jline/jline-1.0.jar 3rdparty/jna/jna.jar $(DESTDIR)$(NQP_JAR_DIR)
110
+	$(CP) $(ASM) $(ASMTREE) $(DESTDIR)$(NQP_JAR_DIR)
111
+	$(CP) $(JLINE) $(JNA) $(DESTDIR)$(NQP_JAR_DIR)
112
 	$(CP) $(RUNTIME_JAR) $(DESTDIR)$(NQP_JAR_DIR)
113
 	$(CP) $(NQP_MO_JAR) $(MODULE_LOADER_JAR) $(DESTDIR)$(NQP_LIB_DIR)
114
 	$(CP) $(CORE_SETTING_JAR) $(QASTNODE_JAR) $(QREGEX_JAR) $(DESTDIR)$(NQP_LIB_DIR)
115
diff --git a/tools/build/install-jvm-runner.pl b/tools/build/install-jvm-runner.pl
116
deleted file mode 100644
117
index 14541d6..0000000
118
--- a/tools/build/install-jvm-runner.pl
119
+++ /dev/null
120
@@ -1,44 +0,0 @@
121
-#!/usr/bin/perl
122
-# Copyright (C) 2013, The Perl Foundation.
123
-
124
-use strict;
125
-use warnings;
126
-use 5.008;
127
-use File::Spec;
128
-
129
-my ($destdir, $prefix) = @ARGV;
130
-my $realpath = $destdir.$prefix;
131
-
132
-unless (File::Spec->file_name_is_absolute($prefix)) {
133
-    $prefix = File::Spec->rel2abs($prefix);
134
-}
135
-
136
-if ($^O eq 'MSWin32') {
137
-    my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime');
138
-    my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib');
139
-    my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat');
140
-
141
-    open my $fh, ">", $install_to
142
-        or die "Could not open $install_to: $!";
143
-    print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' .
144
-              "$jar_dir\\asm-4.1.jar;$jar_dir\\jline-1.0.jar;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n";
145
-    close $fh
146
-        or die "Could not close $install_to: $!";
147
-}
148
-else {
149
-    my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/);
150
-    my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime');
151
-    my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib');
152
-    my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/asm-4.1.jar:$jar_dir/jline-1.0.jar:$lib_dir/nqp.jar";
153
-    my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j');
154
-
155
-    open my $fh, ">", $install_to
156
-        or die "Could not open $install_to: $!";
157
-    print $fh "#!/bin/sh\n";
158
-    print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n";
159
-    print $fh ": \${NQP_JARS:=\"$jars\"}\n";
160
-    print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n";
161
-    close $fh
162
-        or die "Could not close $install_to: $!";
163
-    chmod 0755, $install_to;
164
-}
165
diff --git a/tools/build/install-jvm-runner.pl.in b/tools/build/install-jvm-runner.pl.in
166
new file mode 100644
167
index 0000000..92a1109
168
--- /dev/null
169
+++ b/tools/build/install-jvm-runner.pl.in
170
@@ -0,0 +1,44 @@
171
+#!/usr/bin/perl
172
+# Copyright (C) 2013, The Perl Foundation.
173
+
174
+use strict;
175
+use warnings;
176
+use 5.008;
177
+use File::Spec;
178
+
179
+my ($destdir, $prefix) = @ARGV;
180
+my $realpath = $destdir.$prefix;
181
+
182
+unless (File::Spec->file_name_is_absolute($prefix)) {
183
+    $prefix = File::Spec->rel2abs($prefix);
184
+}
185
+
186
+if ($^O eq 'MSWin32') {
187
+    my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime');
188
+    my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib');
189
+    my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat');
190
+
191
+    open my $fh, ">", $install_to
192
+        or die "Could not open $install_to: $!";
193
+    print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' .
194
+              "$jar_dir\\@asmfile@;$jar_dir\\@jlinefile@;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n";
195
+    close $fh
196
+        or die "Could not close $install_to: $!";
197
+}
198
+else {
199
+    my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/);
200
+    my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime');
201
+    my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib');
202
+    my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/@asmfile@:$jar_dir/@jlinefile@:$lib_dir/nqp.jar";
203
+    my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j');
204
+
205
+    open my $fh, ">", $install_to
206
+        or die "Could not open $install_to: $!";
207
+    print $fh "#!/bin/sh\n";
208
+    print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n";
209
+    print $fh ": \${NQP_JARS:=\"$jars\"}\n";
210
+    print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n";
211
+    close $fh
212
+        or die "Could not close $install_to: $!";
213
+    chmod 0755, $install_to;
214
+}
(-)a/dev-lang/nqp/metadata.xml (-6 / +7 lines)
Lines 2-18 Link Here
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
3
<pkgmetadata>
4
  <maintainer type="person">
4
  <maintainer type="person">
5
    <email>patrick@gentoo.org</email>
5
	<email>patrick@gentoo.org</email>
6
    <name>Patrick Lauer</name>
6
	<name>Patrick Lauer</name>
7
  </maintainer>
7
  </maintainer>
8
  <maintainer type="project">
8
  <maintainer type="project">
9
    <email>perl@gentoo.org</email>
9
	<email>perl@gentoo.org</email>
10
    <name>Gentoo Perl Project</name>
10
	<name>Gentoo Perl Project</name>
11
  </maintainer>
11
  </maintainer>
12
  <use>
12
  <use>
13
    <flag name="moar">Build the MoarVM backend (experimental/broken)</flag>
13
	<flag name="clang">Toggle usage of the clang compiler in conjunction with MoarVM</flag>
14
	<flag name="moar">Build the MoarVM backend (experimental/broken)</flag>
14
  </use>
15
  </use>
15
  <upstream>
16
  <upstream>
16
    <remote-id type="github">perl6/nqp</remote-id>
17
	<remote-id type="github">perl6/nqp</remote-id>
17
  </upstream>
18
  </upstream>
18
</pkgmetadata>
19
</pkgmetadata>
(-)a/dev-lang/nqp/nqp-2016.04-r1.ebuild (+87 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=6
6
7
inherit java-pkg-2
8
9
if [[ ${PV} == "9999" ]]; then
10
	EGIT_REPO_URI="https://github.com/perl6/${PN}.git"
11
	inherit git-r3
12
	KEYWORDS=""
13
else
14
	SRC_URI="https://github.com/perl6/${PN}/tarball/${PV} -> ${P}.tar.gz"
15
	KEYWORDS="~x86 ~amd64"
16
fi
17
18
DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler"
19
HOMEPAGE="http://rakudo.org/"
20
21
LICENSE="Artistic-2"
22
SLOT="0"
23
IUSE="doc clang java +moar test"
24
REQUIRED_USE="|| ( java moar )"
25
26
RDEPEND="java? ( >=virtual/jre-1.7:*
27
		dev-java/asm:4
28
		dev-java/jline:0 )
29
	moar? ( ~dev-lang/moarvm-${PV}[clang=] )
30
	dev-libs/libffi"
31
DEPEND="${RDEPEND}
32
	clang? ( sys-devel/clang )
33
	java? ( >=virtual/jdk-1.7:* )
34
	dev-lang/perl"
35
PATCHES=( "${FILESDIR}/enable-external-jars.patch" )
36
37
pkg_setup() {
38
	use java && java-pkg-2_pkg_setup
39
}
40
41
src_prepare() {
42
	eapply "${PATCHES[@]}"
43
	eapply_user
44
	use java && java-pkg-2_src_prepare
45
}
46
47
src_unpack() {
48
	if [[ ${PV} == "9999" ]]; then
49
		git-r3_src_unpack
50
	else
51
		unpack ${A}
52
		mv "${WORKDIR}/perl6-nqp-"* "${WORKDIR}/${P}" || die
53
	fi
54
}
55
56
src_configure() {
57
	# 2016.04 doesn't like our jna-3.4.1
58
	# keep testing against it
59
	local backends
60
	use java && backends+="jvm,"
61
	use moar && backends+="moar"
62
	local myconfargs=(
63
		"--backend=${backends}"
64
		"--with-asm=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm\.jar$')"
65
		"--with-asm-tree=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm-tree\.jar$')"
66
		"--with-jline=$(echo $(java-pkg_getjars jline) | tr : '\n' | grep '/jline\.jar$')"
67
		"--prefix=/usr" )
68
	perl Configure.pl "${myconfargs[@]}" || die
69
}
70
71
src_compile() {
72
	MAKEOPTS=-j1 emake
73
}
74
75
src_test() {
76
	MAKEOPTS=-j1 emake test
77
}
78
79
src_install() {
80
	emake DESTDIR="${ED}" install || die
81
82
	dodoc CREDITS README.pod || die
83
84
	if use doc; then
85
		dodoc -r docs/* || die
86
	fi
87
}
(-)a/dev-lang/nqp/nqp-9999.ebuild (+87 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=6
6
7
inherit java-pkg-2
8
9
if [[ ${PV} == "9999" ]]; then
10
	EGIT_REPO_URI="https://github.com/perl6/${PN}.git"
11
	inherit git-r3
12
	KEYWORDS=""
13
else
14
	SRC_URI="https://github.com/perl6/${PN}/tarball/${PV} -> ${P}.tar.gz"
15
	KEYWORDS="~x86 ~amd64"
16
fi
17
18
DESCRIPTION="Not Quite Perl, a Perl 6 bootstrapping compiler"
19
HOMEPAGE="http://rakudo.org/"
20
21
LICENSE="Artistic-2"
22
SLOT="0"
23
IUSE="doc clang java +moar test"
24
REQUIRED_USE="|| ( java moar )"
25
26
RDEPEND="java? ( >=virtual/jre-1.7:*
27
		dev-java/asm:4
28
		dev-java/jline:0 )
29
	moar? ( ~dev-lang/moarvm-${PV}[clang=] )
30
	dev-libs/libffi"
31
DEPEND="${RDEPEND}
32
	clang? ( sys-devel/clang )
33
	java? ( >=virtual/jdk-1.7:* )
34
	dev-lang/perl"
35
PATCHES=( "${FILESDIR}/enable-external-jars.patch" )
36
37
pkg_setup() {
38
	use java && java-pkg-2_pkg_setup
39
}
40
41
src_prepare() {
42
	eapply "${PATCHES[@]}"
43
	eapply_user
44
	use java && java-pkg-2_src_prepare
45
}
46
47
src_unpack() {
48
	if [[ ${PV} == "9999" ]]; then
49
		git-r3_src_unpack
50
	else
51
		unpack ${A}
52
		mv "${WORKDIR}/perl6-nqp-"* "${WORKDIR}/${P}" || die
53
	fi
54
}
55
56
src_configure() {
57
	# 2016.04 doesn't like our jna-3.4.1
58
	# keep testing against it
59
	local backends
60
	use java && backends+="jvm,"
61
	use moar && backends+="moar"
62
	local myconfargs=(
63
		"--backend=${backends}"
64
		"--with-asm=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm\.jar$')"
65
		"--with-asm-tree=$(echo $(java-pkg_getjars asm-4) | tr : '\n' | grep '/asm-tree\.jar$')"
66
		"--with-jline=$(echo $(java-pkg_getjars jline) | tr : '\n' | grep '/jline\.jar$')"
67
		"--prefix=/usr" )
68
	perl Configure.pl "${myconfargs[@]}" || die
69
}
70
71
src_compile() {
72
	MAKEOPTS=-j1 emake
73
}
74
75
src_test() {
76
	MAKEOPTS=-j1 emake test
77
}
78
79
src_install() {
80
	emake DESTDIR="${ED}" install || die
81
82
	dodoc CREDITS README.pod || die
83
84
	if use doc; then
85
		dodoc -r docs/* || die
86
	fi
87
}
(-)a/dev-lang/rakudo/metadata.xml (-4 / +10 lines)
Line 0 Link Here
1
diff -Naur a/tools/build/Makefile-Moar.in b/tools/build/Makefile-Moar.in
2
--- a/tools/build/Makefile-Moar.in	2016-02-02 14:27:13.000000000 +0100
Lines 5-12 Link Here
5
		<email>patrick@gentoo.org</email>
5
		<email>patrick@gentoo.org</email>
6
		<name>Patrick Lauer</name>
6
		<name>Patrick Lauer</name>
7
	</maintainer>
7
	</maintainer>
8
        <maintainer type="project">
8
	<maintainer type="project">
9
        <email>perl@gentoo.org</email>
9
		<email>perl@gentoo.org</email>
10
        <name>Gentoo Perl Project</name>
10
		<name>Gentoo Perl Project</name>
11
        </maintainer>
11
	</maintainer>
12
	<use>
13
		<flag name="clang">Use Clang to compile the MoarVM backend</flag>
14
		<flag name="moar">Use the MoarVM as backend</flag>
15
	</use>
12
</pkgmetadata>
16
</pkgmetadata>
(-)a/dev-lang/rakudo/rakudo-2016.04-r1.ebuild (+83 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=6
6
7
inherit java-pkg-2
8
9
DESCRIPTION="A compiler for the Perl 6 programming language"
10
HOMEPAGE="http://rakudo.org"
11
12
if [[ ${PV} == "9999" ]]; then
13
	EGIT_REPO_URI="https://github.com/rakudo/${PN}.git"
14
	inherit git-r3
15
	KEYWORDS=""
16
else
17
	SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz"
18
	KEYWORDS="~amd64 ~x86"
19
fi
20
21
LICENSE="Artistic-2"
22
SLOT="0"
23
# TODO: add USE="javascript" once that's usable in nqp
24
IUSE="clang java moar test"
25
26
RDEPEND="~dev-lang/nqp-${PV}:=[java=,moar=,clang=]"
27
DEPEND="${RDEPEND}
28
	clang? ( sys-devel/clang )
29
	>=dev-lang/perl-5.10"
30
31
REQUIRED_USE="|| ( java moar )"
32
PATCHES=( "${FILESDIR}/${PN}-2016.04-Makefile.in.patch" )
33
34
pkg_pretend() {
35
	if has_version dev-lang/rakudo && use java; then
36
		die "Rakudo is known to fail compilation with the jvm backend if it's already installed."
37
	fi
38
}
39
40
pkg_setup() {
41
	use java && java-pkg-2_pkg_setup
42
}
43
44
src_prepare() {
45
	eapply "${PATCHES[@]}"
46
47
	# yup, this is ugly. but emake doesn't respect DESTDIR.
48
	for i in Moar JVM; do
49
		echo "DESTDIR   = ${D}" > "${T}/Makefile-${i}.in" || die
50
		cat "${S}/tools/build/Makefile-${i}.in" >> "${T}/Makefile-${i}.in" || die
51
		mv "${T}/Makefile-${i}.in" "${S}/tools/build/Makefile-${i}.in" || die
52
	done
53
54
	eapply_user
55
	use java && java-pkg-2_src_prepare
56
}
57
58
src_configure() {
59
	local backends
60
	use java && backends+="jvm,"
61
	use moar && backends+="moar,"
62
	local myargs=( "--prefix=/usr"
63
		"--sysroot=/"
64
		"--sdkroot=/"
65
		"--make-install"
66
		"--sdkroot=/"
67
		"--backends=${backends}"
68
	)
69
	perl Configure.pl "${myargs[@]}"
70
}
71
72
src_compile() {
73
	emake DESTDIR="${D}"
74
}
75
76
src_test() {
77
	export RAKUDO_PRECOMP_PREFIX=$(mktemp -d)
78
	default
79
}
80
81
src_install() {
82
	emake DESTDIR="${D}" install
83
}
(-)a/dev-lang/rakudo/rakudo-9999.ebuild (+83 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=6
6
7
inherit java-pkg-2
8
9
DESCRIPTION="A compiler for the Perl 6 programming language"
10
HOMEPAGE="http://rakudo.org"
11
12
if [[ ${PV} == "9999" ]]; then
13
	EGIT_REPO_URI="https://github.com/rakudo/${PN}.git"
14
	inherit git-r3
15
	KEYWORDS=""
16
else
17
	SRC_URI="${HOMEPAGE}/downloads/${PN}/${P}.tar.gz"
18
	KEYWORDS="~amd64 ~x86"
19
fi
20
21
LICENSE="Artistic-2"
22
SLOT="0"
23
# TODO: add USE="javascript" once that's usable in nqp
24
IUSE="clang java moar test"
25
26
RDEPEND="~dev-lang/nqp-${PV}:=[java=,moar=,clang=]"
27
DEPEND="${RDEPEND}
28
	clang? ( sys-devel/clang )
29
	>=dev-lang/perl-5.10"
30
31
REQUIRED_USE="|| ( java moar )"
32
PATCHES=( "${FILESDIR}/${PN}-2016.04-Makefile.in.patch" )
33
34
pkg_pretend() {
35
    if has_version dev-lang/rakudo && use java; then
36
        die "Rakudo is known to fail compilation with the jvm backend if it's already installed."
37
	fi
38
}
39
40
pkg_setup() {
41
	use java && java-pkg-2_pkg_setup
42
}
43
44
src_prepare() {
45
	eapply "${PATCHES[@]}"
46
47
	# yup, this is ugly. but emake doesn't respect DESTDIR.
48
	for i in Moar JVM; do
49
		echo "DESTDIR   = ${D}" > "${T}/Makefile-${i}.in" || die
50
		cat "${S}/tools/build/Makefile-${i}.in" >> "${T}/Makefile-${i}.in" || die
51
		mv "${T}/Makefile-${i}.in" "${S}/tools/build/Makefile-${i}.in" || die
52
	done
53
54
	eapply_user
55
	use java && java-pkg-2_src_prepare
56
}
57
58
src_configure() {
59
	local backends
60
	use java && backends+="jvm,"
61
	use moar && backends+="moar,"
62
	local myargs=( "--prefix=/usr"
63
		"--sysroot=/"
64
		"--sdkroot=/"
65
		"--make-install"
66
		"--sdkroot=/"
67
		"--backends=${backends}"
68
	)
69
	perl Configure.pl "${myargs[@]}"
70
}
71
72
src_compile() {
73
	emake DESTDIR="${D}"
74
}
75
76
src_test() {
77
	export RAKUDO_PRECOMP_PREFIX=$(mktemp -d)
78
	default
79
}
80
81
src_install() {
82
	emake DESTDIR="${D}" install
83
}
(-)a/profiles/base/package.use.mask (+5 lines)
Lines 5-10 Link Here
5
# This file requires >=portage-2.1.1
5
# This file requires >=portage-2.1.1
6
# New entries go on top.
6
# New entries go on top.
7
7
8
# Matthew Brewer <tomboy64@sina.cn> (4 May 2016)
9
# Upstream supports using Clang's address sanitizer, but apparently
10
# invokes it wrong.
11
dev-lang/moarvm asan
12
8
# Michael Palimaka <kensington@gentoo.org> (05 May 2016)
13
# Michael Palimaka <kensington@gentoo.org> (05 May 2016)
9
# Doesn't work
14
# Doesn't work
10
media-libs/openimageio python
15
media-libs/openimageio python

Return to bug 580732