From ff44060763eedf385d9218cc5a93344b8bb04021 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 19 May 2026 18:15:04 +0900 Subject: [PATCH] internal/rosa/package: migrate python packages This also migrates LLVM LIT via the newly implemented special case. Signed-off-by: Ophestra --- internal/rosa/package/lit.az | 15 + internal/rosa/package/python/package.az | 437 ++++++++++++++++++++++++ internal/rosa/python.go | 386 --------------------- internal/rosa/state.go | 24 ++ internal/rosa/state_native.go | 344 +++++++++---------- 5 files changed, 643 insertions(+), 563 deletions(-) create mode 100644 internal/rosa/package/lit.az diff --git a/internal/rosa/package/lit.az b/internal/rosa/package/lit.az new file mode 100644 index 00000000..c4d60062 --- /dev/null +++ b/internal/rosa/package/lit.az @@ -0,0 +1,15 @@ +package lit { + description = "a portable tool for executing LLVM and Clang style test suites"; + website = "https://llvm.org/docs/CommandGuide/lit.html"; + + source = llvm-project; + + exec = pip { + append = [ "llvm", "utils", "lit" ]; + // already checked during llvm + skipCheck = true; + }; + + inputs = [ python-setuptools ]; + runtime = [ python ]; +} diff --git a/internal/rosa/package/python/package.az b/internal/rosa/package/python/package.az index 70699250..1753e373 100644 --- a/internal/rosa/package/python/package.az +++ b/internal/rosa/package/python/package.az @@ -68,3 +68,440 @@ package python { openssl, ]; } + +package python-setuptools { + description = "the autotools of the Python ecosystem"; + website = "https://pypi.org/project/setuptools"; + anitya = 4021; + + version* = "82.0.1"; + source = remoteGitHub { + suffix = "pypa/setuptools"; + tag = "v"+version; + checksum = "nznP46Tj539yqswtOrIM4nQgwLA1h-ApKX7z7ghazROCpyF5swtQGwsZoI93wkhc"; + }; + + exec = pip { + // error: invalid command 'dist_info' + buildIsolation = true; + // pytest circular dependency + skipCheck = true; + }; + + runtime = [ python ]; +} + +package python-wheel { + description = "the official binary distribution format for Python"; + website = "https://peps.python.org/pep-0427"; + anitya = 11428; + + version* = "0.47.0"; + source = remoteGitHub { + suffix = "pypa/wheel"; + tag = version; + checksum = "HZ-MvkUP8mbbx2YmsRNswj_bbOCIiXckuHqL5Qbvb5NxN5DYfWnqwkGNyS7OrId0"; + }; + + exec = pip { + install = true; + }; + + inputs = [ + python-flit-core, + python-setuptools, + ]; + + runtime = [ python ]; +} + +package python-vcs-versioning { + description = "core VCS versioning functionality extracted as a standalone library"; + website = "https://setuptools-scm.readthedocs.io/en/latest"; + anitya = 389421; + + version* = "1.1.1"; + source = remoteGitHub { + suffix = "pypa/setuptools-scm"; + tag = "vcs-versioning-v"+version; + checksum = "rXZixTsZcRcIoUC1LvWrjySsiXSv5uhW6ng2P-yXZrbdj7FrSrDeJLCfC2b-ladV"; + }; + + env = [ + "SETUPTOOLS_SCM_PRETEND_VERSION=" + version, + ]; + + exec = pip { + // upstream is monorepo of two packages (setuptools-scm) + append = [ "vcs-versioning" ]; + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ + python-setuptools, + python-packaging, + ]; + + runtime = [ + python-setuptools, + python-packaging, + ]; +} + +package python-setuptools-scm { + description = "extracts Python package versions from Git or Mercurial metadata"; + website = "https://setuptools-scm.readthedocs.io/en/latest"; + anitya = 7874; + + version* = "10.0.5"; + source = remoteGitHub { + suffix = "pypa/setuptools-scm"; + tag = "setuptools-scm-v"+version; + checksum = "vTN_TPd-b4Wbsw5WmAcsWjrs-FNXXznOeVTDnb54NtXve9Oy-eb2HPy-RG3FzNqp"; + }; + + env = [ + "SETUPTOOLS_SCM_PRETEND_VERSION=" + version, + ]; + + exec = pip { + // upstream is monorepo of two packages + append = [ "setuptools-scm" ]; + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ + python-setuptools, + python-vcs-versioning, + ]; + + runtime = [ + python-setuptools, + python-vcs-versioning, + ]; +} + +package python-flit-core { + description = "a PEP 517 build backend for packages using Flit"; + website = "https://flit.pypa.io"; + anitya = 44841; + + version* = "3.12.0"; + source = remoteGitHub { + suffix = "pypa/flit"; + tag = version; + checksum = "VcTsiGiDU1aPLbjSPe38f9OjJDCLcxFz9loObJqUI1ZxDHXAaQMxBpNyLz_G1Rff"; + }; + + exec = pip { + // upstream has other unused packages with many dependencies + append = [ "flit_core" ]; + // pytest circular dependency + skipCheck = true; + }; + + runtime = [ python ]; +} + +package python-packaging { + description = "reusable core utilities for various Python Packaging interoperability specifications"; + website = "https://packaging.pypa.io"; + anitya = 60461; + + version* = "26.2"; + source = remoteGitHub { + suffix = "pypa/packaging"; + tag = version; + checksum = "rdpGa2EkPFbj1mFtLKLnSwIX9gPfELcuneiICjRVDNw6By49szTFVoW8gtMMZ6ZS"; + }; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-flit-core ]; + runtime = [ python ]; +} + +package python-pathspec { + description = "utility library for gitignore style pattern matching of file paths"; + website = "https://github.com/cpburnz/python-pathspec"; + anitya = 23424; + + version* = "1.1.1"; + source = remoteGitHub { + suffix = "cpburnz/python-pathspec"; + tag = "v"+version; + checksum = "1fVwoal6FoKXczoG3qRUi87TxSWESSGcgvnbEZDYuaOgsO25o36iF3SbAhwkr4Va"; + }; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-flit-core ]; + runtime = [ python ]; +} + +package python-trove-classifiers { + description = "canonical source for classifiers on PyPI"; + website = "https://pypi.org/p/trove-classifiers"; + anitya = 88298; + + version* = "2026.5.7.17"; + source = remoteGitHub { + suffix = "pypa/trove-classifiers"; + tag = version; + checksum = "1Fcps0gK9P4ofwGL8MISN9k1Q40-quxX7NDpIna50TmziBNrZy-0Vz0I9yIeHCoP"; + }; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-setuptools ]; + runtime = [ python ]; +} + +package python-pluggy { + description = "the core framework used by the pytest, tox, and devpi projects"; + website = "https://pluggy.readthedocs.io/en/latest"; + anitya = 7500; + + version* = "1.6.0"; + source = remoteGitHub { + suffix = "pytest-dev/pluggy"; + tag = version; + checksum = "GiUgDkKjF8Xn1cmq6iMhTGXzcPIYeaJrvQpHBSAJapNVx4UyuiTXqd5eVlxSClJu"; + }; + + env = [ + "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PLUGGY=" + version, + ]; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-setuptools-scm ]; + runtime = [ python ]; +} + +package python-hatchling { + description = "the extensible, standards compliant build backend used by Hatch"; + website = "https://hatch.pypa.io"; + anitya = 16137; + + version* = "1.16.5"; + source = remoteGitHub { + suffix = "pypa/hatch"; + tag = "hatch-v"+version; + checksum = "V2eREtqZLZeV85yb4O-bfAJCUluHcQP76Qfs0QH5s7RF_Oc8xIP8jD0jl85qFyWk"; + }; + + exec = pip { + // upstream has other unused packages with many dependencies + append = [ "backend" ]; + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ + python-packaging, + python-pathspec, + python-trove-classifiers, + python-pluggy, + ]; + + runtime = [ + python-packaging, + python-pathspec, + python-trove-classifiers, + python-pluggy, + ]; +} + +package python-pygments { + description = "a syntax highlighting package written in Python"; + website = "https://pygments.org"; + anitya = 3986; + + version* = "2.20.0"; + source = remoteGitHub { + suffix = "pygments/pygments"; + tag = version; + checksum = "L-2P6vn7c_CNZYliE5CJAWLxO1ziDQVVkf8bnZbHj8aSCQ43oWv11wC9KzU9MeCa"; + }; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-hatchling ]; + runtime = [ python ]; +} + +package python-iniconfig { + description = "a small and simple INI-file parser module"; + website = "https://github.com/pytest-dev/iniconfig"; + anitya = 114778; + + version* = "2.3.0"; + source = remoteGitHub { + suffix = "pytest-dev/iniconfig"; + tag = "v"+version; + checksum = "mH7VBZaXcYatBPE3RQQZvSzz_Ay8IPPek60NpPHZulPq4ReAFUUsA4EPWfiyMknZ"; + }; + + env = [ + "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_INICONFIG=" + version, + ]; + + exec = pip { + // pytest circular dependency + skipCheck = true; + }; + + inputs = [ python-setuptools-scm ]; + runtime = [ python ]; +} + +package python-pytest { + description = "the pytest framework"; + website = "https://pytest.org"; + anitya = 3765; + + version* = "9.0.3"; + source = remoteGitHub { + suffix = "pytest-dev/pytest"; + tag = version; + checksum = "qfLL_znWhbJCDbNJvrx9H3-orJ86z4ifhaW0bIn21jl2sDP-FVoX_1yieOypArQe"; + }; + + env = [ + "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=" + version, + ]; + + exec = pip { + // many dependencies + skipCheck = true; + }; + + inputs = [ + python-iniconfig, + python-packaging, + python-pluggy, + python-pygments, + + python-setuptools-scm, + ]; + + runtime = [ + python-iniconfig, + python-packaging, + python-pluggy, + python-pygments, + ]; +} + +package python-markupsafe { + description = "implements a text object that escapes characters so it is safe to use in HTML and XML"; + website = "https://markupsafe.palletsprojects.com"; + anitya = 3918; + + version* = "3.0.3"; + source = remoteGitHub { + suffix = "pallets/markupsafe"; + tag = version; + checksum = "txRGYdWE3his1lHHRI-lZADw0-ILvUg2l5OGdFHtFXIb_QowGxwdxHCUSJIgmjQs"; + }; + + exec = pip { + // ModuleNotFoundError: No module named 'markupsafe' + install = true; + }; + + inputs = [ python-setuptools ]; + runtime = [ python ]; +} + +package python-mako { + description = "a template library written in Python"; + website = "https://www.makotemplates.org"; + anitya = 3915; + + version* = "1.3.12"; + source = remoteGitHub { + suffix = "sqlalchemy/mako"; + tag = "rel_"+join { + elems = split { + s = version; + sep = "."; + n = 3; + }; + sep = "_"; + }; + checksum = "OZbBsQe2MzRuAo5Mr4qRwWHGqU1EEZeBuSprDDIceAtMLIUJtO7SbERlxHIxNhLk"; + }; + + exec = pip {}; + + inputs = [ + python-markupsafe, + + python-setuptools, + ]; + + runtime = [ python-markupsafe ]; +} + +package python-pyyaml { + description = "a YAML parser and emitter for Python"; + website = "https://pyyaml.org"; + anitya = 4123; + + version* = "6.0.3"; + source = remoteGitHub { + suffix = "yaml/pyyaml"; + tag = version; + checksum = "7wDv0RW9chBdu9l5Q4Hun5F2HHdo105ZSIixwdFPKbEYbftW9YxmsegfL-zafnbJ"; + }; + + exec = pip { + // ModuleNotFoundError: No module named 'yaml' + install = true; + }; + + inputs = [ python-setuptools ]; + runtime = [ python ]; +} + +package python-pycparser { + description = "complete C99 parser in pure Python"; + website = "https://github.com/eliben/pycparser"; + anitya = 8175; + + version* = "3.00"; + source = remoteGitHub { + suffix = "eliben/pycparser"; + tag = "release_v"+version; + checksum = "4qfCMFKp0fLsRsloOAF780tXX_Ce_68RwinCmjNGObAX32WpF_iBafIKW1S1bYlA"; + }; + + // test case hard codes gcc + early = ` +ln -s clang /system/bin/gcc +`; + + exec = pip {}; + + inputs = [ python-setuptools ]; + runtime = [ python ]; +} diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 4b85399b..bce36256 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -2,7 +2,6 @@ package rosa import ( "slices" - "strings" "hakurei.app/internal/pkg" ) @@ -120,388 +119,3 @@ func (s *S) newPythonPackage( )...) }) } - -func init() { - const ( - version = "0.47.0" - checksum = "HZ-MvkUP8mbbx2YmsRNswj_bbOCIiXckuHqL5Qbvb5NxN5DYfWnqwkGNyS7OrId0" - ) - native.newPythonPackage( - "wheel", 11428, - "the official binary distribution format for Python", - "https://peps.python.org/pep-0427/", - version, newFromGitHub( - "pypa/wheel", - version, checksum, - ), nil, &PipHelper{ - Install: true, - }, P{PythonFlitCore, PythonSetuptools}, - ) -} - -func init() { - const ( - version = "82.0.1" - checksum = "nznP46Tj539yqswtOrIM4nQgwLA1h-ApKX7z7ghazROCpyF5swtQGwsZoI93wkhc" - ) - native.newPythonPackage( - "setuptools", 4021, - "the autotools of the Python ecosystem", - "https://pypi.org/project/setuptools/", - version, newFromGitHub( - "pypa/setuptools", - "v"+version, checksum, - ), nil, &PipHelper{ - // error: invalid command 'dist_info' - BuildIsolation: true, - // pytest circular dependency - SkipCheck: true, - }, nil) -} - -func init() { - const ( - version = "1.1.1" - checksum = "rXZixTsZcRcIoUC1LvWrjySsiXSv5uhW6ng2P-yXZrbdj7FrSrDeJLCfC2b-ladV" - ) - native.newPythonPackage( - "vcs-versioning", 389421, - "core VCS versioning functionality extracted as a standalone library", - "https://setuptools-scm.readthedocs.io/en/latest/", - version, newFromGitHub( - "pypa/setuptools-scm", - "vcs-versioning-v"+version, checksum, - ), &PackageAttr{ - Env: []string{ - "SETUPTOOLS_SCM_PRETEND_VERSION=" + version, - }, - }, &PipHelper{ - // upstream is monorepo of two packages (setuptools-scm) - Append: []string{"vcs-versioning"}, - // pytest circular dependency - SkipCheck: true, - }, nil, - PythonSetuptools, - PythonPackaging, - ) -} - -func init() { - const ( - version = "10.0.5" - checksum = "vTN_TPd-b4Wbsw5WmAcsWjrs-FNXXznOeVTDnb54NtXve9Oy-eb2HPy-RG3FzNqp" - ) - native.newPythonPackage( - "setuptools-scm", 7874, - "extracts Python package versions from Git or Mercurial metadata", - "https://setuptools-scm.readthedocs.io/en/latest/", - version, newFromGitHub( - "pypa/setuptools-scm", - "setuptools-scm-v"+version, checksum, - ), &PackageAttr{ - Env: []string{ - "SETUPTOOLS_SCM_PRETEND_VERSION=" + version, - }, - }, &PipHelper{ - // upstream is monorepo of two packages - Append: []string{"setuptools-scm"}, - // pytest circular dependency - SkipCheck: true, - }, nil, - PythonSetuptools, - PythonVCSVersioning, - ) -} - -func init() { - const ( - version = "3.12.0" - checksum = "VcTsiGiDU1aPLbjSPe38f9OjJDCLcxFz9loObJqUI1ZxDHXAaQMxBpNyLz_G1Rff" - ) - native.newPythonPackage( - "flit-core", 44841, - "a PEP 517 build backend for packages using Flit", - "https://flit.pypa.io/", - version, newFromGitHub( - "pypa/flit", - version, checksum, - ), nil, &PipHelper{ - // upstream has other unused packages with many dependencies - Append: []string{"flit_core"}, - // pytest circular dependency - SkipCheck: true, - }, nil, - ) -} - -func init() { - const ( - version = "26.2" - checksum = "rdpGa2EkPFbj1mFtLKLnSwIX9gPfELcuneiICjRVDNw6By49szTFVoW8gtMMZ6ZS" - ) - native.newPythonPackage( - "packaging", 60461, - "reusable core utilities for various Python Packaging interoperability specifications", - "https://packaging.pypa.io/", - version, newFromGitHub( - "pypa/packaging", - version, checksum, - ), nil, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonFlitCore}, - ) -} - -func init() { - native.mustRegister(func(t Toolchain) (pkg.Artifact, string) { - meta, source := t.Load(llvmSource) - return t.NewPackage("lit", meta.Version, source, nil, &PipHelper{ - Append: []string{"llvm", "utils", "lit"}, - // already checked during llvm - SkipCheck: true, - }, - PythonSetuptools, - ), meta.Version - }, &Metadata{ - Name: "lit", - Description: "a portable tool for executing LLVM and Clang style test suites", - Website: "https://llvm.org/docs/CommandGuide/lit.html", - - Dependencies: P{ - Python, - }, - }) -} - -func init() { - const ( - version = "1.1.1" - checksum = "1fVwoal6FoKXczoG3qRUi87TxSWESSGcgvnbEZDYuaOgsO25o36iF3SbAhwkr4Va" - ) - native.newPythonPackage( - "pathspec", 23424, - "utility library for gitignore style pattern matching of file paths", - "https://github.com/cpburnz/python-pathspec", - version, newFromGitHub( - "cpburnz/python-pathspec", - "v"+version, checksum, - ), nil, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonFlitCore}, - ) -} - -func init() { - const ( - version = "2026.5.7.17" - checksum = "1Fcps0gK9P4ofwGL8MISN9k1Q40-quxX7NDpIna50TmziBNrZy-0Vz0I9yIeHCoP" - ) - native.newPythonPackage( - "trove-classifiers", 88298, - "canonical source for classifiers on PyPI", - "https://pypi.org/p/trove-classifiers/", - version, newFromGitHub( - "pypa/trove-classifiers", - version, checksum, - ), nil, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonSetuptools}, - ) -} - -func init() { - const ( - version = "1.6.0" - checksum = "GiUgDkKjF8Xn1cmq6iMhTGXzcPIYeaJrvQpHBSAJapNVx4UyuiTXqd5eVlxSClJu" - ) - native.newPythonPackage( - "pluggy", 7500, - "the core framework used by the pytest, tox, and devpi projects", - "https://pluggy.readthedocs.io/en/latest/", - version, newFromGitHub( - "pytest-dev/pluggy", - version, checksum, - ), &PackageAttr{ - Env: []string{ - "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PLUGGY=" + version, - }, - }, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonSetuptoolsSCM}, - ) -} - -func init() { - const ( - version = "1.16.5" - checksum = "V2eREtqZLZeV85yb4O-bfAJCUluHcQP76Qfs0QH5s7RF_Oc8xIP8jD0jl85qFyWk" - ) - native.newPythonPackage( - "hatchling", 16137, - "the extensible, standards compliant build backend used by Hatch", - "https://hatch.pypa.io/latest/", - version, newFromGitHub( - "pypa/hatch", - "hatch-v"+version, checksum, - ), nil, &PipHelper{ - // upstream has other unused packages with many dependencies - Append: []string{"backend"}, - // pytest circular dependency - SkipCheck: true, - }, nil, - PythonPackaging, - PythonPathspec, - PythonTroveClassifiers, - PythonPluggy, - ) -} - -func init() { - const ( - version = "2.20.0" - checksum = "L-2P6vn7c_CNZYliE5CJAWLxO1ziDQVVkf8bnZbHj8aSCQ43oWv11wC9KzU9MeCa" - ) - native.newPythonPackage( - "pygments", 3986, - "a syntax highlighting package written in Python", - "https://pygments.org/", - version, newFromGitHub( - "pygments/pygments", - version, checksum, - ), nil, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonHatchling}, - ) -} - -func init() { - const ( - version = "2.3.0" - checksum = "mH7VBZaXcYatBPE3RQQZvSzz_Ay8IPPek60NpPHZulPq4ReAFUUsA4EPWfiyMknZ" - ) - native.newPythonPackage( - "iniconfig", 114778, - "a small and simple INI-file parser module", - "https://github.com/pytest-dev/iniconfig", - version, newFromGitHub( - "pytest-dev/iniconfig", - "v"+version, checksum, - ), &PackageAttr{ - Env: []string{ - "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_INICONFIG=" + version, - }, - }, &PipHelper{ - // pytest circular dependency - SkipCheck: true, - }, P{PythonSetuptoolsSCM}, - ) -} - -func init() { - const ( - version = "9.0.3" - checksum = "qfLL_znWhbJCDbNJvrx9H3-orJ86z4ifhaW0bIn21jl2sDP-FVoX_1yieOypArQe" - ) - native.newPythonPackage( - "pytest", 3765, - "the pytest framework", - "https://pytest.org", - version, newFromGitHub( - "pytest-dev/pytest", - version, checksum, - ), &PackageAttr{ - Env: []string{ - "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=" + version, - }, - }, &PipHelper{ - // many dependencies - SkipCheck: true, - }, P{PythonSetuptoolsSCM}, - PythonIniConfig, - PythonPackaging, - PythonPluggy, - PythonPygments, - ) -} - -func init() { - const ( - version = "3.0.3" - checksum = "txRGYdWE3his1lHHRI-lZADw0-ILvUg2l5OGdFHtFXIb_QowGxwdxHCUSJIgmjQs" - ) - native.newPythonPackage( - "markupsafe", 3918, - "implements a text object that escapes characters so it is safe to use in HTML and XML", - "https://markupsafe.palletsprojects.com/", - version, newFromGitHub( - "pallets/markupsafe", - version, checksum, - ), nil, &PipHelper{ - // ModuleNotFoundError: No module named 'markupsafe' - Install: true, - }, P{PythonSetuptools}, - ) -} - -func init() { - const ( - version = "1.3.12" - checksum = "OZbBsQe2MzRuAo5Mr4qRwWHGqU1EEZeBuSprDDIceAtMLIUJtO7SbERlxHIxNhLk" - ) - native.newPythonPackage( - "mako", 3915, - "a template library written in Python", - "https://www.makotemplates.org/", - version, newFromGitHub( - "sqlalchemy/mako", - "rel_"+strings.Join(strings.SplitN(version, ".", 3), "_"), - checksum, - ), nil, nil, P{PythonSetuptools}, - PythonMarkupSafe, - ) -} - -func init() { - const ( - version = "6.0.3" - checksum = "7wDv0RW9chBdu9l5Q4Hun5F2HHdo105ZSIixwdFPKbEYbftW9YxmsegfL-zafnbJ" - ) - native.newPythonPackage( - "pyyaml", 4123, - "a YAML parser and emitter for Python", - "https://pyyaml.org/", - version, newFromGitHub( - "yaml/pyyaml", - version, checksum, - ), nil, &PipHelper{ - // ModuleNotFoundError: No module named 'yaml' - Install: true, - }, P{PythonSetuptools}, - ) -} - -func init() { - const ( - version = "3.00" - checksum = "4qfCMFKp0fLsRsloOAF780tXX_Ce_68RwinCmjNGObAX32WpF_iBafIKW1S1bYlA" - ) - native.newPythonPackage( - "pycparser", 8175, - "complete C99 parser in pure Python", - "https://github.com/eliben/pycparser", - version, newFromGitHub( - "eliben/pycparser", - "release_v"+version, checksum, - ), &PackageAttr{ - // test case hard codes gcc - ScriptEarly: ` -ln -s clang /system/bin/gcc -`, - }, nil, P{PythonSetuptools}, - ) -} diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 2581bb75..90da8660 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -451,6 +451,30 @@ func (s *S) getFrame() azalea.Frame { return }}, + k("split"): {F: func( + args azalea.FArgs, + ) (v any, set bool, err error) { + var p, sep string + var n int64 + if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ + k("s"): &p, + k("sep"): &sep, + k("n"): &n, + }); err != nil { + return + } + + if n < 0 { + n = 0 + } else if n == 0 { + n = -1 + } + + v = strings.SplitN(p, sep, int(n)) + set = true + return + }}, + // intenral/pkg built-ins k("remoteTar"): {F: func( diff --git a/internal/rosa/state_native.go b/internal/rosa/state_native.go index 801a7000..0103193e 100644 --- a/internal/rosa/state_native.go +++ b/internal/rosa/state_native.go @@ -1,181 +1,171 @@ package rosa var ( - LLVM = H("llvm") - EarlyInit = H("earlyinit") - ImageSystem = H("system-image") - ImageInitramfs = H("initramfs-image") - Kernel = H("kernel") - KernelHeaders = H("kernel-headers") - KernelSource = H("kernel-source") - Firmware = H("firmware") - ACL = H("acl") - ArgpStandalone = H("argp-standalone") - Attr = H("attr") - Autoconf = H("autoconf") - Automake = H("automake") - BC = H("bc") - Bash = H("bash") - Binutils = H("binutils") - Bison = H("bison") - Bzip2 = H("bzip2") - CMake = H("cmake") - Connman = H("connman") - Coreutils = H("coreutils") - Curl = H("curl") - DBus = H("dbus") - DTC = H("dtc") - Diffutils = H("diffutils") - Elfutils = H("elfutils") - Fakeroot = H("fakeroot") - Findutils = H("findutils") - Flex = H("flex") - FontUtil = H("font-util") - Freetype = H("freetype") - Fuse = H("fuse") - GMP = H("gmp") - GLib = H("glib") - Gawk = H("gawk") - GenInitCPIO = H("gen_init_cpio") - Gettext = H("gettext") - Git = H("git") - Glslang = H("glslang") - GnuTLS = H("gnutls") - Go = H("go") - Gperf = H("gperf") - Grep = H("grep") - Gzip = H("gzip") - Hakurei = H("hakurei") - HakureiDist = H("hakurei-dist") - Hwdata = H("hwdata") - IPTables = H("iptables") - Kmod = H("kmod") - LIT = H("lit") - LibX11 = H("libX11") - LibXau = H("libXau") - LibXdmcp = H("libXdmcp") - LibXext = H("libXext") - LibXfixes = H("libXfixes") - LibXfont2 = H("libXfont2") - LibXrandr = H("libXrandr") - LibXrender = H("libXrender") - LibXxf86vm = H("libXxf86vm") - Libarchive = H("libarchive") - Libbsd = H("libbsd") - Libcap = H("libcap") - Libconfig = H("libconfig") - LibdisplayInfo = H("libdisplay-info") - Libdrm = H("libdrm") - Libepoxy = H("libepoxy") - Libev = H("libev") - Libexpat = H("libexpat") - Libffi = H("libffi") - Libfontenc = H("libfontenc") - Libgd = H("libgd") - Libglvnd = H("libglvnd") - Libiconv = H("libiconv") - Libmd = H("libmd") - Libmnl = H("libmnl") - Libnftnl = H("libnftnl") - Libpciaccess = H("libpciaccess") - Libpng = H("libpng") - Libpsl = H("libpsl") - Libseccomp = H("libseccomp") - Libtasn1 = H("libtasn1") - Libtirpc = H("libtirpc") - Libtool = H("libtool") - Libucontext = H("libucontext") - Libunistring = H("libunistring") - Libva = H("libva") - LibxcbRenderUtil = H("libxcb-render-util") - LibxcbUtil = H("libxcb-util") - LibxcbUtilImage = H("libxcb-util-image") - LibxcbUtilKeysyms = H("libxcb-util-keysyms") - LibxcbUtilWM = H("libxcb-util-wm") - Libxcvt = H("libxcvt") - Libxkbfile = H("libxkbfile") - Libxml2 = H("libxml2") - Libxshmfence = H("libxshmfence") - Libxslt = H("libxslt") - Libxtrans = H("libxtrans") - LMSensors = H("lm_sensors") - M4 = H("m4") - MPC = H("mpc") - MPFR = H("mpfr") - Make = H("make") - Mesa = H("mesa") - Meson = H("meson") - Mksh = H("mksh") - MuslFts = H("musl-fts") - MuslObstack = H("musl-obstack") - NSS = H("nss") - NSSCACert = H("nss-cacert") - Ncurses = H("ncurses") - Nettle = H("nettle") - Ninja = H("ninja") - OpenSSL = H("openssl") - P11Kit = H("p11-kit") - PCRE2 = H("pcre2") - Parallel = H("parallel") - Patch = H("patch") - PerlTestCmd = H("perl-Test-Cmd") - Pixman = H("pixman") - PkgConfig = H("pkg-config") - Procps = H("procps") - PythonFlitCore = H("python-flit-core") - PythonHatchling = H("python-hatchling") - PythonIniConfig = H("python-iniconfig") - PythonMako = H("python-mako") - PythonMarkupSafe = H("python-markupsafe") - PythonPackaging = H("python-packaging") - PythonPathspec = H("python-pathspec") - PythonPluggy = H("python-pluggy") - PythonPyTest = H("python-pytest") - PythonPyYAML = H("python-pyyaml") - PythonPycparser = H("python-pycparser") - PythonPygments = H("python-pygments") - PythonSetuptools = H("python-setuptools") - PythonSetuptoolsSCM = H("python-setuptools-scm") - PythonTroveClassifiers = H("python-trove-classifiers") - PythonVCSVersioning = H("python-vcs-versioning") - PythonWheel = H("python-wheel") - QEMU = H("qemu") - Rdfind = H("rdfind") - Readline = H("readline") - Rsync = H("rsync") - Sed = H("sed") - SPIRVHeaders = H("spirv-headers") - SPIRVLLVMTranslator = H("spirv-llvm-translator") - SPIRVTools = H("spirv-tools") - SquashfsTools = H("squashfs-tools") - Strace = H("strace") - TamaGo = H("tamago") - Tar = H("tar") - Texinfo = H("texinfo") - Toybox = H("toybox") - toyboxEarly = H("toybox-early") - Unzip = H("unzip") - UtilLinux = H("util-linux") - VIM = H("vim") - Wayland = H("wayland") - WaylandProtocols = H("wayland-protocols") - XCB = H("xcb") - XCBProto = H("xcb-proto") - XDGDBusProxy = H("xdg-dbus-proxy") - XZ = H("xz") - Xkbcomp = H("xkbcomp") - XkeyboardConfig = H("xkeyboard-config") - XorgProto = H("xorgproto") - Xserver = H("xserver") - Zlib = H("zlib") - Zstd = H("zstd") - stage0Dist = H("stage0-dist") - llvmSource = H("llvm-project") - earlyCompilerRT = H("early-compiler-rt") - earlyRuntimes = H("early-runtimes") - utilMacros = H("util-macros") - Musl = H("musl") - muslHeaders = H("musl-headers") - gcc = H("gcc") - Stage0 = H("rosa-stage0") + LLVM = H("llvm") + EarlyInit = H("earlyinit") + ImageSystem = H("system-image") + ImageInitramfs = H("initramfs-image") + Kernel = H("kernel") + KernelHeaders = H("kernel-headers") + KernelSource = H("kernel-source") + Firmware = H("firmware") + ACL = H("acl") + ArgpStandalone = H("argp-standalone") + Attr = H("attr") + Autoconf = H("autoconf") + Automake = H("automake") + BC = H("bc") + Bash = H("bash") + Binutils = H("binutils") + Bison = H("bison") + Bzip2 = H("bzip2") + CMake = H("cmake") + Connman = H("connman") + Coreutils = H("coreutils") + Curl = H("curl") + DBus = H("dbus") + DTC = H("dtc") + Diffutils = H("diffutils") + Elfutils = H("elfutils") + Fakeroot = H("fakeroot") + Findutils = H("findutils") + Flex = H("flex") + FontUtil = H("font-util") + Freetype = H("freetype") + Fuse = H("fuse") + GMP = H("gmp") + GLib = H("glib") + Gawk = H("gawk") + GenInitCPIO = H("gen_init_cpio") + Gettext = H("gettext") + Git = H("git") + Glslang = H("glslang") + GnuTLS = H("gnutls") + Go = H("go") + Gperf = H("gperf") + Grep = H("grep") + Gzip = H("gzip") + Hakurei = H("hakurei") + HakureiDist = H("hakurei-dist") + Hwdata = H("hwdata") + IPTables = H("iptables") + Kmod = H("kmod") + LIT = H("lit") + LibX11 = H("libX11") + LibXau = H("libXau") + LibXdmcp = H("libXdmcp") + LibXext = H("libXext") + LibXfixes = H("libXfixes") + LibXfont2 = H("libXfont2") + LibXrandr = H("libXrandr") + LibXrender = H("libXrender") + LibXxf86vm = H("libXxf86vm") + Libarchive = H("libarchive") + Libbsd = H("libbsd") + Libcap = H("libcap") + Libconfig = H("libconfig") + LibdisplayInfo = H("libdisplay-info") + Libdrm = H("libdrm") + Libepoxy = H("libepoxy") + Libev = H("libev") + Libexpat = H("libexpat") + Libffi = H("libffi") + Libfontenc = H("libfontenc") + Libgd = H("libgd") + Libglvnd = H("libglvnd") + Libiconv = H("libiconv") + Libmd = H("libmd") + Libmnl = H("libmnl") + Libnftnl = H("libnftnl") + Libpciaccess = H("libpciaccess") + Libpng = H("libpng") + Libpsl = H("libpsl") + Libseccomp = H("libseccomp") + Libtasn1 = H("libtasn1") + Libtirpc = H("libtirpc") + Libtool = H("libtool") + Libucontext = H("libucontext") + Libunistring = H("libunistring") + Libva = H("libva") + LibxcbRenderUtil = H("libxcb-render-util") + LibxcbUtil = H("libxcb-util") + LibxcbUtilImage = H("libxcb-util-image") + LibxcbUtilKeysyms = H("libxcb-util-keysyms") + LibxcbUtilWM = H("libxcb-util-wm") + Libxcvt = H("libxcvt") + Libxkbfile = H("libxkbfile") + Libxml2 = H("libxml2") + Libxshmfence = H("libxshmfence") + Libxslt = H("libxslt") + Libxtrans = H("libxtrans") + LMSensors = H("lm_sensors") + M4 = H("m4") + MPC = H("mpc") + MPFR = H("mpfr") + Make = H("make") + Mesa = H("mesa") + Meson = H("meson") + Mksh = H("mksh") + MuslFts = H("musl-fts") + MuslObstack = H("musl-obstack") + NSS = H("nss") + NSSCACert = H("nss-cacert") + Ncurses = H("ncurses") + Nettle = H("nettle") + Ninja = H("ninja") + OpenSSL = H("openssl") + P11Kit = H("p11-kit") + PCRE2 = H("pcre2") + Parallel = H("parallel") + Patch = H("patch") + PerlTestCmd = H("perl-Test-Cmd") + Pixman = H("pixman") + PkgConfig = H("pkg-config") + Procps = H("procps") + PythonMako = H("python-mako") + PythonPackaging = H("python-packaging") + PythonPyTest = H("python-pytest") + PythonPyYAML = H("python-pyyaml") + PythonPycparser = H("python-pycparser") + PythonSetuptools = H("python-setuptools") + PythonWheel = H("python-wheel") + QEMU = H("qemu") + Rdfind = H("rdfind") + Readline = H("readline") + Rsync = H("rsync") + Sed = H("sed") + SPIRVHeaders = H("spirv-headers") + SPIRVLLVMTranslator = H("spirv-llvm-translator") + SPIRVTools = H("spirv-tools") + SquashfsTools = H("squashfs-tools") + Strace = H("strace") + TamaGo = H("tamago") + Tar = H("tar") + Texinfo = H("texinfo") + Toybox = H("toybox") + toyboxEarly = H("toybox-early") + Unzip = H("unzip") + UtilLinux = H("util-linux") + VIM = H("vim") + Wayland = H("wayland") + WaylandProtocols = H("wayland-protocols") + XCB = H("xcb") + XCBProto = H("xcb-proto") + XDGDBusProxy = H("xdg-dbus-proxy") + XZ = H("xz") + Xkbcomp = H("xkbcomp") + XkeyboardConfig = H("xkeyboard-config") + XorgProto = H("xorgproto") + Xserver = H("xserver") + Zlib = H("zlib") + Zstd = H("zstd") + stage0Dist = H("stage0-dist") + llvmSource = H("llvm-project") + earlyCompilerRT = H("early-compiler-rt") + earlyRuntimes = H("early-runtimes") + utilMacros = H("util-macros") + Musl = H("musl") + muslHeaders = H("musl-headers") + gcc = H("gcc") + Stage0 = H("rosa-stage0") )