2022-12-24 12:42:30 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2020-12-20 07:11:26 +01:00
|
|
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2022-12-24 12:42:30 +01:00
|
|
|
, unstableGitUpdater
|
2022-12-24 20:46:00 +01:00
|
|
|
, autoreconfHook
|
2020-12-20 07:11:26 +01:00
|
|
|
}:
|
2022-12-24 12:42:30 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-10-28 12:55:22 +01:00
|
|
|
pname = "libbacktrace";
|
2024-03-02 22:39:38 +01:00
|
|
|
version = "0-unstable-2024-03-02";
|
2022-12-24 12:42:30 +01:00
|
|
|
|
2019-10-28 12:55:22 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ianlancetaylor";
|
2022-12-24 12:42:30 +01:00
|
|
|
repo = "libbacktrace";
|
2024-03-02 22:39:38 +01:00
|
|
|
rev = "28824f2cc9069e3fdc39d3702acdf753e35c41b4";
|
|
|
|
sha256 = "1k1O1GT22hZAWPF8NYP0y4qe+e3pGfzT9Mz2TH+H/v4=";
|
2019-10-28 12:55:22 +01:00
|
|
|
};
|
2022-12-24 12:42:30 +01:00
|
|
|
|
2022-12-24 20:46:00 +01:00
|
|
|
patches = [
|
|
|
|
# Fix tests with shared library.
|
|
|
|
# https://github.com/ianlancetaylor/libbacktrace/pull/99
|
|
|
|
./0001-libbacktrace-avoid-libtool-wrapping-tests.patch
|
2022-12-24 20:35:01 +01:00
|
|
|
|
|
|
|
# Support multiple debug dirs.
|
|
|
|
# https://github.com/ianlancetaylor/libbacktrace/pull/100
|
|
|
|
./0002-libbacktrace-Allow-configuring-debug-dir.patch
|
|
|
|
./0003-libbacktrace-Support-multiple-build-id-directories.patch
|
|
|
|
|
|
|
|
# Support NIX_DEBUG_INFO_DIRS environment variable.
|
|
|
|
./0004-libbacktrace-Support-NIX_DEBUG_INFO_DIRS-environment.patch
|
2022-12-24 20:46:00 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
];
|
|
|
|
|
2019-10-28 12:55:22 +01:00
|
|
|
configureFlags = [
|
2022-12-24 12:42:30 +01:00
|
|
|
(lib.enableFeature enableStatic "static")
|
|
|
|
(lib.enableFeature enableShared "shared")
|
2019-10-28 12:55:22 +01:00
|
|
|
];
|
2022-12-24 12:42:30 +01:00
|
|
|
|
2023-11-29 02:16:07 +01:00
|
|
|
doCheck = stdenv.isLinux && !stdenv.hostPlatform.isMusl;
|
2022-12-24 20:46:00 +01:00
|
|
|
|
2022-12-24 12:42:30 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = unstableGitUpdater { };
|
|
|
|
};
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2019-10-28 12:55:22 +01:00
|
|
|
description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces";
|
2021-11-10 11:37:56 +01:00
|
|
|
homepage = "https://github.com/ianlancetaylor/libbacktrace";
|
2019-10-28 12:55:22 +01:00
|
|
|
maintainers = with maintainers; [ twey ];
|
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
};
|
|
|
|
}
|