Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 72 lines 2.5 kB view raw
1{ lib, stdenv, fetchpatch, fetchzip, pkg-config, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt, libtraceevent, libtracefs, zstd, sourceHighlight }: 2stdenv.mkDerivation rec { 3 pname = "trace-cmd"; 4 version = "3.2"; 5 6 src = fetchzip { 7 url = "https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/trace-cmd-v${version}.tar.gz"; 8 hash = "sha256-rTcaaEQ3Y4cneNnZSGiMZNp+Z7dyAa3oNTNMAEXr28g="; 9 }; 10 11 patches = [ 12 # Upstream patches to be released in the next version 13 (fetchpatch { 14 sha256 = "sha256-eGuHODm29M7rbGYsyXUPoNe1xsIG3eJYhwXQDakRJHA="; 15 url = "https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/patch/?id=6b07a7df871342068604b204711ab741d421d051"; 16 }) 17 ]; 18 19 # Don't build and install html documentation 20 postPatch = '' 21 sed -i -e '/^all:/ s/html//' -e '/^install:/ s/install-html//' \ 22 Documentation{,/trace-cmd,/libtracecmd}/Makefile 23 patchShebangs check-manpages.sh 24 ''; 25 26 nativeBuildInputs = [ asciidoc libxslt pkg-config xmlto docbook_xsl docbook_xml_dtd_45 sourceHighlight ]; 27 28 buildInputs = [ libtraceevent libtracefs zstd ]; 29 30 outputs = [ "out" "lib" "dev" "man" "devman" ]; 31 32 MANPAGE_DOCBOOK_XSL="${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl"; 33 34 dontConfigure = true; 35 36 enableParallelBuilding = true; 37 makeFlags = [ 38 # The following values appear in the generated .pc file 39 "prefix=${placeholder "lib"}" 40 ]; 41 42 # We do not mention targets (like "doc") explicitly in makeFlags 43 # because the Makefile would not print warnings about too old 44 # libraries (see "warning:" in the Makefile) 45 postBuild = '' 46 make libs doc -j$NIX_BUILD_CORES 47 ''; 48 49 installTargets = [ 50 "install_cmd" 51 "install_libs" 52 "install_doc" 53 ]; 54 installFlags = [ 55 "LDCONFIG=false" 56 "bindir=${placeholder "out"}/bin" 57 "mandir=${placeholder "man"}/share/man" 58 "libdir=${placeholder "lib"}/lib" 59 "pkgconfig_dir=${placeholder "dev"}/lib/pkgconfig" 60 "includedir=${placeholder "dev"}/include" 61 "BASH_COMPLETE_DIR=${placeholder "out"}/share/bash-completion/completions" 62 ]; 63 64 meta = with lib; { 65 description = "User-space tools for the Linux kernel ftrace subsystem"; 66 mainProgram = "trace-cmd"; 67 homepage = "https://www.trace-cmd.org/"; 68 license = with licenses; [ lgpl21Only gpl2Only ]; 69 platforms = platforms.linux; 70 maintainers = with maintainers; [ thoughtpolice basvandijk wentasah ]; 71 }; 72}