hoarder: 0.21.0 -> 0.22.0
[NixPkgs.git] / pkgs / by-name / wc / wcc / package.nix
blob72c61d940942c2f49cf7f11ffc11c735c2a50974
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   capstone,
6   libbfd,
7   libelf,
8   libiberty,
9   readline,
12 stdenv.mkDerivation {
13   pname = "wcc-unstable";
14   version = "0.0.7-unstable-2025-01-13";
16   src = fetchFromGitHub {
17     owner = "endrazine";
18     repo = "wcc";
19     rev = "fe1f71d7f6c756e196b82a884dc38bb8f8aef4d3";
20     sha256 = "sha256-Kb9QIL+W0JFdfweqZL05OajXGGqXn6e6Jv3IVCr3BwQ=";
21     fetchSubmodules = true;
22   };
24   buildInputs = [
25     capstone
26     libbfd
27     libelf
28     libiberty
29     readline
30   ];
32   postPatch = ''
33     sed -i src/wsh/include/libwitch/wsh.h src/wsh/scripts/INDEX \
34       -e "s#/usr/share/wcc#$out/share/wcc#"
36     sed -i -e '/stropts.h>/d' src/wsh/include/libwitch/wsh.h
37   '';
39   installFlags = [ "DESTDIR=$(out)" ];
41   preInstall = ''
42     mkdir -p $out/usr/bin $out/lib/x86_64-linux-gnu
43   '';
45   postInstall = ''
46     mv $out/usr/* $out
47     rmdir $out/usr
48     mkdir -p $out/share/man/man1
49     cp doc/manpages/*.1 $out/share/man/man1/
50   '';
52   postFixup = ''
53     # not detected by patchShebangs
54     substituteInPlace $out/bin/wcch --replace-fail '#!/usr/bin/wsh' "#!$out/bin/wsh"
55   '';
57   enableParallelBuilding = true;
59   meta = with lib; {
60     homepage = "https://github.com/endrazine/wcc";
61     description = "Witchcraft compiler collection: tools to convert and script ELF files";
62     license = licenses.mit;
63     platforms = [ "x86_64-linux" ];
64     maintainers = with maintainers; [ orivej ];
65   };