summary refs log tree commit diff
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2023-03-20 18:43:18 +0100
committerOPNA2608 <christoph.neidahl@gmail.com>2023-04-23 11:28:55 +0200
commitda2aa5a0db476cdf76acdf101f48173821138264 (patch)
tree5e45175f398c61abf8413a6e1f96e1d55edf8ce1
parent519f9d324d060d92489c666216bdb62fe11591c4 (diff)
downloadnixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar.gz
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar.bz2
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar.lz
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar.xz
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.tar.zst
nixpkgs-da2aa5a0db476cdf76acdf101f48173821138264.zip
eglexternalplatform: init at 1.1
-rw-r--r--pkgs/development/libraries/egl-wayland/default.nix39
-rw-r--r--pkgs/development/libraries/eglexternalplatform/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 49 insertions, 32 deletions
diff --git a/pkgs/development/libraries/egl-wayland/default.nix b/pkgs/development/libraries/egl-wayland/default.nix
index a833ebe3e60..fbef69f3cda 100644
--- a/pkgs/development/libraries/egl-wayland/default.nix
+++ b/pkgs/development/libraries/egl-wayland/default.nix
@@ -2,6 +2,7 @@
 , stdenv
 , fetchFromGitHub
 , fetchpatch
+, eglexternalplatform
 , pkg-config
 , meson
 , ninja
@@ -13,35 +14,7 @@
 , wayland-protocols
 }:
 
-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 {
+stdenv.mkDerivation rec {
   pname = "egl-wayland";
   version = "1.1.11";
 
@@ -75,7 +48,6 @@ in stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    eglexternalplatform
     libGL
     libX11
     libdrm
@@ -83,11 +55,14 @@ in stdenv.mkDerivation rec {
     wayland-protocols
   ];
 
+  propagatedBuildInputs = [
+    eglexternalplatform
+  ];
+
   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:"
+      --replace "=$dev/$dev" "=$dev"
   '';
 
   meta = with lib; {
diff --git a/pkgs/development/libraries/eglexternalplatform/default.nix b/pkgs/development/libraries/eglexternalplatform/default.nix
new file mode 100644
index 00000000000..2845faa9d08
--- /dev/null
+++ b/pkgs/development/libraries/eglexternalplatform/default.nix
@@ -0,0 +1,40 @@
+{ stdenvNoCC
+, lib
+, fetchFromGitHub
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "eglexternalplatform";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "Nvidia";
+    repo = "eglexternalplatform";
+    rev = "7c8f8e2218e46b1a4aa9538520919747f1184d86";
+    sha256 = "0lr5s2xa1zn220ghmbsiwgmx77l156wk54c7hybia0xpr9yr2nhb";
+  };
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/include/
+    cp interface/* $out/include/
+
+    substituteInPlace eglexternalplatform.pc \
+      --replace "/usr/include/EGL" "$out/include"
+    install -Dm644 {.,$out/share/pkgconfig}/eglexternalplatform.pc
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "The EGL External Platform interface";
+    homepage = "https://github.com/NVIDIA/eglexternalplatform";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ hedning ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4dfc6180135..e1abbe0b5a5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -19874,6 +19874,8 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo;
   };
 
+  eglexternalplatform = callPackage ../development/libraries/eglexternalplatform { };
+
   egl-wayland = callPackage ../development/libraries/egl-wayland { };
 
   elastix = callPackage ../development/libraries/science/biology/elastix {