From 39d571d1f4a6f36b4f869976b9f26d4cf8f93f1c Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Wed, 23 Jun 2021 13:30:12 +0200 Subject: [PATCH 1/4] git-lfs: add version 2.13.3 - binary only - generating docs is a pain, so we skip that - well unless you like to run ronn-ng via ruby gems etc --- git-lfs.be0 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 git-lfs.be0 diff --git a/git-lfs.be0 b/git-lfs.be0 new file mode 100755 index 000000000..7bbbe68d8 --- /dev/null +++ b/git-lfs.be0 @@ -0,0 +1,44 @@ +#!/usr/bin/env beesh + +# BEE_VERSION git_lfs-2.13.3-0 + +# bee download https://github.com/git-lfs/git-lfs.git -c v2.13.3 + +SRCURL[0]="https://beehive.molgen.mpg.de/b944aa4b83b270adebd97d0f4e7b84e7/git-lfs-2.13.3_p0_a5e65851.tar.bz2" + +BEE_BUILDTYPE= +export GOPATH=${B}/bee_go +export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw" + +# PATCHURL+=() + +# build_in_sourcedir + +# sourcesubdir_append src + +mee_getsources() { + bee_getsources + # go get golang.org/x/tools/cmd/goimports +} + +#mee_patch() { +# bee_patch "${@}" +#} + +#mee_configure() { +# bee_configure +#} + +mee_build() { + mkdir -p ${D}/usr/bin + go build -o ${D}/usr/bin/git-lfs +} + +mee_install() { +# bee_install + : +} + +#mee_install_post() { +# exit +#} From dc7312ccd5392c1139bc61d821f476528e192441 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 2 Sep 2026 15:19:46 +0200 Subject: [PATCH 2/4] git-lfs: Update version from 2.13.3 to 3.8.0 https://github.com/git-lfs/git-lfs/blob/v3.8.0/CHANGELOG.md Switch the source from a `bee download` snapshot of the git repository to the upstream `git-lfs-vendor` release tarball: it is the release tarball plus `vendor/`, so `go build` needs no module downloads. Accordingly GOFLAGS uses `-mod=vendor` instead of `-mod=readonly`. The vendored modules are sources, not prebuilt objects: 783 *.go files, 41 *.s files and one *.c file, and no *.a, *.o, *.so or *.syso anywhere. Only two files are not detected as text, and neither is code: vendor/golang.org/x/net/publicsuffix/data/{nodes,children} (55 KB), the lookup tables of Mozilla's Public Suffix List that table.go pulls in with go:embed, and vendor/github.com/klauspost/compress/s2sx.sum, which is empty. Removing vendor/ and running `go mod vendor` re-downloads every module, verifies it against go.sum and reproduces the directory bit for bit. Still binary only, no man pages: generating them needs asciidoctor. Built with go 1.25.3, `git-lfs version` reports git-lfs/3.8.0 (GitHub; linux amd64; go 1.25.3). Assisted-by: claude-opus-5 --- git-lfs.be0 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/git-lfs.be0 b/git-lfs.be0 index 7bbbe68d8..e1b32189c 100755 --- a/git-lfs.be0 +++ b/git-lfs.be0 @@ -1,14 +1,16 @@ #!/usr/bin/env beesh -# BEE_VERSION git_lfs-2.13.3-0 +# BEE_VERSION git_lfs-3.8.0-0 -# bee download https://github.com/git-lfs/git-lfs.git -c v2.13.3 +# the vendor tarball is the release tarball plus vendor/, so no module +# downloads are needed at build time +# SRCURL[0]="https://github.com/git-lfs/git-lfs/releases/download/v${PKGVERSION}/git-lfs-vendor-v${PKGVERSION}.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/b944aa4b83b270adebd97d0f4e7b84e7/git-lfs-2.13.3_p0_a5e65851.tar.bz2" +SRCURL[0]="https://beehive.molgen.mpg.de/fba8df374fa297d343b29919f0d5a6bd/git-lfs-vendor-v3.8.0.tar.gz" BEE_BUILDTYPE= export GOPATH=${B}/bee_go -export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw" +export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=vendor -modcacherw" # PATCHURL+=() From e6b57d9fe38e3ecef5ad3ef8129d2c5cabcee380 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 2 Sep 2026 15:19:58 +0200 Subject: [PATCH 3/4] git-lfs: Pass the module directory to `go build` with -C go(1) wants the module directory as its working directory, so pass it with `go build -C ${S}` instead of relying on the working directory. bee's `make` buildtype magic sets `build_in_sourcedir` on its own as soon as a `Makefile` exists, so `${B}` is a symlink to `${S}` either way, but the recipe no longer depends on that. Assisted-by: claude-opus-5 --- git-lfs.be0 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-lfs.be0 b/git-lfs.be0 index e1b32189c..ba037649a 100755 --- a/git-lfs.be0 +++ b/git-lfs.be0 @@ -33,7 +33,9 @@ mee_getsources() { mee_build() { mkdir -p ${D}/usr/bin - go build -o ${D}/usr/bin/git-lfs + # go(1) wants the module directory as its working directory, so pass it + # with -C instead of relying on the current one + go build -C ${S} -o ${D}/usr/bin/git-lfs } mee_install() { From bbd7c0ab8a0c8368694b03458959c2053c01466c Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 2 Sep 2026 15:20:26 +0200 Subject: [PATCH 4/4] git-lfs: Put the go build cache into bee's build archive bee's build archive is supposed to hold everything belonging to a build, and it is created by tarring up ${S} and ${B}. go(1) however writes neither into ${B}: its build artifacts go into the build cache, which defaults to ~/.cache/go-build, and the linked binary went straight into the image directory ${D}. So point GOCACHE below ${B} and build the binary into ${B}, from where mee_install() copies it into ${D}. The build archive grows from 6.3 MB to 49 MB, holding 2416 build cache entries and the binary in addition to the sources, and the build cache is no longer shared between builds, so every build compiles all packages again (21 s for git-lfs here). Note that bee's `make` buildtype magic sets build_in_sourcedir() as soon as a Makefile exists, so ${B} is a symlink to ${S} and both end up in ${S} in practice. That is of no consequence for the package, as only ${D} is packaged. Assisted-by: claude-opus-5 --- git-lfs.be0 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/git-lfs.be0 b/git-lfs.be0 index ba037649a..4644806cb 100755 --- a/git-lfs.be0 +++ b/git-lfs.be0 @@ -10,6 +10,9 @@ SRCURL[0]="https://beehive.molgen.mpg.de/fba8df374fa297d343b29919f0d5a6bd/git-lf BEE_BUILDTYPE= export GOPATH=${B}/bee_go +# go(1) puts its build artifacts into the build cache, so point that below ${B} +# to get it into bee's build archive +export GOCACHE=${B}/bee_gocache export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=vendor -modcacherw" # PATCHURL+=() @@ -32,15 +35,14 @@ mee_getsources() { #} mee_build() { - mkdir -p ${D}/usr/bin # go(1) wants the module directory as its working directory, so pass it # with -C instead of relying on the current one - go build -C ${S} -o ${D}/usr/bin/git-lfs + go build -C ${S} -o ${B}/git-lfs } mee_install() { -# bee_install - : + mkdir -p ${D}/usr/bin + cp ${B}/git-lfs ${D}/usr/bin/git-lfs } #mee_install_post() {