aports/community/incus-feature/0001-statically-build-incus-agent-and-incus-migrate.patch
2024-08-26 12:31:16 +00:00

76 lines
3.1 KiB
Diff

From e7f7065152c07b7e826de413da1c9d0105477b32 Mon Sep 17 00:00:00 2001
From: Leonardo Arena <rnalrd@alpinelinux.org>
Date: Thu, 15 Feb 2024 07:52:46 +0000
Subject: [PATCH] statically build incus-agent and incus-migrate
---
Makefile | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 4cfd3a4..258c47b 100644
--- a/Makefile
+++ b/Makefile
@@ -35,8 +35,8 @@ ifeq "$(TAG_SQLITE3)" ""
endif
CC="$(CC)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" $(GO) install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./...
- CGO_ENABLED=0 $(GO) install -v -tags netgo ./cmd/incus-migrate
- CGO_ENABLED=0 $(GO) install -v -tags agent,netgo ./cmd/incus-agent
+ CGO_ENABLED=0 $(GO) install -v -tags netgo,static -buildmode default ./cmd/incus-migrate
+ CGO_ENABLED=0 $(GO) install -v -tags agent,netgo,static -buildmode default ./cmd/incus-agent
@echo "Incus built successfully"
.PHONY: client
@@ -46,12 +46,12 @@ client:
.PHONY: incus-agent
incus-agent:
- CGO_ENABLED=0 $(GO) install -v -tags agent,netgo ./cmd/incus-agent
+ CGO_ENABLED=0 $(GO) install -v -tags agent,netgo,static -buildmode default ./cmd/incus-agent
@echo "Incus agent built successfully"
.PHONY: incus-migrate
incus-migrate:
- CGO_ENABLED=0 $(GO) install -v -tags netgo ./cmd/incus-migrate
+ CGO_ENABLED=0 $(GO) install -v -tags netgo,static -buildmode default ./cmd/incus-migrate
@echo "Incus migration tool built successfully"
.PHONY: deps
@@ -199,8 +199,8 @@ ifeq "$(TAG_SQLITE3)" ""
endif
CC="$(CC)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" $(GO) install -v -tags "$(TAG_SQLITE3) logdebug" $(DEBUG) ./...
- CGO_ENABLED=0 $(GO) install -v -tags "netgo,logdebug" ./cmd/incus-migrate
- CGO_ENABLED=0 $(GO) install -v -tags "agent,netgo,logdebug" ./cmd/incus-agent
+ CGO_ENABLED=0 $(GO) install -v -tags "netgo,logdebug,static" -buildmode default ./cmd/incus-migrate
+ CGO_ENABLED=0 $(GO) install -v -tags "agent,netgo,logdebug,static" -buildmode default ./cmd/incus-agent
@echo "Incus built successfully"
.PHONY: nocache
@@ -211,8 +211,8 @@ ifeq "$(TAG_SQLITE3)" ""
endif
CC="$(CC)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" $(GO) install -a -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./...
- CGO_ENABLED=0 $(GO) install -a -v -tags netgo ./cmd/incus-migrate
- CGO_ENABLED=0 $(GO) install -a -v -tags agent,netgo ./cmd/incus-agent
+ CGO_ENABLED=0 $(GO) install -a -v -tags netgo,static -buildmode default ./cmd/incus-migrate
+ CGO_ENABLED=0 $(GO) install -a -v -tags agent,netgo,static -buildmode default ./cmd/incus-agent
@echo "Incus built successfully"
race:
@@ -222,8 +222,8 @@ ifeq "$(TAG_SQLITE3)" ""
endif
CC="$(CC)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" $(GO) install -race -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./...
- CGO_ENABLED=0 $(GO) install -v -tags netgo ./cmd/incus-migrate
- CGO_ENABLED=0 $(GO) install -v -tags agent,netgo ./cmd/incus-agent
+ CGO_ENABLED=0 $(GO) install -v -tags netgo,static -buildmode default ./cmd/incus-migrate
+ CGO_ENABLED=0 $(GO) install -v -tags agent,netgo,static -buildmode default ./cmd/incus-agent
@echo "Incus built successfully"
.PHONY: check
--
2.43.1