From 03ff25d3da98fb0188b288b09617d9db130dd247 Mon Sep 17 00:00:00 2001 From: madomado Date: Sun, 11 Aug 2024 21:31:02 +0800 Subject: [PATCH] add: libbacktrace (#1872) --- anda/lib/backtrace/anda.hcl | 8 +++ anda/lib/backtrace/libbacktrace-nightly.spec | 69 ++++++++++++++++++++ anda/lib/backtrace/update.rhai | 5 ++ 3 files changed, 82 insertions(+) create mode 100644 anda/lib/backtrace/anda.hcl create mode 100644 anda/lib/backtrace/libbacktrace-nightly.spec create mode 100644 anda/lib/backtrace/update.rhai diff --git a/anda/lib/backtrace/anda.hcl b/anda/lib/backtrace/anda.hcl new file mode 100644 index 0000000000..083725f9bc --- /dev/null +++ b/anda/lib/backtrace/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "libbacktrace-nightly.spec" + } + labels { + nightly = 1 + } +} diff --git a/anda/lib/backtrace/libbacktrace-nightly.spec b/anda/lib/backtrace/libbacktrace-nightly.spec new file mode 100644 index 0000000000..acb83704a6 --- /dev/null +++ b/anda/lib/backtrace/libbacktrace-nightly.spec @@ -0,0 +1,69 @@ +%global debug_package %nil + +%global commit 86885d14049fab06ef8a33aac51664230ca09200 +%global shortcommit %(c=%commit; echo ${c:0:7}) +%global commit_date 20240806 + +%global _desc %{expand: +A C library that may be linked into a C/C++ program to produce symbolic backtraces. +} + +Name: libbacktrace-nightly +Version: 1.0^%commit_date.%shortcommit +Release: 1%?dist +Summary: Library to produce symbolic backtraces +License: BSD-3-Clause +URL: https://github.com/ianlancetaylor/libbacktrace +Source0: %url/archive/%commit.tar.gz +Packager: madonuko +BuildRequires: gcc make +BuildRequires: automake +BuildRequires: libtool +BuildRequires: pkgconfig(liblzma) +BuildRequires: pkgconfig(libunwind) +BuildRequires: pkgconfig(libzstd) +BuildRequires: pkgconfig(zlib) + +%description %_desc + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel %_desc +This package contains the development files for the %name package. + +%prep +%autosetup -n libbacktrace-%commit + +%build +autoreconf -fiv +%configure \ + --disable-static \ + --enable-shared \ + --with-system-libunwind \ + --enable-silent-rules +%make_build + +%check +# btest_dwz fails +%make_build check ||: + +%install +%make_install + +find %{buildroot} -type f -name "*.la" -delete -print + +%files +%doc README.md +%license LICENSE +%_includedir/backtrace-supported.h +%_includedir/backtrace.h +%_libdir/libbacktrace.so + +%files devel +%_libdir/libbacktrace.so.* + +%changelog +* Sat Aug 10 2024 madonuko +- Initial package diff --git a/anda/lib/backtrace/update.rhai b/anda/lib/backtrace/update.rhai new file mode 100644 index 0000000000..46dfb93063 --- /dev/null +++ b/anda/lib/backtrace/update.rhai @@ -0,0 +1,5 @@ +rpm.global("commit", gh_commit("ianlancetaylor/libbacktrace")); +if rpm.changed() { + rpm.global("commit_date", date()); + rpm.release(); +}