depot/third_party/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
Default email 48af15f7a5 Project import generated by Copybara.
GitOrigin-RevId: 04a2b269d8921505a2969fc9ec25c1f517f2b307
2021-03-20 04:20:00 +00:00

82 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, meson
, ninja
, libX11
, mesa
, libGL
, wayland
}:
let
eglexternalplatform = stdenv.mkDerivation {
pname = "eglexternalplatform";
version = "1.1";
src = fetchFromGitHub {
owner = "Nvidia";
repo = "eglexternalplatform";
rev = "7c8f8e2218e46b1a4aa9538520919747f1184d86";
sha256 = "0lr5s2xa1zn220ghmbsiwgmx77l156wk54c7hybia0xpr9yr2nhb";
};
installPhase = ''
mkdir -p "$out/include/"
cp interface/eglexternalplatform.h "$out/include/"
cp interface/eglexternalplatformversion.h "$out/include/"
substituteInPlace eglexternalplatform.pc \
--replace "/usr/include/EGL" "$out/include"
mkdir -p "$out/share/pkgconfig"
cp eglexternalplatform.pc "$out/share/pkgconfig/"
'';
meta = with lib; {
license = licenses.mit;
};
};
in stdenv.mkDerivation rec {
pname = "egl-wayland";
version = "1.1.6";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "Nvidia";
repo = pname;
rev = version;
sha256 = "1n9lg8hpjgxlf7dpddkjhbslsfd0symla2wk6jjmnl9n9jv2gmzk";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
eglexternalplatform
libX11
mesa
libGL
wayland
];
postFixup = ''
# Doubled prefix in pc file after postbuild hook replaces includedir prefix variable with dev output path
substituteInPlace $dev/lib/pkgconfig/wayland-eglstream.pc \
--replace "=$dev/$dev" "=$dev" \
--replace "Requires:" "Requires.private:"
'';
meta = with lib; {
description = "The EGLStream-based Wayland external platform";
homepage = "https://github.com/NVIDIA/egl-wayland/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ hedning ];
};
}