All checks were successful
Test / Create distribution (push) Successful in 49s
Test / Sandbox (push) Successful in 2m37s
Test / Hakurei (push) Successful in 3m59s
Test / ShareFS (push) Successful in 3m57s
Test / Hpkg (push) Successful in 4m28s
Test / Sandbox (race detector) (push) Successful in 5m0s
Test / Hakurei (race detector) (push) Successful in 5m54s
Test / Flake checks (push) Successful in 1m44s
Required by libfuse. This pulls in many dependencies. Signed-off-by: Ophestra <cat@gensokyo.uk>
156 lines
4.4 KiB
Go
156 lines
4.4 KiB
Go
package rosa
|
|
|
|
import (
|
|
"slices"
|
|
"strings"
|
|
|
|
"hakurei.app/internal/pkg"
|
|
)
|
|
|
|
func (t Toolchain) newPython() pkg.Artifact {
|
|
const (
|
|
version = "3.14.2"
|
|
checksum = "7nZunVMGj0viB-CnxpcRego2C90X5wFsMTgsoewd5z-KSZY2zLuqaBwG-14zmKys"
|
|
)
|
|
skipTests := []string{
|
|
// requires internet access (http://www.pythontest.net/)
|
|
"test_asyncio",
|
|
"test_socket",
|
|
"test_urllib2",
|
|
"test_urllibnet",
|
|
"test_urllib2net",
|
|
|
|
// makes assumptions about uid_map/gid_map
|
|
"test_os",
|
|
"test_subprocess",
|
|
|
|
// somehow picks up mtime of source code
|
|
"test_zipfile",
|
|
|
|
// requires gcc
|
|
"test_ctypes",
|
|
|
|
// breaks on llvm
|
|
"test_dbm_gnu",
|
|
}
|
|
return t.New("python-"+version, false, []pkg.Artifact{
|
|
t.Load(Make),
|
|
t.Load(Zlib),
|
|
t.Load(Libffi),
|
|
}, nil, []string{
|
|
"EXTRATESTOPTS=-j0 -x " + strings.Join(skipTests, " -x "),
|
|
|
|
// _ctypes appears to infer something from the linker name
|
|
"LDFLAGS=-Wl,--dynamic-linker=/system/lib/" +
|
|
"ld-musl-" + linuxArch() + ".so.1",
|
|
}, `
|
|
# test_synopsis_sourceless assumes this is writable and checks __pycache__
|
|
chmod -R +w /usr/src/python/
|
|
|
|
export HOME="$(mktemp -d)"
|
|
cd "$(mktemp -d)"
|
|
/usr/src/python/configure \
|
|
--prefix=/system \
|
|
--build="${ROSA_TRIPLE}"
|
|
make "-j$(nproc)"
|
|
make test
|
|
make DESTDIR=/work install
|
|
`, pkg.Path(AbsUsrSrc.Append("python"), true,
|
|
pkg.NewHTTPGetTar(
|
|
nil, "https://www.python.org/ftp/python/"+version+
|
|
"/Python-"+version+".tgz",
|
|
mustDecode(checksum),
|
|
pkg.TarGzip,
|
|
)))
|
|
}
|
|
func init() { artifactsF[Python] = Toolchain.newPython }
|
|
|
|
// newViaPip is a helper for installing python dependencies via pip.
|
|
func (t Toolchain) newViaPip(
|
|
name, version, abi, platform, checksum, prefix string,
|
|
extra ...pkg.Artifact,
|
|
) pkg.Artifact {
|
|
wname := name + "-" + version + "-py3-" + abi + "-" + platform + ".whl"
|
|
return t.New(name+"-"+version, false, slices.Concat([]pkg.Artifact{
|
|
t.Load(Python),
|
|
}, extra), nil, nil, `
|
|
pip3 install \
|
|
--no-index \
|
|
--prefix=/system \
|
|
--root=/work \
|
|
/usr/src/`+wname+`
|
|
`, pkg.Path(AbsUsrSrc.Append(wname), false, pkg.NewHTTPGet(
|
|
nil, prefix+wname,
|
|
mustDecode(checksum),
|
|
)))
|
|
}
|
|
|
|
func (t Toolchain) newSetuptools() pkg.Artifact {
|
|
const (
|
|
version = "80.10.1"
|
|
checksum = "p3rlwEmy1krcUH1KabprQz1TCYjJ8ZUjOQknQsWh3q-XEqLGEd3P4VrCc7ouHGXU"
|
|
)
|
|
return t.New("setuptools-"+version, false, []pkg.Artifact{
|
|
t.Load(Python),
|
|
}, nil, nil, `
|
|
pip3 install \
|
|
--no-index \
|
|
--prefix=/system \
|
|
--root=/work \
|
|
/usr/src/setuptools
|
|
`, pkg.Path(AbsUsrSrc.Append("setuptools"), true, pkg.NewHTTPGetTar(
|
|
nil, "https://github.com/pypa/setuptools/archive/refs/tags/"+
|
|
"v"+version+".tar.gz",
|
|
mustDecode(checksum),
|
|
pkg.TarGzip,
|
|
)))
|
|
}
|
|
func init() { artifactsF[Setuptools] = Toolchain.newSetuptools }
|
|
|
|
func (t Toolchain) newPygments() pkg.Artifact {
|
|
return t.newViaPip("pygments", "2.19.2", "none", "any",
|
|
"ak_lwTalmSr7W4Mjy2XBZPG9I6a0gwSy2pS87N8x4QEuZYif0ie9z0OcfRfi9msd",
|
|
"https://files.pythonhosted.org/packages/"+
|
|
"c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/")
|
|
}
|
|
func init() { artifactsF[Pygments] = Toolchain.newPygments }
|
|
|
|
func (t Toolchain) newPluggy() pkg.Artifact {
|
|
return t.newViaPip("pluggy", "1.6.0", "none", "any",
|
|
"2HWYBaEwM66-y1hSUcWI1MyE7dVVuNNRW24XD6iJBey4YaUdAK8WeXdtFMQGC-4J",
|
|
"https://files.pythonhosted.org/packages/"+
|
|
"54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/")
|
|
}
|
|
func init() { artifactsF[Pluggy] = Toolchain.newPluggy }
|
|
|
|
func (t Toolchain) newPackaging() pkg.Artifact {
|
|
return t.newViaPip("packaging", "26.0", "none", "any",
|
|
"iVVXcqdwHDskPKoCFUlh2x8J0Gyq-bhO4ns9DvUJ7oJjeOegRYtSIvLV33Bki-pP",
|
|
"https://files.pythonhosted.org/packages/"+
|
|
"b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/")
|
|
}
|
|
func init() { artifactsF[Packaging] = Toolchain.newPackaging }
|
|
|
|
func (t Toolchain) newIniConfig() pkg.Artifact {
|
|
const version = "2.3.0"
|
|
return t.newViaPip("iniconfig", version, "none", "any",
|
|
"SDgs4S5bXi77aVOeKTPv2TUrS3M9rduiK4DpU0hCmDsSBWqnZcWInq9lsx6INxut",
|
|
"https://github.com/pytest-dev/iniconfig/releases/download/"+
|
|
"v"+version+"/")
|
|
}
|
|
func init() { artifactsF[IniConfig] = Toolchain.newIniConfig }
|
|
|
|
func (t Toolchain) newPyTest() pkg.Artifact {
|
|
const version = "9.0.2"
|
|
return t.newViaPip("pytest", version, "none", "any",
|
|
"IM2wDbLke1EtZhF92zvAjUl_Hms1uKDtM7U8Dt4acOaChMnDg1pW7ib8U0wYGDLH",
|
|
"https://github.com/pytest-dev/pytest/releases/download/"+
|
|
version+"/",
|
|
t.Load(IniConfig),
|
|
t.Load(Packaging),
|
|
t.Load(Pluggy),
|
|
t.Load(Pygments),
|
|
)
|
|
}
|
|
func init() { artifactsF[PyTest] = Toolchain.newPyTest }
|