aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
blob: 5fc466cec2014532fb2372a76cd43b279b37c2ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ stdenv
, fetchFromGitHub
, cmake
, pkgconfig
, pugixml
, wayland
, libGL
, libffi
, buildPackages
, docSupport ? true
, doxygen ? null
}:

assert docSupport -> doxygen != null;

with stdenv.lib;
stdenv.mkDerivation rec {
  pname = "waylandpp";
  version = "0.2.8";

  src = fetchFromGitHub {
    owner = "NilsBrause";
    repo = pname;
    rev = version;
    sha256 = "1kxiqab48p0n97pwg8c2zx56wqq32m3rcq7qd2pjj33ipcanb3qq";
  };

  cmakeFlags = [ 
    "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}" 
  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
    "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"
  ];

  nativeBuildInputs = [ cmake pkgconfig ] ++ optional docSupport doxygen;
  buildInputs = [ pugixml wayland libGL libffi ];

  outputs = [ "bin" "dev" "lib" "out" ] ++ optionals docSupport [ "doc" "devman" ];

  meta = with stdenv.lib; {
    description = "Wayland C++ binding";
    homepage = "https://github.com/NilsBrause/waylandpp/";
    license = with licenses; [ bsd2 hpnd ];
    maintainers = with maintainers; [ minijackson ];
  };
}