nixpkgs/pkgs/development/libraries/waylandpp/default.nix
Sergei Trofimovich eaebf2363a waylandpp: pull gcc-13 fix pending upstream inclusion
Without the change downstream projects like `kodi` fail to build on
`gcc-13` as:

    [  6%] Building CXX object build/events/windows/CMakeFiles/events_windows.dir/GUIViewStateEventLog.cpp.o
    In file included from /build/source/xbmc/windowing/wayland/Connection.h:13,
                     from /build/source/xbmc/windowing/wayland/Connection.cpp:9:
    /nix/store/ygbnddg737vq1992xnn57k5j6xjwfkml-waylandpp-1.0.0-dev/include/wayland-client.hpp:167:73: error: 'std::uint32_t' has not been declared
      167 |                            const std::vector<detail::argument_t>& args, std::uint32_t version = 0);
          |                                                                         ^~~
    In file included from /nix/store/ygbnddg737vq1992xnn57k5j6xjwfkml-waylandpp-1.0.0-dev/include/wayland-client.hpp:768:
    /nix/store/ygbnddg737vq1992xnn57k5j6xjwfkml-waylandpp-1.0.0-dev/include/wayland-client-protocol.hpp:169:25: error: 'uint32_t' in namespace 'std' does not name a type; did you mean 'wint_t'?
      169 |   static constexpr std::uint32_t bind_since_version = 1;
          |                         ^~~~~~~~
          |                         wint_t
2024-01-13 08:32:37 +00:00

66 lines
1.8 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, makeFontsConf
, pkg-config
, pugixml
, wayland
, libGL
, libffi
, buildPackages
, docSupport ? true
, doxygen
, graphviz
}:
stdenv.mkDerivation rec {
pname = "waylandpp";
version = "1.0.0";
src = fetchFromGitHub {
owner = "NilsBrause";
repo = pname;
rev = version;
hash = "sha256-Dw2RnLLyhykikHps1in+euHksO+ERbATbfmbUFOJklg=";
};
patches = [
# Pull fixes for gcc-13 compatibility:
# https://github.com/NilsBrause/waylandpp/pull/71
# Without the change `kodi` fails to find `uint32_t` in `waylandpp`
# headers.
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/NilsBrause/waylandpp/commit/3c441910aa25f57df2a4db55f75f5d99cea86620.patch";
hash = "sha256-bxHMP09zCwUKD0M63C1FqQySAN9hr+7t/DyFDRwdtCo=";
})
];
cmakeFlags = [
"-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"
];
# 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 ];
buildInputs = [ pugixml wayland libGL libffi ];
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)"
'';
meta = with lib; {
description = "Wayland C++ binding";
homepage = "https://github.com/NilsBrause/waylandpp/";
license = with lib.licenses; [ bsd2 hpnd ];
maintainers = with lib.maintainers; [ minijackson ];
};
}