Skip to content

Instantly share code, notes, and snippets.

@mqus
Created November 14, 2024 10:09
Show Gist options
  • Save mqus/b1a48f0af2c5a22fa7ae51b143f566d9 to your computer and use it in GitHub Desktop.
Save mqus/b1a48f0af2c5a22fa7ae51b143f566d9 to your computer and use it in GitHub Desktop.
commit 93bff389c20b682d5f564bf7da9150525b032b6e
Author: Mqus <mqus@disroot.org>
Date: Thu Nov 14 10:55:21 2024 +0100
Fix registry (bandaid)
diff --git a/PKGBUILD b/PKGBUILD
index 56739a5..35e9c39 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,60 @@
pkgname=distribution
-pkgver=2.8.2git # fails to build from tag
-pkgrel=2
+pkgver=2.8.3
+pkgrel=1
pkgdesc="the Open Source Registry implementation for storing and distributing container images using the OCI Distribution Specification"
arch=(x86_64)
-url="https://github.com/distribution/distribution/"
+url="https://github.com/distribution/distribution"
license=('GPL')
depends=()
-makedepends=('go' 'git')
-#source=("git+https://github.com/distribution/distribution.git#tag=v$pkgver")
-source=("git+https://github.com/distribution/distribution.git"
+makedepends=('go')
+source=("https://github.com/distribution/$pkgname/archive/v$pkgver.tar.gz"
registry.sysuser
registry.service
registry.tmpfiles
config.yml.example)
-sha256sums=('SKIP'
+sha256sums=('c44841796ff59d8b4d62c7f86b58a0fb8f6e60b887a974758cc90079dca628ba'
'8f967e91e3a952628378ff71aeeace48f5d29883a7a0eec26d0ab1485c354b07'
'24793414a56feca9c9d908018652da1ddf19e91d6ed10ac9a0900daf2a5688cf'
'6dea38e5e572c54c8474670c69bcc61c70d8213d063a0767083b82ccec4d7064'
'c8755adfcc2ae168947b1e60a404dee725a84185b5363d505303fb289c9d16fa')
prepare() {
- cd "$pkgname"
-# go mod init "github.com/distribution/distribution"
-# go mod vendor
+ cd "$pkgname-$pkgver"
+ go mod init "${url#https://}"
+
+ cat >>go.mod <<EOF
+require(
+ google.golang.org/cloud v0.34.0
+ github.com/bshuster-repo/logrus-logstash-hook v0.4.1
+ github.com/xenolf/lego a9d8cec0e6563575e5868a005359ac97911b5985
+ github.com/miekg/dns e6b37d00af93859083acc03b13c210ec491190e1
+)
+replace rsc.io/letsencrypt => github.com/dmcgowan/letsencrypt update-acme-tls-sni-challenge
+EOF
+ go mod tidy
}
build() {
- cd "$pkgname"
- make
+ cd "$pkgname-$pkgver"
+ VERSION=$pkgver-arch
+ REVISION=v$pkgver
+ PKG=github.com/docker/distribution
+
+ for cmd in digest registry registry-api-descriptor-template; do
+ echo + go build ./cmd/$cmd/
+ go build -o bin/$cmd \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -gcflags "all=-trimpath=${PWD}" \
+ -ldflags "-s -w -X $PKG/version.Version=$VERSION -X $PKG/version.Revision=$REVISION -X $PKG/version.Package=$PKG -linkmode external -extldflags \"${LDFLAGS}\"" \
+ ./cmd/$cmd/
+ done
}
package() {
- cd "$pkgname"
+ cd "$pkgname-$pkgver"
install -Dm0755 bin/digest "$pkgdir"/usr/bin/digest
install -Dm0755 bin/registry "$pkgdir"/usr/bin/registry
install -Dm0755 bin/registry-api-descriptor-template "$pkgdir"/usr/bin/registry-api-descriptor-template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment