diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 358fe1e3..16d549c9 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -164,7 +164,7 @@ func (*CMakeHelper) createDir() bool { return true } func (*CMakeHelper) wantsDir() string { return "/cure/" } // script generates the cure script. -func (attr *CMakeHelper) script(s *S, name string) string { +func (attr *CMakeHelper) script(t Toolchain, name string) string { if attr == nil { attr = new(CMakeHelper) } @@ -180,7 +180,7 @@ func (attr *CMakeHelper) script(s *S, name string) string { } script := attr.Script - if !attr.SkipTest && s.opts&OptSkipCheck == 0 { + if !attr.SkipTest && t.opts&OptSkipCheck == 0 { script += "\n" + test } diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go index 5e6bb358..893d24a8 100644 --- a/internal/rosa/gnu.go +++ b/internal/rosa/gnu.go @@ -42,38 +42,6 @@ func skipGNUTests(tests ...int) string { return buf.String() } -func (t Toolchain) newM4() (pkg.Artifact, string) { - const ( - version = "1.4.21" - checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm" - ) - return t.NewPackage("m4", version, newTar( - "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2", - checksum, - pkg.TarBzip2, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh -`, - }, (*MakeHelper)(nil), - Diffutils, - - KernelHeaders, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newM4, - - Name: "m4", - Description: "a macro processor with GNU extensions", - Website: "https://www.gnu.org/software/m4/", - - ID: 1871, - }) -} - func (t Toolchain) newBison() (pkg.Artifact, string) { const ( version = "3.8.2" @@ -109,705 +77,6 @@ func init() { }) } -func (t Toolchain) newAutoconf() (pkg.Artifact, string) { - const ( - version = "2.73" - checksum = "yGabDTeOfaCUB0JX-h3REYLYzMzvpDwFmFFzHNR7QilChCUNE4hR6q7nma4viDYg" - ) - return t.NewPackage("autoconf", version, newTar( - "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Flag: TExclusive, - }, &MakeHelper{ - Check: []string{ - "TESTSUITEFLAGS=" + jobsFlagE, - "check", - }, - }, - M4, - Perl, - Bash, - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newAutoconf, - - Name: "autoconf", - Description: "M4 macros to produce self-contained configure script", - Website: "https://www.gnu.org/software/autoconf/", - - Dependencies: P{ - M4, - Perl, - }, - - ID: 141, - }) -} - -func (t Toolchain) newAutomake() (pkg.Artifact, string) { - const ( - version = "1.18.1" - checksum = "FjvLG_GdQP7cThTZJLDMxYpRcKdpAVG-YDs1Fj1yaHlSdh_Kx6nRGN14E0r_BjcG" - ) - return t.NewPackage("automake", version, newTar( - "https://ftpmirror.gnu.org/gnu/automake/automake-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' t/objcxx-minidemo.sh -test_disable '#!/bin/sh' t/objcxx-deps.sh - -test_disable '#!/bin/sh' t/dist-no-built-sources.sh -test_disable '#!/bin/sh' t/distname.sh -test_disable '#!/bin/sh' t/pr9.sh -`, - }, (*MakeHelper)(nil), - Grep, - Gzip, - Autoconf, - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newAutomake, - - Name: "automake", - Description: "a tool for automatically generating Makefile.in files", - Website: "https://www.gnu.org/software/automake/", - - Dependencies: P{ - Autoconf, - }, - - ID: 144, - }) -} - -func (t Toolchain) newLibtool() (pkg.Artifact, string) { - const ( - version = "2.5.4" - checksum = "pa6LSrQggh8mSJHQfwGjysAApmZlGJt8wif2cCLzqAAa2jpsTY0jZ-6stS3BWZ2Q" - ) - return t.NewPackage("libtool", version, newTar( - "https://ftpmirror.gnu.org/gnu/libtool/libtool-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, &MakeHelper{ - // _Z2a2c: symbol not found - SkipCheck: t.stage.isStage0(), - - Check: []string{ - "TESTSUITEFLAGS=" + jobsFlagE, - "check", - }, - }, - M4, - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newLibtool, - - Name: "libtool", - Description: "a generic library support script", - Website: "https://www.gnu.org/software/libtool/", - - ID: 1741, - }) -} - -func (t Toolchain) newGzip() (pkg.Artifact, string) { - const ( - version = "1.14" - checksum = "NWhjUavnNfTDFkZJyAUonL9aCOak8GVajWX2OMlzpFnuI0ErpBFyj88mz2xSjz0q" - ) - return t.NewPackage("gzip", version, newTar( - "https://ftpmirror.gnu.org/gnu/gzip/gzip-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, &MakeHelper{ - // dependency loop - SkipCheck: true, - }), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGzip, - - Name: "gzip", - Description: "a popular data compression program", - Website: "https://www.gnu.org/software/gzip/", - - ID: 1290, - }) -} - -func (t Toolchain) newGettext() (pkg.Artifact, string) { - const ( - version = "1.0" - checksum = "3MasKeEdPeFEgWgzsBKk7JqWqql1wEMbgPmzAfs-mluyokoW0N8oQVxPQoOnSdgC" - ) - return t.NewPackage("gettext", version, newTar( - "https://ftpmirror.gnu.org/gnu/gettext/gettext-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' gettext-tools/tests/msgcat-22 -test_disable '#!/bin/sh' gettext-tools/tests/msgconv-2 -test_disable '#!/bin/sh' gettext-tools/tests/msgconv-8 -test_disable '#!/bin/sh' gettext-tools/tests/xgettext-python-3 -test_disable '#!/bin/sh' gettext-tools/tests/msgmerge-compendium-6 -test_disable '#!/bin/sh' gettext-tools/tests/gettextpo-1 -test_disable '#!/bin/sh' gettext-tools/tests/format-c-5 -test_disable '#!/bin/sh' gettext-tools/gnulib-tests/test-c32ispunct.sh -test_disable 'int main(){return 0;}' gettext-tools/gnulib-tests/test-stdcountof-h.c - -touch gettext-tools/autotools/archive.dir.tar -`, - }, (*MakeHelper)(nil), - Diffutils, - Gzip, - Sed, - - KernelHeaders, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGettext, - - Name: "gettext", - Description: "tools for producing multi-lingual messages", - Website: "https://www.gnu.org/software/gettext/", - - ID: 898, - }) -} - -func (t Toolchain) newDiffutils() (pkg.Artifact, string) { - const ( - version = "3.12" - checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44" - ) - return t.NewPackage("diffutils", version, newTar( - "https://ftpmirror.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh -test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c -test_disable '#!/bin/sh' tests/cmp -`, - Flag: TEarly, - }, (*MakeHelper)(nil)), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newDiffutils, - - Name: "diffutils", - Description: "several programs related to finding differences between files", - Website: "https://www.gnu.org/software/diffutils/", - - ID: 436, - }) -} - -func (t Toolchain) newPatch() (pkg.Artifact, string) { - const ( - version = "2.8" - checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR" - ) - return t.NewPackage("patch", version, newTar( - "https://ftpmirror.gnu.org/gnu/patch/patch-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' tests/ed-style -test_disable '#!/bin/sh' tests/need-filename -`, - Flag: TEarly, - }, (*MakeHelper)(nil)), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newPatch, - - Name: "patch", - Description: "a program to apply diff output to files", - Website: "https://savannah.gnu.org/projects/patch/", - - ID: 2597, - }) -} - -func (t Toolchain) newBash() (pkg.Artifact, string) { - const ( - version = "5.3" - checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq" - ) - return t.NewPackage("bash", version, newTar( - "https://ftpmirror.gnu.org/gnu/bash/bash-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Flag: TEarly, - }, &MakeHelper{ - Script: "ln -s bash /work/system/bin/sh\n", - Configure: []KV{ - {"without-bash-malloc"}, - }, - }), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newBash, - - Name: "bash", - Description: "the Bourne Again SHell", - Website: "https://www.gnu.org/software/bash/", - - ID: 166, - }) -} - -func (t Toolchain) newCoreutils() (pkg.Artifact, string) { - const ( - version = "9.11" - checksum = "t8UMed5wpFEoC56aa42_yidfOAaRGzOfj7MRtQkkqgGbpXiskNA8bd-EmVSQkZie" - ) - return t.NewPackage("coreutils", version, newTar( - "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh -test_disable '#!/bin/sh' tests/ls/hyperlink.sh -test_disable '#!/bin/sh' tests/misc/user.sh -test_disable 'int main(){return 0;}' gnulib-tests/test-chown.c -test_disable 'int main(){return 0;}' gnulib-tests/test-fchownat.c -test_disable 'int main(){return 0;}' gnulib-tests/test-lchown.c -`, - - Flag: TEarly, - }, &MakeHelper{ - Configure: []KV{ - {"enable-single-binary", "symlinks"}, - }, - }, - Perl, - Bash, - - KernelHeaders, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newCoreutils, - - Name: "coreutils", - Description: "the basic file, shell and text manipulation utilities", - Website: "https://www.gnu.org/software/coreutils/", - - ID: 343, - }) -} - -func (t Toolchain) newTexinfo() (pkg.Artifact, string) { - const ( - version = "7.3" - checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-" - ) - return t.NewPackage("texinfo", version, newTar( - "https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, &MakeHelper{ - // nonstandard glibc extension - SkipCheck: true, - }, - Perl, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newTexinfo, - - Name: "texinfo", - Description: "the GNU square-wheel-reinvension of man pages", - Website: "https://www.gnu.org/software/texinfo/", - - Dependencies: P{ - Perl, - Gawk, - }, - - ID: 4958, - }) -} - -func (t Toolchain) newGperf() (pkg.Artifact, string) { - const ( - version = "3.3" - checksum = "RtIy9pPb_Bb8-31J2Nw-rRGso2JlS-lDlVhuNYhqR7Nt4xM_nObznxAlBMnarJv7" - ) - return t.NewPackage("gperf", version, newTar( - "https://ftpmirror.gnu.org/gperf/gperf-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, (*MakeHelper)(nil), - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGperf, - - Name: "gperf", - Description: "a perfect hash function generator", - Website: "https://www.gnu.org/software/gperf/", - - ID: 1237, - }) -} - -func (t Toolchain) newGawk() (pkg.Artifact, string) { - const ( - version = "5.4.0" - checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C" - ) - return t.NewPackage("gawk", version, newTar( - "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Flag: TEarly, - }, &MakeHelper{ - // dependency loop - SkipCheck: true, - }), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGawk, - - Name: "gawk", - Description: "an implementation of awk with GNU extensions", - Website: "https://www.gnu.org/software/gawk/", - - ID: 868, - }) -} - -func (t Toolchain) newGrep() (pkg.Artifact, string) { - const ( - version = "3.12" - checksum = "qMB4RjaPNRRYsxix6YOrjE8gyAT1zVSTy4nW4wKW9fqa0CHYAuWgPwDTirENzm_1" - ) - return t.NewPackage("grep", version, newTar( - "https://ftpmirror.gnu.org/gnu/grep/grep-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh -test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c -`, - }, (*MakeHelper)(nil), - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGrep, - - Name: "grep", - Description: "searches input for lines containing a match to a pattern", - Website: "https://www.gnu.org/software/grep/", - - ID: 1251, - }) -} - -func (t Toolchain) newFindutils() (pkg.Artifact, string) { - const ( - version = "4.10.0" - checksum = "ZXABdNBQXL7QjTygynRRTdXYWxQKZ0Wn5eMd3NUnxR0xaS0u0VfcKoTlbo50zxv6" - ) - return t.NewPackage("findutils", version, pkg.NewHTTPGet( - nil, "https://ftpmirror.gnu.org/gnu/findutils/findutils-"+version+".tar.xz", - mustDecode(checksum), - ), &PackageAttr{ - ScriptEarly: ` -echo '#!/bin/sh' > gnulib-tests/test-c32ispunct.sh -echo 'int main(){return 0;}' > tests/xargs/test-sigusr.c -`, - }, (*MakeHelper)(nil), - Diffutils, - XZ, - Sed, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newFindutils, - - Name: "findutils", - Description: "the basic directory searching utilities", - Website: "https://www.gnu.org/software/findutils/", - - ID: 812, - }) -} - -func (t Toolchain) newBC() (pkg.Artifact, string) { - const ( - version = "1.08.2" - checksum = "8h6f3hjV80XiFs6v9HOPF2KEyg1kuOgn5eeFdVspV05ODBVQss-ey5glc8AmneLy" - ) - return t.NewPackage("bc", version, newTar( - "https://ftpmirror.gnu.org/gnu/bc/bc-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - // source expected to be writable - Writable: true, - Chmod: true, - }, (*MakeHelper)(nil), - Texinfo, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newBC, - - Name: "bc", - Description: "an arbitrary precision numeric processing language", - Website: "https://www.gnu.org/software/bc/", - - ID: 170, - }) -} - -func (t Toolchain) newLibiconv() (pkg.Artifact, string) { - const ( - version = "1.19" - checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x" - ) - return t.NewPackage("libiconv", version, newTar( - "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, (*MakeHelper)(nil)), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newLibiconv, - - Name: "libiconv", - Description: "iconv implementation independent of glibc", - Website: "https://www.gnu.org/software/libiconv/", - - ID: 10656, - }) -} - -func (t Toolchain) newTar() (pkg.Artifact, string) { - const ( - version = "1.35" - checksum = "zSaoSlVUDW0dSfm4sbL4FrXLFR8U40Fh3zY5DWhR5NCIJ6GjU6Kc4VZo2-ZqpBRA" - ) - return t.NewPackage("tar", version, newTar( - "https://ftpmirror.gnu.org/gnu/tar/tar-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, &MakeHelper{ - Configure: []KV{ - {"disable-acl"}, - {"without-posix-acls"}, - {"without-xattrs"}, - }, - Check: []string{ - // very expensive - "TARTEST_SKIP_LARGE_FILES=1", - - "TESTSUITEFLAGS=" + jobsFlagE, - "check", - }, - }, - Diffutils, - - Gzip, - Bzip2, - Zstd, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newTar, - - Name: "tar", - Description: "provides the ability to create tar archives", - Website: "https://www.gnu.org/software/tar/", - - ID: 4939, - }) -} - -func (t Toolchain) newParallel() (pkg.Artifact, string) { - const ( - version = "20260422" - checksum = "eTsepxgqhXpMEhPd55qh-W5y4vjKn0x9TD2mzbJCNZYtFf4lT4Wzoqr74HGJYBEH" - ) - return t.NewPackage("parallel", version, newTar( - "https://ftpmirror.gnu.org/gnu/parallel/parallel-"+version+".tar.bz2", - checksum, - pkg.TarBzip2, - ), &PackageAttr{ - ScriptEarly: ` -ln -s ../system/bin/bash /bin/ -`, - }, (*MakeHelper)(nil), - Perl, - Bash, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newParallel, - - Name: "parallel", - Description: "a shell tool for executing jobs in parallel using one or more computers", - Website: "https://www.gnu.org/software/parallel/", - - Dependencies: P{ - Perl, - }, - - ID: 5448, - }) -} - -func (t Toolchain) newLibunistring() (pkg.Artifact, string) { - const ( - version = "1.4.2" - checksum = "iW9BbfLoVlXjWoLTZ4AekQSu4cFBnLcZ4W8OHWbv0AhJNgD3j65_zqaLMzFKylg2" - ) - return t.NewPackage("libunistring", version, newTar( - "https://ftpmirror.gnu.org/gnu/libunistring/libunistring-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - -test_disable '#!/bin/sh' tests/test-c32ispunct.sh -test_disable 'int main(){return 0;}' tests/test-c32ispunct.c -`, - }, (*MakeHelper)(nil), - Diffutils, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newLibunistring, - - Name: "libunistring", - Description: "provides functions for manipulating Unicode strings", - Website: "https://www.gnu.org/software/libunistring/", - - ID: 1747, - }) -} - -func (t Toolchain) newLibtasn1() (pkg.Artifact, string) { - const ( - version = "4.21.0" - checksum = "9DYI3UYbfYLy8JsKUcY6f0irskbfL0fHZA91Q-JEOA3kiUwpodyjemRsYRjUpjuq" - ) - return t.NewPackage("libtasn1", version, newTar( - "https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, (*MakeHelper)(nil)), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newLibtasn1, - - Name: "libtasn1", - Description: "the ASN.1 library used by GnuTLS, p11-kit and some other packages", - Website: "https://www.gnu.org/software/libtasn1/", - - ID: 1734, - }) -} - -func (t Toolchain) newReadline() (pkg.Artifact, string) { - const ( - version = "8.3" - checksum = "r-lcGRJq_MvvBpOq47Z2Y1OI2iqrmtcqhTLVXR0xWo37ZpC2uT_md7gKq5o_qTMV" - ) - return t.NewPackage("readline", version, newTar( - "https://ftpmirror.gnu.org/gnu/readline/readline-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil, &MakeHelper{ - Configure: []KV{ - {"with-curses"}, - {"with-shared-termcap-library"}, - }, - }, - Ncurses, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newReadline, - - Name: "readline", - Description: "provides a set of functions for use by applications that allow users to edit command lines as they are typed in", - Website: "https://tiswww.cwru.edu/php/chet/readline/rltop.html", - - Dependencies: P{ - Ncurses, - }, - - ID: 4173, - }) -} - func (t Toolchain) newGnuTLS() (pkg.Artifact, string) { const ( version = "3.8.12" @@ -1014,105 +283,6 @@ func init() { }) } -func (t Toolchain) newGMP() (pkg.Artifact, string) { - const ( - version = "6.3.0" - checksum = "yrgbgEDWKDdMWVHh7gPbVl56-sRtVVhfvv0M_LX7xMUUk_mvZ1QOJEAnt7g4i3k5" - ) - return t.NewPackage("gmp", version, newTar( - "https://gcc.gnu.org/pub/gcc/infrastructure/"+ - "gmp-"+version+".tar.bz2", - checksum, - pkg.TarBzip2, - ), &PackageAttr{ - Env: []string{ - "CC=cc", - }, - }, (*MakeHelper)(nil), - M4, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newGMP, - - Name: "gmp", - Description: "a free library for arbitrary precision arithmetic", - Website: "https://gmplib.org/", - - ID: 1186, - }) -} - -func (t Toolchain) newMPFR() (pkg.Artifact, string) { - const ( - version = "4.2.2" - checksum = "wN3gx0zfIuCn9r3VAn_9bmfvAYILwrRfgBjYSD1IjLqyLrLojNN5vKyQuTE9kA-B" - ) - return t.NewPackage("mpfr", version, newTar( - "https://gcc.gnu.org/pub/gcc/infrastructure/"+ - "mpfr-"+version+".tar.bz2", - checksum, - pkg.TarBzip2, - ), nil, (*MakeHelper)(nil), - GMP, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newMPFR, - - Name: "mpfr", - Description: "a C library for multiple-precision floating-point computations", - Website: "https://www.mpfr.org/", - - Dependencies: P{ - GMP, - }, - - ID: 2019, - }) -} - -func (t Toolchain) newMPC() (pkg.Artifact, string) { - const ( - version = "1.4.1" - checksum = "ZffaZyWkvIw0iPvRe5EJ7O-VvHtSkbbb3K_7SgPtK810NvGan7nbF0T5-6tozjQN" - ) - return t.NewPackage("mpc", version, newFromGitLab( - "gitlab.inria.fr", - "mpc/mpc", - version, checksum, - ), &PackageAttr{ - // does not find mpc-impl.h otherwise - EnterSource: true, - }, &MakeHelper{ - InPlace: true, - Generate: "autoreconf -vfi", - }, - Automake, - Libtool, - Texinfo, - - MPFR, - ), version -} -func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newMPC, - - Name: "mpc", - Description: "a C library for the arithmetic of complex numbers", - Website: "https://www.multiprecision.org/", - - Dependencies: P{ - MPFR, - }, - - ID: 1667, - }) -} - func (t Toolchain) newGCC() (pkg.Artifact, string) { const ( version = "16.1.0" diff --git a/internal/rosa/make.go b/internal/rosa/make.go index 961f2d33..8f5295b0 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -70,6 +70,8 @@ type MakeHelper struct { Make []string // Whether to skip the check target. SkipCheck bool + // Whether to skip the check target during stage0. + SkipCheckEarly bool // Name of the check target, zero value is equivalent to "check". Check []string // Replaces the default install command. @@ -123,7 +125,7 @@ func (attr *MakeHelper) wantsDir() string { } // script generates the cure script. -func (attr *MakeHelper) script(s *S, name string) string { +func (attr *MakeHelper) script(t Toolchain, name string) string { if attr == nil { attr = new(MakeHelper) } @@ -194,7 +196,8 @@ make \ } scriptMake += "\n" - if !attr.SkipCheck && s.opts&OptSkipCheck == 0 { + if !attr.SkipCheck && t.opts&OptSkipCheck == 0 && + (!attr.SkipCheckEarly || !t.stage.isStage0()) { scriptMake += attr.ScriptCheckEarly + `make \ ` + jobsFlagE + ` \ ` diff --git a/internal/rosa/meson.go b/internal/rosa/meson.go index 22e108f1..56c2abd8 100644 --- a/internal/rosa/meson.go +++ b/internal/rosa/meson.go @@ -106,7 +106,7 @@ func (*MesonHelper) createDir() bool { return false } func (*MesonHelper) wantsDir() string { return `"$(mktemp -d)"` } // script generates the cure script. -func (attr *MesonHelper) script(s *S, name string) string { +func (attr *MesonHelper) script(t Toolchain, name string) string { if attr == nil { attr = new(MesonHelper) } @@ -117,7 +117,7 @@ func (attr *MesonHelper) script(s *S, name string) string { } var scriptTest string - if !attr.SkipTest && s.opts&OptSkipCheck == 0 { + if !attr.SkipTest && t.opts&OptSkipCheck == 0 { scriptTest = ` meson test \ --print-errorlogs` diff --git a/internal/rosa/package/gnu/package.az b/internal/rosa/package/gnu/package.az index a50c1a90..3dc7074f 100644 --- a/internal/rosa/package/gnu/package.az +++ b/internal/rosa/package/gnu/package.az @@ -1,5 +1,148 @@ // GNU software with trivial packaging. +package m4 { + description = "a macro processor with GNU extensions"; + website = "https://www.gnu.org/software/m4"; + anitya = 1871; + + version* = "1.4.21"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2"; + checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm"; + compress = bzip2; + }; + + writable = true; + early = ` +chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh +`; + + exec = make {}; + + inputs = [ + diffutils, + + kernel-headers, + ]; +} + +package autoconf { + description = "M4 macros to produce self-contained configure script"; + website = "https://www.gnu.org/software/autoconf"; + anitya = 141; + + version* = "2.73"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz"; + checksum = "yGabDTeOfaCUB0JX-h3REYLYzMzvpDwFmFFzHNR7QilChCUNE4hR6q7nma4viDYg"; + compress = gzip; + }; + + // test suite is very expensive + exclusive = true; + + exec = make { + check = [ + "TESTSUITEFLAGS=" + jobsFlagE, + "check", + ]; + }; + + inputs = [ + m4, + perl, + bash, + diffutils, + ]; + + runtime = [ + m4, + perl, + ]; +} + +package automake { + description = "a tool for automatically generating Makefile.in files"; + website = "https://www.gnu.org/software/automake"; + anitya = 144; + + version* = "1.18.1"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/automake/automake-"+version+".tar.gz"; + checksum = "FjvLG_GdQP7cThTZJLDMxYpRcKdpAVG-YDs1Fj1yaHlSdh_Kx6nRGN14E0r_BjcG"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' t/objcxx-minidemo.sh +test_disable '#!/bin/sh' t/objcxx-deps.sh + +test_disable '#!/bin/sh' t/dist-no-built-sources.sh +test_disable '#!/bin/sh' t/distname.sh +test_disable '#!/bin/sh' t/pr9.sh +`; + + exec = make {}; + + inputs = [ + grep, + gzip, + autoconf, + diffutils, + ]; + + runtime = [ autoconf ]; +} + +package libtool { + description = "a generic library support script"; + website = "https://www.gnu.org/software/libtool"; + anitya = 1741; + + version* = "2.5.4"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/libtool/libtool-"+version+".tar.gz"; + checksum = "pa6LSrQggh8mSJHQfwGjysAApmZlGJt8wif2cCLzqAAa2jpsTY0jZ-6stS3BWZ2Q"; + compress = gzip; + }; + + exec = make { + // _Z2a2c: symbol not found + skipEarlyStageCheck = true; + + check = [ + "TESTSUITEFLAGS=" + jobsFlagE, + "check", + ]; + }; + + inputs = [ + m4, + diffutils, + ]; +} + +package gzip { + description = "a popular data compression program"; + website = "https://www.gnu.org/software/gzip"; + anitya = 1290; + + version* = "1.14"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/gzip/gzip-"+version+".tar.gz"; + checksum = "NWhjUavnNfTDFkZJyAUonL9aCOak8GVajWX2OMlzpFnuI0ErpBFyj88mz2xSjz0q"; + compress = gzip; + }; + + exec = make { + // dependency loop + skipCheck = true; + }; +} + package sed { description = "a non-interactive command-line text editor"; website = "https://www.gnu.org/software/sed"; @@ -20,3 +163,502 @@ package sed { kernel-headers, ]; } + +package diffutils { + description = "several programs related to finding differences between files"; + website = "https://www.gnu.org/software/diffutils"; + anitya = 436; + + version* = "3.12"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz"; + checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh +test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c +test_disable '#!/bin/sh' tests/cmp +`; + + toyboxEarly = true; + exec = make {}; +} + +package patch { + description = "a program to apply diff output to files"; + website = "https://savannah.gnu.org/projects/patch"; + anitya = 2597; + + version* = "2.8"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/patch/patch-"+version+".tar.gz"; + checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' tests/ed-style +test_disable '#!/bin/sh' tests/need-filename +`; + + toyboxEarly = true; + exec = make {}; +} + +package gawk { + description = "an implementation of awk with GNU extensions"; + website = "https://www.gnu.org/software/gawk"; + anitya = 868; + + version* = "5.4.0"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz"; + checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C"; + compress = gzip; + }; + + toyboxEarly = true; + exec = make { + // dependency loop + skipCheck = true; + }; +} + +package grep { + description = "searches input for lines containing a match to a pattern"; + website = "https://www.gnu.org/software/grep"; + anitya = 1251; + + version* = "3.12"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/grep/grep-"+version+".tar.gz"; + checksum = "qMB4RjaPNRRYsxix6YOrjE8gyAT1zVSTy4nW4wKW9fqa0CHYAuWgPwDTirENzm_1"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh +test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c +`; + + exec = make {}; + + inputs = [ diffutils ]; +} + +package gettext { + description = "tools for producing multi-lingual messages"; + website = "https://www.gnu.org/software/gettext"; + anitya = 898; + + version* = "1.0"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/gettext/gettext-"+version+".tar.gz"; + checksum = "3MasKeEdPeFEgWgzsBKk7JqWqql1wEMbgPmzAfs-mluyokoW0N8oQVxPQoOnSdgC"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' gettext-tools/tests/msgcat-22 +test_disable '#!/bin/sh' gettext-tools/tests/msgconv-2 +test_disable '#!/bin/sh' gettext-tools/tests/msgconv-8 +test_disable '#!/bin/sh' gettext-tools/tests/xgettext-python-3 +test_disable '#!/bin/sh' gettext-tools/tests/msgmerge-compendium-6 +test_disable '#!/bin/sh' gettext-tools/tests/gettextpo-1 +test_disable '#!/bin/sh' gettext-tools/tests/format-c-5 +test_disable '#!/bin/sh' gettext-tools/gnulib-tests/test-c32ispunct.sh +test_disable 'int main(){return 0;}' gettext-tools/gnulib-tests/test-stdcountof-h.c + +touch gettext-tools/autotools/archive.dir.tar +`; + + exec = make {}; + + inputs = [ + diffutils, + gzip, + sed, + + kernel-headers, + ]; +} + +package findutils { + description = "the basic directory searching utilities"; + website = "https://www.gnu.org/software/findutils"; + anitya = 812; + + version* = "4.10.0"; + source = remoteFile { + url = "https://ftpmirror.gnu.org/gnu/findutils/findutils-"+version+".tar.xz"; + checksum = "ZXABdNBQXL7QjTygynRRTdXYWxQKZ0Wn5eMd3NUnxR0xaS0u0VfcKoTlbo50zxv6"; + }; + + early = ` +echo '#!/bin/sh' > gnulib-tests/test-c32ispunct.sh +echo 'int main(){return 0;}' > tests/xargs/test-sigusr.c +`; + + exec = make {}; + + inputs = [ + diffutils, + xz, + sed, + ]; +} + +package bash { + description = "the Bourne Again SHell"; + website = "https://www.gnu.org/software/bash"; + anitya = 166; + + version* = "5.3"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/bash/bash-"+version+".tar.gz"; + checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq"; + compress = gzip; + }; + + toyboxEarly = true; + exec = make { + configure = { + "without-bash-malloc"; + }; + postInstall = "ln -s bash /work/system/bin/sh\n"; + }; +} + +package coreutils { + description = "the basic file, shell and text manipulation utilities"; + website = "https://www.gnu.org/software/coreutils"; + anitya = 343; + + version* = "9.11"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz"; + checksum = "t8UMed5wpFEoC56aa42_yidfOAaRGzOfj7MRtQkkqgGbpXiskNA8bd-EmVSQkZie"; + compress = gzip; + }; + + toyboxEarly = true; + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh +test_disable '#!/bin/sh' tests/ls/hyperlink.sh +test_disable '#!/bin/sh' tests/misc/user.sh +test_disable 'int main(){return 0;}' gnulib-tests/test-chown.c +test_disable 'int main(){return 0;}' gnulib-tests/test-fchownat.c +test_disable 'int main(){return 0;}' gnulib-tests/test-lchown.c +`; + + exec = make { + configure = { + "enable-single-binary": "symlinks"; + }; + }; + + inputs = [ + perl, + bash, + + kernel-headers, + ]; +} + +package tar { + description = "provides the ability to create tar archives"; + website = "https://www.gnu.org/software/tar"; + anitya = 4939; + + version* = "1.35"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/tar/tar-"+version+".tar.gz"; + checksum = "zSaoSlVUDW0dSfm4sbL4FrXLFR8U40Fh3zY5DWhR5NCIJ6GjU6Kc4VZo2-ZqpBRA"; + compress = gzip; + }; + + exec = make { + configure = { + "disable-acl"; + "without-posix-acls"; + "without-xattrs"; + }; + + check = [ + // very expensive + "TARTEST_SKIP_LARGE_FILES=1", + + "TESTSUITEFLAGS=" + jobsFlagE, + "check", + ]; + }; + + inputs = [ + diffutils, + + gzip, + bzip2, + zstd, + ]; +} + +package texinfo { + description = "the GNU square-wheel-reinvension of man pages"; + website = "https://www.gnu.org/software/texinfo"; + anitya = 4958; + + version* = "7.3"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz"; + checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-"; + compress = gzip; + }; + + exec = make { + // nonstandard glibc extension + skipCheck = true; + }; + + inputs = [ perl ]; + + runtime = [ + perl, + gawk, + ]; +} + +package gperf { + description = "a perfect hash function generator"; + website = "https://www.gnu.org/software/gperf"; + anitya = 1237; + + version* = "3.3"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gperf/gperf-"+version+".tar.gz"; + checksum = "RtIy9pPb_Bb8-31J2Nw-rRGso2JlS-lDlVhuNYhqR7Nt4xM_nObznxAlBMnarJv7"; + compress = gzip; + }; + + exec = make {}; + + inputs = [ diffutils ]; +} + +package bc { + description = "an arbitrary precision numeric processing language"; + website = "https://www.gnu.org/software/bc"; + anitya = 170; + + version* = "1.08.2"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/bc/bc-"+version+".tar.gz"; + checksum = "8h6f3hjV80XiFs6v9HOPF2KEyg1kuOgn5eeFdVspV05ODBVQss-ey5glc8AmneLy"; + compress = gzip; + }; + + // source expected to be writable + writable = true; + chmod = true; + + exec = make {}; + + inputs = [ + texinfo, + ]; +} + +package libiconv { + description = "iconv implementation independent of glibc"; + website = "https://www.gnu.org/software/libiconv"; + anitya = 10656; + + version* = "1.19"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz"; + checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x"; + compress = gzip; + }; + + exec = make {}; +} + +package parallel { + description = "a shell tool for executing jobs in parallel using one or more computers"; + website = "https://www.gnu.org/software/parallel"; + anitya = 5448; + + version* = "20260422"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/parallel/parallel-"+version+".tar.bz2"; + checksum = "eTsepxgqhXpMEhPd55qh-W5y4vjKn0x9TD2mzbJCNZYtFf4lT4Wzoqr74HGJYBEH"; + compress = bzip2; + }; + + early = ` +ln -s ../system/bin/bash /bin/ +`; + + exec = make {}; + + inputs = [ + perl, + bash, + ]; + + runtime = [ perl ]; +} + +package libunistring { + description = "provides functions for manipulating Unicode strings"; + website = "https://www.gnu.org/software/libunistring"; + anitya = 1747; + + version* = "1.4.2"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/libunistring/libunistring-"+version+".tar.gz"; + checksum = "iW9BbfLoVlXjWoLTZ4AekQSu4cFBnLcZ4W8OHWbv0AhJNgD3j65_zqaLMzFKylg2"; + compress = gzip; + }; + + writable = true; + early = ` +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' tests/test-c32ispunct.sh +test_disable 'int main(){return 0;}' tests/test-c32ispunct.c +`; + + exec = make {}; + + inputs = [ + diffutils, + ]; +} + +package libtasn1 { + description = "the ASN.1 library used by GnuTLS, p11-kit and some other packages"; + website = "https://www.gnu.org/software/libtasn1"; + anitya = 1734; + + version* = "4.21.0"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-"+version+".tar.gz"; + checksum = "9DYI3UYbfYLy8JsKUcY6f0irskbfL0fHZA91Q-JEOA3kiUwpodyjemRsYRjUpjuq"; + compress = gzip; + }; + + exec = make {}; +} + +package readline { + description = "provides a set of functions for use by applications that allow users to edit command lines as they are typed in"; + website = "https://tiswww.cwru.edu/php/chet/readline/rltop.html"; + anitya = 4173; + + version* = "8.3"; + source = remoteTar { + url = "https://ftpmirror.gnu.org/gnu/readline/readline-"+version+".tar.gz"; + checksum = "r-lcGRJq_MvvBpOq47Z2Y1OI2iqrmtcqhTLVXR0xWo37ZpC2uT_md7gKq5o_qTMV"; + compress = gzip; + }; + + exec = make { + configure = { + "with-curses"; + "with-shared-termcap-library"; + }; + }; + + inputs = [ ncurses ]; + runtime = [ ncurses ]; +} + +package gmp { + description = "a free library for arbitrary precision arithmetic"; + website = "https://gmplib.org"; + anitya = 1186; + + version* = "6.3.0"; + source = remoteTar { + url = "https://gcc.gnu.org/pub/gcc/infrastructure/"+ + "gmp-"+version+".tar.bz2"; + checksum = "yrgbgEDWKDdMWVHh7gPbVl56-sRtVVhfvv0M_LX7xMUUk_mvZ1QOJEAnt7g4i3k5"; + compress = bzip2; + }; + + env = [ + "CC=cc", + ]; + + exec = make {}; + + inputs = [ m4 ]; +} + +package mpfr { + description = "a C library for multiple-precision floating-point computations"; + website = "https://www.mpfr.org"; + anitya = 2019; + + version* = "4.2.2"; + source = remoteTar { + url = "https://gcc.gnu.org/pub/gcc/infrastructure/"+ + "mpfr-"+version+".tar.bz2"; + checksum = "wN3gx0zfIuCn9r3VAn_9bmfvAYILwrRfgBjYSD1IjLqyLrLojNN5vKyQuTE9kA-B"; + compress = bzip2; + }; + + exec = make {}; + + inputs = [ gmp ]; + runtime = [ gmp ]; +} + +package mpc { + description = "a C library for the arithmetic of complex numbers"; + website = "https://www.multiprecision.org"; + anitya = 1667; + + version* = "1.4.1"; + source = remoteGitLab { + domain = "gitlab.inria.fr"; + suffix = "mpc/mpc"; + ref = version; + checksum = "ZffaZyWkvIw0iPvRe5EJ7O-VvHtSkbbb3K_7SgPtK810NvGan7nbF0T5-6tozjQN"; + }; + + // does not find mpc-impl.h otherwise + enterSource = true; + + exec = make { + inPlace = true; + generate = "autoreconf -vfi"; + }; + + inputs = [ + automake, + libtool, + texinfo, + + mpfr, + ]; + + runtime = [ mpfr ]; +} diff --git a/internal/rosa/python.go b/internal/rosa/python.go index a53cb2ff..93fe0d70 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -150,7 +150,7 @@ func (*PipHelper) createDir() bool { return false } func (*PipHelper) wantsDir() string { return `"$(mktemp -d)"` } // script generates the pip3 install command. -func (attr *PipHelper) script(_ *S, name string) string { +func (attr *PipHelper) script(_ Toolchain, name string) string { if attr == nil { attr = new(PipHelper) } diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index d1a6c25e..d9d0b9ef 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -388,7 +388,7 @@ type Helper interface { // also empty. The special value helperInPlace omits the cd statement. wantsDir() string // script returns the helper-specific segment of cure script. - script(s *S, name string) string + script(t Toolchain, name string) string } // PackageAttr holds build-system-agnostic attributes. @@ -531,7 +531,7 @@ cd '/usr/src/` + name + `/' extraRes, attr.KnownChecksum, attr.Env, - scriptEarly+helper.script(t.S, name), + scriptEarly+helper.script(t, name), slices.Concat(attr.Paths, []pkg.ExecPath{ pkg.Path(AbsUsrSrc.Append( name+sourceSuffix, @@ -545,11 +545,11 @@ cd '/usr/src/` + name + `/' const ( // jobsE is expression for preferred job count set by [pkg]. jobsE = `"$` + pkg.EnvJobs + `"` - // jobsE is expression for flag with preferred job count. + // jobsFlagE is expression for flag with preferred job count. jobsFlagE = `"-j$` + pkg.EnvJobs + `"` // jobsLE is expression for twice of preferred job count set by [pkg]. jobsLE = `"$(expr ` + jobsE + ` '*' 2)"` - // jobsE is expression for flag with double of preferred job count. + // jobsLFlagE is expression for flag with double of preferred job count. jobsLFlagE = `"-j$(expr ` + jobsE + ` '*' 2)"` ) @@ -624,7 +624,7 @@ func init() { panic(err) } if err = native.EvaluateFS(sub); err != nil { - println(err) + println(err.Error()) os.Exit(1) } } diff --git a/internal/rosa/state.go b/internal/rosa/state.go index b01c4c38..fd363faf 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -382,11 +382,17 @@ func (s *S) getS() []azalea.Frame { return unique.Make(azalea.Ident(name)) } s.s = make([]azalea.Frame, 1, 1<<4) + s.s[0].Val = map[unique.Handle[azalea.Ident]]any{ + k("jobsE"): jobsE, + k("jobsFlagE"): jobsFlagE, + k("jobsLE"): jobsLE, + k("jobsLFlagE"): jobsLFlagE, + } s.s[0].Func = map[unique.Handle[azalea.Ident]]azalea.F{ // intenral/pkg built-ins - unique.Make(azalea.Ident("remoteTar")): {F: func( + k("remoteTar"): {F: func( args azalea.FArgs, ) (v any, set bool, err error) { var url, checksum string @@ -398,7 +404,7 @@ func (s *S) getS() []azalea.Frame { }); err != nil { return } - v = newTar(url, checksum, compress) + v = pkg.NewHTTPGetTar(nil, url, mustDecode(checksum), compress) set = true return }, V: map[unique.Handle[azalea.Ident]]any{ @@ -407,9 +413,43 @@ func (s *S) getS() []azalea.Frame { k("bzip2"): uint32(pkg.TarBzip2), }}, + k("remoteFile"): {F: func( + args azalea.FArgs, + ) (v any, set bool, err error) { + var url, checksum string + if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ + k("url"): &url, + k("checksum"): &checksum, + }); err != nil { + return + } + v = pkg.NewHTTPGet(nil, url, mustDecode(checksum)) + set = true + return + }}, + + // convenience functions + + unique.Make(azalea.Ident("remoteGitLab")): {F: func( + args azalea.FArgs, + ) (v any, set bool, err error) { + var domain, suffix, ref, checksum string + if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ + k("domain"): &domain, + k("suffix"): &suffix, + k("ref"): &ref, + k("checksum"): &checksum, + }); err != nil { + return + } + v = newFromGitLab(domain, suffix, ref, checksum) + set = true + return + }}, + // high-level helpers - unique.Make(azalea.Ident("make")): {F: func( + k("make"): {F: func( args azalea.FArgs, ) (v any, set bool, err error) { var attr MakeHelper @@ -429,6 +469,8 @@ func (s *S) getS() []azalea.Frame { k("skipCheck"): &attr.SkipCheck, k("check"): &attr.Check, k("install"): &attr.Install, + + k("skipEarlyStageCheck"): &attr.SkipCheckEarly, }); err != nil { return } @@ -479,6 +521,8 @@ func (ctx *evalContext) f( var ( attr PackageAttr patches []string + excl bool + early bool anitya int64 version string @@ -501,6 +545,8 @@ func (ctx *evalContext) f( k("env"): &attr.Env, k("early"): &attr.ScriptEarly, k("patches"): &patches, + k("exclusive"): &excl, + k("toyboxEarly"): &early, k("exec"): &helper, k("inputs"): &inputs, @@ -526,6 +572,12 @@ func (ctx *evalContext) f( unsafe.String(unsafe.SliceData(p), len(p)), }) } + if excl { + attr.Flag |= TExclusive + } + if early { + attr.Flag |= TEarly + } meta.ID = int(anitya) meta.f = func(t Toolchain) (pkg.Artifact, string) {