forked from rosa/hakurei
internal/rosa: use type P in helper interface
This is easier to type and serialises correctly. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -144,11 +144,11 @@ func (attr *CMakeHelper) name(name, version string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// extra returns a hardcoded slice of [CMake] and [Ninja].
|
// extra returns a hardcoded slice of [CMake] and [Ninja].
|
||||||
func (attr *CMakeHelper) extra(int) []PArtifact {
|
func (attr *CMakeHelper) extra(int) P {
|
||||||
if attr != nil && attr.Make {
|
if attr != nil && attr.Make {
|
||||||
return []PArtifact{CMake, Make}
|
return P{CMake, Make}
|
||||||
}
|
}
|
||||||
return []PArtifact{CMake, Ninja}
|
return P{CMake, Ninja}
|
||||||
}
|
}
|
||||||
|
|
||||||
// wantsChmod returns false.
|
// wantsChmod returns false.
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func init() {
|
|||||||
Description: "a message bus system",
|
Description: "a message bus system",
|
||||||
Website: "https://www.freedesktop.org/wiki/Software/dbus/",
|
Website: "https://www.freedesktop.org/wiki/Software/dbus/",
|
||||||
|
|
||||||
Dependencies: []PArtifact{
|
Dependencies: P{
|
||||||
GLib,
|
GLib,
|
||||||
Libexpat,
|
Libexpat,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ func (*MakeHelper) name(name, version string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// extra returns make and other optional dependencies.
|
// extra returns make and other optional dependencies.
|
||||||
func (attr *MakeHelper) extra(flag int) []PArtifact {
|
func (attr *MakeHelper) extra(flag int) P {
|
||||||
extra := []PArtifact{Make}
|
extra := P{Make}
|
||||||
if (attr == nil || !attr.OmitDefaults) && flag&TEarly == 0 {
|
if (attr == nil || !attr.OmitDefaults) && flag&TEarly == 0 {
|
||||||
extra = append(extra,
|
extra = append(extra,
|
||||||
Gawk,
|
Gawk,
|
||||||
|
|||||||
@@ -72,9 +72,7 @@ func (*MesonHelper) name(name, version string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// extra returns hardcoded meson runtime dependencies.
|
// extra returns hardcoded meson runtime dependencies.
|
||||||
func (*MesonHelper) extra(int) []PArtifact {
|
func (*MesonHelper) extra(int) P { return P{Meson} }
|
||||||
return []PArtifact{Meson}
|
|
||||||
}
|
|
||||||
|
|
||||||
// wantsChmod returns false.
|
// wantsChmod returns false.
|
||||||
func (*MesonHelper) wantsChmod() bool { return false }
|
func (*MesonHelper) wantsChmod() bool { return false }
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ func (t Toolchain) newViaPerlMakeMaker(
|
|||||||
{"PREFIX", "/system"},
|
{"PREFIX", "/system"},
|
||||||
},
|
},
|
||||||
Check: []string{"test"},
|
Check: []string{"test"},
|
||||||
}, slices.Concat(extra, []PArtifact{
|
}, slices.Concat(extra, P{
|
||||||
Perl,
|
Perl,
|
||||||
})...)
|
})...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ type Helper interface {
|
|||||||
// name returns the value passed to the name argument of [Toolchain.New].
|
// name returns the value passed to the name argument of [Toolchain.New].
|
||||||
name(name, version string) string
|
name(name, version string) string
|
||||||
// extra returns helper-specific dependencies.
|
// extra returns helper-specific dependencies.
|
||||||
extra(flag int) []PArtifact
|
extra(flag int) P
|
||||||
|
|
||||||
// wantsChmod returns whether the source directory should be made writable.
|
// wantsChmod returns whether the source directory should be made writable.
|
||||||
wantsChmod() bool
|
wantsChmod() bool
|
||||||
|
|||||||
Reference in New Issue
Block a user