about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/wlroots
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/wlroots
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/wlroots')
-rw-r--r--nixpkgs/pkgs/development/libraries/wlroots/default.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/wlroots/default.nix b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
new file mode 100644
index 000000000000..92e8bded8755
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig
+, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu
+, libpng, ffmpeg_4
+}:
+
+let
+  pname = "wlroots";
+  version = "0.2";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "0gfxawjlb736xl90zfv3n6zzf5n1cacgzflqi1zq1wn7wd3j6ppv";
+  };
+
+  postPatch = ''
+    substituteInPlace meson.build \
+      --replace "version: '0.1.0'" "version: '${version}.0'"
+  '';
+
+  # $out for the library, $bin for rootston, and $examples for the example
+  # programs (in examples) AND rootston
+  outputs = [ "out" "bin" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    wayland libGL wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu
+    libpng ffmpeg_4
+  ];
+
+  mesonFlags = [
+    "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
+  ];
+
+  postInstall = ''
+    # Install rootston (the reference compositor) to $bin and $examples
+    for output in "$bin" "$examples"; do
+      mkdir -p $output/bin
+      cp rootston/rootston $output/bin/
+      mkdir $output/lib
+      cp libwlroots* $output/lib/
+      patchelf \
+        --set-rpath "$output/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
+        $output/bin/rootston
+      mkdir $output/etc
+      cp ../rootston/rootston.ini.example $output/etc/rootston.ini
+    done
+    # 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
+      patchelf \
+        --set-rpath "$examples/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
+        "$binary"
+      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 ];
+  };
+}