about summary refs log tree commit diff
path: root/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix')
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix
new file mode 100644
index 000000000000..19f0e03d22bc
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
+, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
+, libpng, ffmpeg_4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wlroots";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "0lh0m5wmr5a73zgqnnrrcnrywy7wjsrs839agiq9hf1yrgav3m8z";
+  };
+
+  # $out for the library and $examples for the example programs (in examples):
+  outputs = [ "out" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    wayland libGL wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
+    libpng ffmpeg_4
+  ];
+
+  mesonFlags = [
+    "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
+    "-Dfreerdp=disabled"
+  ];
+
+  postInstall = ''
+    # Copy the library to $examples
+    mkdir -p $examples/lib
+    cp -P libwlroots* $examples/lib/
+  '';
+
+  postFixup = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A modular Wayland compositor library";
+    inherit (src.meta) homepage;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}