silx: 2.1.1 -> 2.1.2 (#361612)
[NixPkgs.git] / pkgs / by-name / ba / babeltrace2 / package.nix
blobec9f15e679f8d11ebd422895966bdfaf95b081d1
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   autoreconfHook,
7   pkg-config,
8   glib,
9   elfutils,
10   bison,
11   flex,
12   asciidoc,
13   xmlto,
14   docbook_xml_dtd_45,
15   docbook_xsl,
16   enablePython ? false,
17   python ? null,
18   pythonPackages ? null,
19   swig,
20   ensureNewerSourcesForZipFilesHook,
23 stdenv.mkDerivation rec {
24   pname = "babeltrace2";
25   version = "2.0.6";
27   src = fetchFromGitHub {
28     owner = "efficios";
29     repo = "babeltrace";
30     rev = "v${version}";
31     hash = "sha256-L4YTqPxvWynUBnmAQnlJ2RNbEv9MhBxQOsqbWix8ZwU=";
32   };
34   patches = [
35     # Patches needed for Python 3.12
36     (fetchpatch {
37       # python: Use standalone 'sysconfig' module
38       url = "https://github.com/efficios/babeltrace/commit/452480eb6820df9973d50431a479ca547815ae08.patch";
39       hash = "sha256-YgUKHJzdliNUsTY29E0xxcUjqVWn4EvxyTs0B+O+jrI=";
40     })
41     (fetchpatch {
42       # python: replace distutils with setuptools
43       url = "https://github.com/efficios/babeltrace/commit/6ec97181a525a3cd64cedbcd0df905ed9e84ba03.patch";
44       hash = "sha256-1hlEkPcRUpf2+iEXqHXcCDOaLTg+eaVcahqZlA8m5QY=";
45     })
46     (fetchpatch {
47       # fix: python: monkey patch the proper sysconfig implementation
48       url = "https://github.com/efficios/babeltrace/commit/927263e4ea62877af7240cfdb1514ae949dbfc2e.patch";
49       hash = "sha256-HNRQ7uw26FUKCQ/my6//OL2xsHdOGlQUq5zIKtg9OGw=";
50     })
51   ];
53   outputs = [
54     "out"
55     "man"
56     "dev"
57   ];
59   nativeBuildInputs =
60     [
61       autoreconfHook
62       pkg-config
63       glib
64       bison
65       flex
66       asciidoc
67       xmlto
68       docbook_xml_dtd_45
69       docbook_xsl
70     ]
71     ++ lib.optionals enablePython [
72       swig
73       pythonPackages.setuptools
74       ensureNewerSourcesForZipFilesHook
75     ];
77   buildInputs = [
78     glib
79     elfutils
80   ] ++ lib.optional enablePython python;
82   configureFlags = [
83     (lib.enableFeature enablePython "python-bindings")
84     (lib.enableFeature enablePython "python-plugins")
85     (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "debug-info")
86   ];
88   # For cross-compilation of Python bindings
89   makeFlags = [ "CFLAGS=-Wno-error=stringop-truncation -Wno-error=null-dereference" ];
91   enableParallelBuilding = true;
93   meta = {
94     description = "Babeltrace /ˈbæbəltreɪs/ is an open-source trace manipulation toolkit";
95     homepage = "https://babeltrace.org";
96     license = lib.licenses.mit;
97     maintainers = with lib.maintainers; [ wentasah ];
98     mainProgram = "babeltrace2";
99     platforms = lib.platforms.all;
100   };