|
| 1 | +{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland-scanner, libGL |
| 2 | +, wayland, wayland-protocols, libinput, libxkbcommon, pixman, xcbutilwm, libX11 |
| 3 | +, libcap, xcbutilimage, xcbutilerrors, mesa, libpng, ffmpeg, libuuid |
| 4 | +, xcbutilrenderutil, xwayland }: |
| 5 | + |
| 6 | +stdenv.mkDerivation rec { |
| 7 | + pname = "wlroots"; |
| 8 | + version = "0.13.0"; |
| 9 | + |
| 10 | + src = fetchFromGitHub { |
| 11 | + owner = "swaywm"; |
| 12 | + repo = "wlroots"; |
| 13 | + rev = version; |
| 14 | + sha256 = "01plhbnsp5yg18arz0v8fr0pr9l4w4pdzwkg9px486qdvb3s1vgy"; |
| 15 | + }; |
| 16 | + |
| 17 | + # $out for the library and $examples for the example programs (in examples): |
| 18 | + outputs = [ "out" "examples" ]; |
| 19 | + |
| 20 | + nativeBuildInputs = [ meson ninja pkg-config wayland-scanner ]; |
| 21 | + |
| 22 | + buildInputs = [ |
| 23 | + libGL |
| 24 | + wayland |
| 25 | + wayland-protocols |
| 26 | + libinput |
| 27 | + libxkbcommon |
| 28 | + pixman |
| 29 | + xcbutilwm |
| 30 | + libX11 |
| 31 | + libcap |
| 32 | + xcbutilimage |
| 33 | + xcbutilerrors |
| 34 | + mesa |
| 35 | + libpng |
| 36 | + ffmpeg |
| 37 | + libuuid |
| 38 | + xcbutilrenderutil |
| 39 | + xwayland |
| 40 | + ]; |
| 41 | + |
| 42 | + mesonFlags = [ "-Dlogind-provider=systemd" "-Dlibseat=disabled" ]; |
| 43 | + |
| 44 | + postFixup = '' |
| 45 | + # Install ALL example programs to $examples: |
| 46 | + # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle |
| 47 | + # screenshot output-layout multi-pointer rotation tablet touch pointer |
| 48 | + # simple |
| 49 | + mkdir -p $examples/bin |
| 50 | + cd ./examples |
| 51 | + for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do |
| 52 | + cp "$binary" "$examples/bin/wlroots-$binary" |
| 53 | + done |
| 54 | + ''; |
| 55 | + |
| 56 | + meta = with lib; { |
| 57 | + description = "A modular Wayland compositor library"; |
| 58 | + longDescription = '' |
| 59 | + Pluggable, composable, unopinionated modules for building a Wayland |
| 60 | + compositor; or about 50,000 lines of code you were going to write anyway. |
| 61 | + ''; |
| 62 | + inherit (src.meta) homepage; |
| 63 | + changelog = "https://github.com/swaywm/wlroots/releases/tag/${version}"; |
| 64 | + license = licenses.mit; |
| 65 | + platforms = platforms.linux; |
| 66 | + maintainers = with maintainers; [ ]; |
| 67 | + }; |
| 68 | +} |
0 commit comments