wlroots: 2018-03-16 -> 0.1

Keep "meta.broken = true" but update the package to keep track of
upstream changes and prepare the "reintegration" into nixpkgs.

+59 -16
+59 -16
pkgs/development/libraries/wlroots/default.nix
··· 1 - { stdenv, fetchFromGitHub, meson, ninja, pkgconfig 1 + { stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig 2 2 , wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman 3 3 , xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu 4 + , libpng, ffmpeg_4 5 + , python3Packages # TODO: Temporary 4 6 }: 5 7 6 - let pname = "wlroots"; 7 - version = "unstable-2018-03-16"; 8 + let 9 + pname = "wlroots"; 10 + version = "0.1"; 11 + meson480 = meson.overrideAttrs (oldAttrs: rec { 12 + name = pname + "-" + version; 13 + pname = "meson"; 14 + version = "0.48.0"; 15 + 16 + src = python3Packages.fetchPypi { 17 + inherit pname version; 18 + sha256 = "0qawsm6px1vca3babnqwn0hmkzsxy4w0gi345apd2qk3v0cv7ipc"; 19 + }; 20 + patches = builtins.filter # Remove gir-fallback-path.patch 21 + (str: !(stdenv.lib.hasSuffix "gir-fallback-path.patch" str)) 22 + oldAttrs.patches; 23 + }); 8 24 in stdenv.mkDerivation rec { 9 25 name = "${pname}-${version}"; 10 26 11 27 src = fetchFromGitHub { 12 28 owner = "swaywm"; 13 29 repo = "wlroots"; 14 - rev = "9cc875429b40e2567b219f8e9ffd23316d136204"; 15 - sha256 = "1prhic3pyf9n65qfg5akzkc9qv2z3ab60dpcacr7wgr9nxrvnsdq"; 30 + rev = version; 31 + sha256 = "0xfipgg2qh2xcf3a1pzx8pyh1aqpb9rijdyi0as4s6fhgy4w269c"; 16 32 }; 17 33 18 - # $out for the library and $bin for rootston 19 - outputs = [ "out" "bin" ]; 34 + patches = [ (fetchpatch { # TODO: Only required for version 0.1 35 + url = https://github.com/swaywm/wlroots/commit/be6210cf8216c08a91e085dac0ec11d0e34fb217.patch; 36 + sha256 = "0njv7mr4ark603w79cxcsln29galh87vpzsx2dzkrl1x5x4i6cj5"; 37 + }) ]; 38 + 39 + # $out for the library, $bin for rootston, and $examples for the example 40 + # programs (in examples) AND rootston 41 + outputs = [ "out" "bin" "examples" ]; 20 42 21 - nativeBuildInputs = [ meson ninja pkgconfig ]; 43 + nativeBuildInputs = [ meson480 ninja pkgconfig ]; 22 44 23 45 buildInputs = [ 24 46 wayland libGL wayland-protocols libinput libxkbcommon pixman 25 47 xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu 48 + libpng ffmpeg_4 26 49 ]; 27 50 28 - # Install rootston (the reference compositor) to $bin 51 + mesonFlags = [ 52 + "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled" 53 + "-Dxcb-icccm=enabled" "-Dxcb-xkb=enabled" "-Dxcb-errors=enabled" 54 + ]; 55 + 29 56 postInstall = '' 30 - mkdir -p $bin/bin 31 - cp rootston/rootston $bin/bin/ 32 - mkdir $bin/lib 33 - cp libwlroots* $bin/lib/ 34 - patchelf --set-rpath "$bin/lib:${stdenv.lib.makeLibraryPath buildInputs}" $bin/bin/rootston 35 - mkdir $bin/etc 36 - cp ../rootston/rootston.ini.example $bin/etc/rootston.ini 57 + # Install rootston (the reference compositor) to $bin and $examples 58 + for output in "$bin" "$examples"; do 59 + mkdir -p $output/bin 60 + cp rootston/rootston $output/bin/ 61 + mkdir $output/lib 62 + cp libwlroots* $output/lib/ 63 + patchelf \ 64 + --set-rpath "$output/lib:${stdenv.lib.makeLibraryPath buildInputs}" \ 65 + $output/bin/rootston 66 + mkdir $output/etc 67 + cp ../rootston/rootston.ini.example $output/etc/rootston.ini 68 + done 69 + # Install ALL example programs to $examples: 70 + # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle 71 + # screenshot output-layout multi-pointer rotation tablet touch pointer 72 + # simple 73 + mkdir -p $examples/bin 74 + for binary in $(find ./examples -executable -type f | grep -vE '\.so'); do 75 + patchelf \ 76 + --set-rpath "$examples/lib:${stdenv.lib.makeLibraryPath buildInputs}" \ 77 + "$binary" 78 + cp "$binary" $examples/bin/ 79 + done 37 80 ''; 38 81 39 82 meta = with stdenv.lib; {