python313Packages.kasa-crypt: 0.4.4 -> 0.5.0 (#375396)
[NixPkgs.git] / pkgs / applications / misc / openbrf / default.nix
blobbfac320abe8a43067ae5683cfccbeef85766bc29
2   mkDerivation,
3   lib,
4   stdenv,
5   fetchFromGitHub,
6   fetchpatch,
7   qtbase,
8   vcg,
9   glew,
10   qmake,
11   libGLU,
12   eigen,
13   libGL,
16 mkDerivation {
17   pname = "openbrf";
18   version = "unstable-2016-01-09";
20   src = fetchFromGitHub {
21     owner = "cfcohen";
22     repo = "openbrf";
23     rev = "4bdc66e38def5e5184f5379c84a7558b7484c70a";
24     sha256 = "16254cnr60ihcn7bki7wl1qm6gkvzb99cn66md1pnb7za8nvzf4j";
25   };
27   patches = [
28     # https://github.com/cfcohen/openbrf/pull/7
29     (fetchpatch {
30       name = "fix-build-against-newer-vcglib.patch";
31       url = "https://github.com/cfcohen/openbrf/commit/6d82a25314a393e72bfbe2ffc3965bcac407df4c.patch";
32       hash = "sha256-rNxAw6Le6QXMSirIAMhMmqVgNJLq6osnEOhWrY3mTpM=";
33     })
34   ];
36   buildInputs = [
37     qtbase
38     vcg
39     glew
40     eigen
41   ];
43   nativeBuildInputs = [ qmake ];
45   qmakeFlags = [ "openBrf.pro" ];
47   env.NIX_CFLAGS_COMPILE = "-isystem ${lib.getDev eigen}/include/eigen3";
49   postPatch = ''
50     sed -i 's,^VCGLIB .*,VCGLIB = ${vcg}/include,' openBrf.pro
51   '';
53   installPhase = ''
54     install -Dm755 openBrf $out/share/openBrf/openBrf
55     install -Dm644 carry_positions.txt $out/share/openBrf/carry_positions.txt
56     install -Dm644 reference.brf $out/share/openBrf/reference.brf
58     patchelf  \
59       --set-rpath "${
60         lib.makeLibraryPath [
61           qtbase
62           glew
63           stdenv.cc.cc
64           libGLU
65           libGL
66         ]
67       }" \
68       $out/share/openBrf/openBrf
70     mkdir -p "$out/bin"
71     ln -s "$out/share/openBrf/openBrf" "$out/bin/openBrf"
72   '';
74   dontPatchELF = true;
76   meta = with lib; {
77     description = "Tool to edit resource files (BRF)";
78     mainProgram = "openBrf";
79     homepage = "https://github.com/cfcohen/openbrf";
80     maintainers = with lib.maintainers; [ abbradar ];
81     license = licenses.free;
82     platforms = platforms.linux;
83   };