forked from security/hakurei
This is stage0 relative to Rosa OS, and stage3 relative to the toolchain it is compiled on (Gentoo in this case). Referring to the toolchain itself as stage3 is counterintuitive and misleading. Signed-off-by: Ophestra <cat@gensokyo.uk>
37 lines
973 B
Go
37 lines
973 B
Go
package rosa
|
|
|
|
import "hakurei.app/internal/pkg"
|
|
|
|
func (t Toolchain) newMksh() pkg.Artifact {
|
|
const (
|
|
version = "59c"
|
|
checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq"
|
|
)
|
|
return t.New("mksh-"+version, 0, stage0Concat(t, []pkg.Artifact{},
|
|
t.Load(Perl),
|
|
t.Load(Coreutils),
|
|
), nil, []string{
|
|
"LDSTATIC=-static",
|
|
"CPPFLAGS=-DMKSH_DEFAULT_PROFILEDIR=\\\"/system/etc\\\"",
|
|
}, `
|
|
cd "$(mktemp -d)"
|
|
sh /usr/src/mksh/Build.sh -r
|
|
CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
|
|
sh /usr/src/mksh/Build.sh -r -L
|
|
./test.sh -C regress:no-ctty
|
|
|
|
mkdir -p /work/system/bin/
|
|
cp -v mksh /work/system/bin/
|
|
cp -v lksh /work/system/bin/sh
|
|
|
|
mkdir -p /work/bin/
|
|
ln -vs ../system/bin/sh /work/bin/
|
|
`, pkg.Path(AbsUsrSrc.Append("mksh"), false, pkg.NewHTTPGetTar(
|
|
nil,
|
|
"https://mbsd.evolvis.org/MirOS/dist/mir/mksh/mksh-R"+version+".tgz",
|
|
mustDecode(checksum),
|
|
pkg.TarGzip,
|
|
)))
|
|
}
|
|
func init() { artifactsF[Mksh] = Toolchain.newMksh }
|