From 71ade1fdce8f05edfcbf8f17c09f7ba50e76faec Mon Sep 17 00:00:00 2001 From: yyjeqhc Date: Sun, 29 Jun 2025 12:51:57 +0800 Subject: [PATCH] riscv: enable cgo by patch the .promu.yml (cherry picked from commit 50a072a72dbf1fa96a13ac7b5bb1725a8163f4d6) --- 0001-riscv-set-cgo.patch | 13 +++++++++++++ alertmanager.spec | 12 +++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 0001-riscv-set-cgo.patch diff --git a/0001-riscv-set-cgo.patch b/0001-riscv-set-cgo.patch new file mode 100644 index 0000000..75286f8 --- /dev/null +++ b/0001-riscv-set-cgo.patch @@ -0,0 +1,13 @@ +diff --git a/.promu.yml b/.promu.yml +index 628c8a9..5d803bc 100644 +--- a/.promu.yml ++++ b/.promu.yml +@@ -2,6 +2,7 @@ go: + # Whenever the Go version is updated here, + # .circle/config.yml should also be updated. + version: 1.21 ++ cgo: true + repository: + path: github.com/prometheus/alertmanager + build: + diff --git a/alertmanager.spec b/alertmanager.spec index caffd4e..01d2b9d 100644 --- a/alertmanager.spec +++ b/alertmanager.spec @@ -2,7 +2,7 @@ Name: alertmanager Version: 0.27.0 -Release: 1 +Release: 2 Summary: Prometheus Alertmanager. License: Apache-2.0 URL: https://github.com/prometheus/%{name} @@ -12,6 +12,7 @@ Source1: %{name}.service Source2: %{name}.default Source3: %{name}.yml Source4: %{name}-vendor.tar.gz +Patch0: 0001-riscv-set-cgo.patch BuildRequires: make BuildRequires: golang >= 1.18.0 @@ -29,6 +30,12 @@ takes care of silencing and inhibition of alerts. %prep %setup -q -n %{name}-%{version} + +#now,the patch is only for riscv +%ifarch riscv64 +%patch 0 -p1 +%endif + tar -xzvf %{SOURCE4} %build @@ -74,6 +81,9 @@ exit 0 %dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus %changelog +* Sun Jun 29 2025 yyjeqhc - 0.27.0-2 +- Riscv64: enable cgo for buildmode=pie by patch the .promu.yml + * Fri Jul 12 2024 jiangxinyu - 0.27.0-1 - Update package to version 0.27.0 - Microsoft Teams Integration: Introduced support for webhook_url_file -- Gitee