Skip to content

Commit

Permalink
dev-lang/moarvm: revbump 2016.04-r1
Browse files Browse the repository at this point in the history
- update ebuild to reflect the build-system
  - enable choice between gcc (default) and clang (use clang)
  - enable optional compilation against system-libs (use +system-libs)
    (required patch submitted upstream)
  - enable optional use of sanitizers (use asan ubsan)
  - enable optional static build (use static-libs)
  - make jit optional (was mandatory) (use +jit)
  - make stronger optimization optional (was mandatory) (use optimize)
  - disable testing (will be performed with nqp)
- update to EAPI6
- add tomboy64 as secondary maintainer

Package-Manager: portage-2.2.28
  • Loading branch information
Marshall Brewer (Gentoo Key) authored and Amynka committed May 8, 2016
1 parent 3a28c76 commit 3d52492
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 0 deletions.
145 changes: 145 additions & 0 deletions dev-lang/moarvm/files/Configure-2016.04.patch
Original file line number Diff line number Diff line change
@@ -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", <<TERM, "\n";
make: $config{make}
compile: $config{cc} $config{cflags}
+ includes: $config{cincludes}
link: $config{ld} $config{ldflags}
libs: $config{ldlibs}

@@ -873,6 +917,10 @@ Build and install MoarVM in addition to configuring it.

=item --has-libffi

+=item --pkgconfig=/path/to/pkgconfig/executable
+
+Provide path to the pkgconfig executable. Default: /usr/bin/pkg-config
+
=item --no-jit

Disable JIT compiler, which is enabled by default to JIT-compile hot frames.
diff --git a/build/Makefile.in b/build/Makefile.in
index 56a4c8a..b94e847 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -454,9 +454,6 @@ install: all
$(CP) src/strings/*.h $(DESTDIR)$(PREFIX)/include/moar/strings
$(CP) src/jit/*.h $(DESTDIR)$(PREFIX)/include/moar/jit
$(CP) src/instrument/*.h $(DESTDIR)$(PREFIX)/include/moar/instrument
- $(MKPATH) $(DESTDIR)$(PREFIX)/include/libuv
- $(MKPATH) $(DESTDIR)$(PREFIX)/include/libtommath
- $(CP) 3rdparty/libuv/include/*.h $(DESTDIR)$(PREFIX)/include/libuv
@install@

lib: @moar@
diff --git a/build/setup.pm b/build/setup.pm
index 324cc88..c87d79e 100755
--- a/build/setup.pm
+++ b/build/setup.pm
@@ -125,7 +125,7 @@ our %TC_POSIX = (
ccshared => '-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 => '',
12 changes: 12 additions & 0 deletions dev-lang/moarvm/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@
<email>[email protected]</email>
<name>Patrick Lauer</name>
</maintainer>
<maintainer type="person">
<email>[email protected]</email>
<name>Matthew Brewer</name>
</maintainer>
<maintainer type="project">
<email>[email protected]</email>
<name>Gentoo Perl Project</name>
</maintainer>
<use>
<flag name="asan">Enable clang's Address Sanitizer functionality. Expect longer compile time.</flag>
<flag name="clang">Use clang compiler instead of GCC</flag>
<flag name="jit">Enable Just-In-Time-Compiler. Has no effect except on AMD64 and Darwin.</flag>
<flag name="optimize">Enable optimization via CFLAGS</flag>
<flag name="system-libs">Link against the system's shared libraries</flag>
<flag name="ubsan">Enable clang's Undefined Behavior Sanitizer functionality. Expect longer compile time.</flag>
</use>
<upstream>
<remote-id type="github">MoarVM/MoarVM</remote-id>
</upstream>
Expand Down
68 changes: 68 additions & 0 deletions dev-lang/moarvm/moarvm-2016.04-r1.ebuild
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 3d52492

Please sign in to comment.