about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/egl-wayland
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/libraries/egl-wayland
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/egl-wayland')
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/default.nix79
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch12
2 files changed, 91 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
new file mode 100644
index 000000000000..fa2c3687ba77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkgconfig
+, 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.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "Nvidia";
+    repo = pname;
+    rev = version;
+    sha256 = "0wvamjcfycd7rgk7v14g2rin55xin9rfkxmivyay3cm08vnl7y1d";
+  };
+
+  # Add missing include
+  # https://github.com/NVIDIA/egl-wayland/pull/24
+  patches = [ ./eglmesaext.patch ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+  ];
+
+  buildInputs = [
+    eglexternalplatform
+    libX11
+    mesa
+    libGL
+    wayland
+  ];
+
+  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 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch b/nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch
new file mode 100644
index 000000000000..9384ecff9b0f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch
@@ -0,0 +1,12 @@
+diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c
+index 01c9cb3..45736b0 100644
+--- a/src/wayland-eglsurface.c
++++ b/src/wayland-eglsurface.c
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <fcntl.h>
++#include <EGL/eglmesaext.h>
+ 
+ #define WL_EGL_WINDOW_DESTROY_CALLBACK_SINCE 3
+