# -*- 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 2026.06
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         nomaintainer
categories          lang devel
license             Artistic-2

github.tarball_from releases

checksums           rmd160  b6352b454c776e34dcdbebc07695246bfbcc113f \
                    sha256  51514df4be087d4bf767eb8eb594363a699962a5ad759a4a8a50d07b9b0af13e \
                    size    9728876

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

# Please match compiler blacklist from MoarVM port to avoid failures
compiler.c_standard 2011
compiler.blacklist-append \
                    {clang < 700}

# 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
