btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / li / libbacktrace / package.nix
blob60c7ede0993fb6cdd93d3498a32bc8208d4ccad6
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , enableStatic ? stdenv.hostPlatform.isStatic
5 , enableShared ? !stdenv.hostPlatform.isStatic
6 , unstableGitUpdater
7 , autoreconfHook
8 }:
10 stdenv.mkDerivation {
11   pname = "libbacktrace";
12   version = "0-unstable-2024-03-02";
14   src = fetchFromGitHub {
15     owner = "ianlancetaylor";
16     repo = "libbacktrace";
17     rev = "28824f2cc9069e3fdc39d3702acdf753e35c41b4";
18     sha256 = "1k1O1GT22hZAWPF8NYP0y4qe+e3pGfzT9Mz2TH+H/v4=";
19   };
21   patches = [
22     # Fix tests with shared library.
23     # https://github.com/ianlancetaylor/libbacktrace/pull/99
24     ./0001-libbacktrace-avoid-libtool-wrapping-tests.patch
26     # Support multiple debug dirs.
27     # https://github.com/ianlancetaylor/libbacktrace/pull/100
28     ./0002-libbacktrace-Allow-configuring-debug-dir.patch
29     ./0003-libbacktrace-Support-multiple-build-id-directories.patch
31     # Support NIX_DEBUG_INFO_DIRS environment variable.
32     ./0004-libbacktrace-Support-NIX_DEBUG_INFO_DIRS-environment.patch
33   ];
35   nativeBuildInputs = [
36     autoreconfHook
37   ];
39   configureFlags = [
40     (lib.enableFeature enableStatic "static")
41     (lib.enableFeature enableShared "shared")
42   ];
44   doCheck = stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl;
46   passthru = {
47     updateScript = unstableGitUpdater { };
48   };
50   meta = with lib; {
51     description = "C library that may be linked into a C/C++ program to produce symbolic backtraces";
52     homepage = "https://github.com/ianlancetaylor/libbacktrace";
53     maintainers = with maintainers; [ twey ];
54     license = with licenses; [ bsd3 ];
55   };