internal/rosa/package: migrate git
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m47s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m34s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Flake checks (push) Successful in 1m20s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-19 22:37:05 +09:00
parent 1c6f30379e
commit 608d8303ec
3 changed files with 96 additions and 98 deletions

View File

@@ -7,101 +7,8 @@ import (
"hakurei.app/internal/pkg"
)
func (t Toolchain) newGit() (pkg.Artifact, string) {
const (
version = "2.54.0"
checksum = "7vGKtFOJGqY8DO4e8UMRax7dLgImXKQz5MMalec6MlgYrsarffSJjgOughwRFpSH"
)
return t.NewPackage("git", version, newTar(
"https://www.kernel.org/pub/software/scm/git/"+
"git-"+version+".tar.gz",
checksum,
pkg.TarGzip,
), &PackageAttr{
ScriptEarly: `
ln -s ../../system/bin/perl /usr/bin/ || true
# test suite assumes apache
rm -f /system/bin/httpd
`,
// uses source tree as scratch space
EnterSource: true,
}, &MakeHelper{
InPlace: true,
Generate: "make configure",
ScriptMakeEarly: `
function disable_test {
local test=$1 pattern=${2:-''}
if [ $# -eq 1 ]; then
rm "t/${test}.sh"
else
sed -i "t/${test}.sh" \
-e "/^\s*test_expect_.*$pattern/,/^\s*' *\$/{s/^/: #/}"
fi
}
disable_test t1800-hook
disable_test t5319-multi-pack-index
disable_test t1305-config-include
disable_test t3900-i18n-commit
disable_test t3507-cherry-pick-conflict
disable_test t4201-shortlog
disable_test t5303-pack-corruption-resilience
disable_test t4301-merge-tree-write-tree
disable_test t8005-blame-i18n
disable_test t9350-fast-export
disable_test t9300-fast-import
disable_test t0211-trace2-perf
disable_test t1517-outside-repo
disable_test t2200-add-update
disable_test t0027-auto-crlf
disable_test t7513-interpret-trailers
disable_test t7703-repack-geometric
disable_test t7002-mv-sparse-checkout
disable_test t1451-fsck-buffer
disable_test t4104-apply-boundary
disable_test t4200-rerere
disable_test t5515-fetch-merge-logic
`,
Check: []string{
"-C t",
`GIT_PROVE_OPTS="--jobs 32 --failures"`,
"prove",
},
Install: `make \
` + jobsFlagE + ` \
DESTDIR=/work \
NO_INSTALL_HARDLINKS=1 \
install`,
},
// test suite hangs on mksh
Bash,
Diffutils,
Autoconf,
Gettext,
Zlib,
Curl,
Libexpat,
), version
}
func init() {
native.mustRegister(Toolchain.newGit, &Metadata{
Name: "git",
Description: "distributed version control system",
Website: "https://www.git-scm.com/",
Dependencies: P{
Zlib,
Curl,
Libexpat,
},
ID: 5350,
})
}
// Git is the package used by [Toolchain.NewViaGit].
var Git = H("git")
// NewViaGit returns a [pkg.Artifact] for cloning a git repository.
func (t Toolchain) NewViaGit(

View File

@@ -0,0 +1,94 @@
package git {
description = "distributed version control system";
website = "https://www.git-scm.com";
anitya = 5350;
version* = "2.54.0";
source = remoteTar {
url = "https://www.kernel.org/pub/software/scm/git/"+
"git-"+version+".tar.gz";
checksum = "7vGKtFOJGqY8DO4e8UMRax7dLgImXKQz5MMalec6MlgYrsarffSJjgOughwRFpSH";
compress = gzip;
};
early = `
ln -s ../../system/bin/perl /usr/bin/ || true
# test suite assumes apache
rm -f /system/bin/httpd
`;
// uses source tree as scratch space
enterSource = true;
exec = make {
inPlace = true;
generate = "make configure";
preMake = `
function disable_test {
local test=$1 pattern=${2:-''}
if [ $# -eq 1 ]; then
rm "t/${test}.sh"
else
sed -i "t/${test}.sh" \
-e "/^\s*test_expect_.*$pattern/,/^\s*' *\$/{s/^/: #/}"
fi
}
disable_test t1800-hook
disable_test t5319-multi-pack-index
disable_test t1305-config-include
disable_test t3900-i18n-commit
disable_test t3507-cherry-pick-conflict
disable_test t4201-shortlog
disable_test t5303-pack-corruption-resilience
disable_test t4301-merge-tree-write-tree
disable_test t8005-blame-i18n
disable_test t9350-fast-export
disable_test t9300-fast-import
disable_test t0211-trace2-perf
disable_test t1517-outside-repo
disable_test t2200-add-update
disable_test t0027-auto-crlf
disable_test t7513-interpret-trailers
disable_test t7703-repack-geometric
disable_test t7002-mv-sparse-checkout
disable_test t1451-fsck-buffer
disable_test t4104-apply-boundary
disable_test t4200-rerere
disable_test t5515-fetch-merge-logic
`;
check = [
"-C t",
`GIT_PROVE_OPTS="--jobs 32 --failures"`,
"prove",
];
install = `make \
` + jobsFlagE + ` \
DESTDIR=/work \
NO_INSTALL_HARDLINKS=1 \
install`;
};
inputs = [
// test suite hangs on mksh
bash,
diffutils,
autoconf,
gettext,
zlib,
curl,
libexpat,
];
runtime = [
zlib,
curl,
libexpat,
];
}

View File

@@ -8,14 +8,12 @@ var (
Firmware = H("firmware")
ACL = H("acl")
ArgpStandalone = H("argp-standalone")
Autoconf = H("autoconf")
Automake = H("automake")
Bash = H("bash")
Binutils = H("binutils")
Bison = H("bison")
Bzip2 = H("bzip2")
Coreutils = H("coreutils")
Curl = H("curl")
DBus = H("dbus")
DTC = H("dtc")
Diffutils = H("diffutils")
@@ -30,7 +28,6 @@ var (
Gawk = H("gawk")
GenInitCPIO = H("gen_init_cpio")
Gettext = H("gettext")
Git = H("git")
Glslang = H("glslang")
Go = H("go")
Gperf = H("gperf")