nixpkgs/pkgs/development/libraries/wlroots/default.nix
Michael Weiss 25b80b62da wlroots: Remove the overrides for Meson
These overrides aren't required anymore as Meson 0.48.2 is now in
nixpkgs and there aren't any big problems so far (i.e. a revert is
unlikely).
2018-12-22 17:33:08 +01:00

77 lines
2.3 KiB
Nix

{ 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 ];
};
}