2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-04-22 15:20:20 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-05-10 22:55:06 +00:00
|
|
|
, makeFontsConf
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-04-22 15:20:20 +00:00
|
|
|
, pugixml
|
|
|
|
, wayland
|
|
|
|
, libGL
|
|
|
|
, libffi
|
|
|
|
, buildPackages
|
|
|
|
, docSupport ? true
|
2022-05-10 22:55:06 +00:00
|
|
|
, doxygen
|
|
|
|
, graphviz
|
2020-04-22 15:20:20 +00:00
|
|
|
}:
|
2019-03-26 19:23:35 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waylandpp";
|
2022-05-10 22:55:06 +00:00
|
|
|
version = "1.0.0";
|
2019-03-26 19:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NilsBrause";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-05-10 22:55:06 +00:00
|
|
|
hash = "sha256-Dw2RnLLyhykikHps1in+euHksO+ERbATbfmbUFOJklg=";
|
2019-03-26 19:23:35 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 00:55:55 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2020-04-22 17:53:19 +00:00
|
|
|
"-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"
|
|
|
|
];
|
2020-04-02 02:17:58 +00:00
|
|
|
|
2022-05-10 22:55:06 +00:00
|
|
|
# Complains about not being able to find the fontconfig config file otherwise
|
|
|
|
FONTCONFIG_FILE = lib.optional docSupport (makeFontsConf { fontDirectories = [ ]; });
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals docSupport [ doxygen graphviz ];
|
2020-04-02 02:17:58 +00:00
|
|
|
buildInputs = [ pugixml wayland libGL libffi ];
|
2019-03-26 19:23:35 +00:00
|
|
|
|
2022-05-10 22:55:06 +00:00
|
|
|
outputs = [ "bin" "dev" "lib" "out" ] ++ lib.optionals docSupport [ "doc" "devman" ];
|
|
|
|
|
|
|
|
# Resolves the warning "Fontconfig error: No writable cache directories"
|
|
|
|
preBuild = ''
|
|
|
|
export XDG_CACHE_HOME="$(mktemp -d)"
|
|
|
|
'';
|
2019-11-01 13:01:02 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-03-26 19:23:35 +00:00
|
|
|
description = "Wayland C++ binding";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/NilsBrause/waylandpp/";
|
2022-05-10 22:55:06 +00:00
|
|
|
license = with lib.licenses; [ bsd2 hpnd ];
|
|
|
|
maintainers = with lib.maintainers; [ minijackson ];
|
2019-03-26 19:23:35 +00:00
|
|
|
};
|
|
|
|
}
|