# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1

github.setup        Raku nqp 2025.05
revision            0
description         A lightweight Perl 6-like language for virtual machines
long_description    This is "Not Quite Perl" -- a lightweight Perl 6-like \
                    environment for virtual machines. The key feature of \
                    NQP is that itʼs designed to be a very small environment \
                    (as compared with, say, perl6 or Rakudo) and is focused \
                    on being a high-level way to create compilers and \
                    libraries for virtual machines (such as the Parrot \
                    Virtual Machine, the JVM, and MoarVM).

maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
categories          lang devel
license             Artistic-2

github.tarball_from releases

checksums           rmd160  99bba2cba2a14d78f836c9356c05a01dae8dc048 \
                    sha256  51f72f3c3cdd8e87fabd1601eab7c6dfef201dd4b65946848a6e38370e99458f \
                    size    9727268

depends_build-append \
                    path:bin/perl:perl5

# citation:
# NQP can run on three different backends: Parrot, MoarVM and the Java Virtual Machine (JVM).
# Decide on which backends you want it to run, and configure and build it as follows:
# --backends=moar,parrot,jvm
depends_lib-append  port:MoarVM

# Building rakudo on PPC results in malloc errors (though build still succeeds):
# nqp-m malloc: *** error for object 0x80a02ab0: incorrect checksum for freed object - object was probably modified after being freed.
legacysupport.redirect_bins nqp nqp-m

configure.cmd       ${prefix}/bin/perl Configure.pl
configure.args      --prefix=${prefix} \
                    --backends=moar \
                    --with-moar=${prefix}/bin/moar \
                    --no-silent-build

# https://github.com/MoarVM/MoarVM/issues/414
universal_variant   no
# Unsupported by Configure.pl
# configure.universal_args-delete --disable-dependency-tracking

use_parallel_build  no

test.run            yes
