forked from rosa/hakurei
Compare commits
4 Commits
b081629662
...
992139c75d
| Author | SHA1 | Date | |
|---|---|---|---|
|
992139c75d
|
|||
|
57c69b533e
|
|||
|
6f0c2a80f2
|
|||
|
08dfefb28d
|
@@ -10,26 +10,15 @@ import (
|
||||
func (t Toolchain) newMeson() (pkg.Artifact, string) {
|
||||
const (
|
||||
version = "1.11.0"
|
||||
checksum = "b7oo3U_cklhzsTfsyYsjPGyeEufiS-Pm06JPLzodseS125Ach62ZBly7R6dSDiAc"
|
||||
checksum = "QJolMPzypTiS65GReSNPPlkUjHI6b1EDpZ-avIk3n6b6TQ93KfUM57DVUpY97Hf7"
|
||||
)
|
||||
return t.New("meson-"+version, 0, []pkg.Artifact{
|
||||
t.Load(Zlib),
|
||||
t.Load(Python),
|
||||
t.Load(Setuptools),
|
||||
}, nil, nil, `
|
||||
cd /usr/src/meson
|
||||
chmod -R +w meson.egg-info
|
||||
python3 setup.py \
|
||||
install \
|
||||
--prefix=/system \
|
||||
--root=/work
|
||||
`, pkg.Path(AbsUsrSrc.Append("meson"), true, newFromGitHubRelease(
|
||||
return t.NewPackage("meson", version, newFromGitHub(
|
||||
"mesonbuild/meson",
|
||||
version,
|
||||
"meson-"+version+".tar.gz",
|
||||
checksum,
|
||||
pkg.TarGzip,
|
||||
))), version
|
||||
), nil, (*PipHelper)(nil),
|
||||
Setuptools,
|
||||
), version
|
||||
}
|
||||
func init() {
|
||||
artifactsM[Meson] = Metadata{
|
||||
|
||||
@@ -81,6 +81,62 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
// PipHelper is the [Python] pip packaging helper.
|
||||
type PipHelper struct {
|
||||
// Whether to omit --no-build-isolation.
|
||||
BuildIsolation bool
|
||||
// Whether to enter source after install.
|
||||
EnterSource bool
|
||||
// Runs after install.
|
||||
Script string
|
||||
}
|
||||
|
||||
var _ Helper = new(PipHelper)
|
||||
|
||||
// extra returns python.
|
||||
func (*PipHelper) extra(int) P { return P{Python} }
|
||||
|
||||
// wantsChmod returns true.
|
||||
func (*PipHelper) wantsChmod() bool { return true }
|
||||
|
||||
// wantsWrite is equivalent to wantsChmod.
|
||||
func (attr *PipHelper) wantsWrite() bool { return attr.wantsChmod() }
|
||||
|
||||
// scriptEarly is a noop.
|
||||
func (*PipHelper) scriptEarly() string { return "" }
|
||||
|
||||
// createDir returns false.
|
||||
func (*PipHelper) createDir() bool { return false }
|
||||
|
||||
// wantsDir requests a new directory in TMPDIR.
|
||||
func (*PipHelper) wantsDir() string { return `"$(mktemp -d)"` }
|
||||
|
||||
// script generates the pip3 install command.
|
||||
func (attr *PipHelper) script(name string) string {
|
||||
if attr == nil {
|
||||
attr = new(PipHelper)
|
||||
}
|
||||
|
||||
var extra string
|
||||
if !attr.BuildIsolation {
|
||||
extra += `
|
||||
--no-build-isolation \`
|
||||
}
|
||||
|
||||
script := attr.Script
|
||||
if attr.EnterSource {
|
||||
script = "cd '/usr/src/" + name + "'\n" + script
|
||||
}
|
||||
|
||||
return `
|
||||
pip3 install \
|
||||
--no-index \
|
||||
--prefix=/system \
|
||||
--root=/work \` + extra + `
|
||||
'/usr/src/` + name + `'
|
||||
` + script
|
||||
}
|
||||
|
||||
// newViaPip installs a pip wheel from a url.
|
||||
func (t Toolchain) newViaPip(
|
||||
name, version, url, checksum string,
|
||||
@@ -134,18 +190,12 @@ func (t Toolchain) newSetuptools() (pkg.Artifact, string) {
|
||||
version = "82.0.1"
|
||||
checksum = "nznP46Tj539yqswtOrIM4nQgwLA1h-ApKX7z7ghazROCpyF5swtQGwsZoI93wkhc"
|
||||
)
|
||||
return t.New("setuptools-"+version, 0, t.AppendPresets(nil,
|
||||
Python,
|
||||
), nil, nil, `
|
||||
pip3 install \
|
||||
--no-index \
|
||||
--prefix=/system \
|
||||
--root=/work \
|
||||
/usr/src/setuptools
|
||||
`, pkg.Path(AbsUsrSrc.Append("setuptools"), true, newFromGitHub(
|
||||
return t.NewPackage("setuptools", version, newFromGitHub(
|
||||
"pypa/setuptools",
|
||||
"v"+version, checksum,
|
||||
))), version
|
||||
), nil, &PipHelper{
|
||||
BuildIsolation: true,
|
||||
}), version
|
||||
}
|
||||
func init() {
|
||||
artifactsM[Setuptools] = Metadata{
|
||||
|
||||
Reference in New Issue
Block a user