2018-10-22 21:51:10 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig
|
2018-02-24 12:06:44 +00:00
|
|
|
, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
|
2018-03-28 14:24:33 +01:00
|
|
|
, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu
|
2018-10-22 21:51:10 +01:00
|
|
|
, libpng, ffmpeg_4
|
2017-10-31 21:31:05 +00:00
|
|
|
}:
|
|
|
|
|
2018-10-22 21:51:10 +01:00
|
|
|
let
|
|
|
|
pname = "wlroots";
|
2018-11-30 00:37:31 +00:00
|
|
|
version = "0.2";
|
2017-10-31 21:31:05 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "swaywm";
|
|
|
|
repo = "wlroots";
|
2018-10-22 21:51:10 +01:00
|
|
|
rev = version;
|
2018-11-30 00:37:31 +00:00
|
|
|
sha256 = "0gfxawjlb736xl90zfv3n6zzf5n1cacgzflqi1zq1wn7wd3j6ppv";
|
2017-10-31 21:31:05 +00:00
|
|
|
};
|
|
|
|
|
2018-11-30 00:37:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "version: '0.1.0'" "version: '${version}.0'"
|
|
|
|
'';
|
2018-10-22 21:51:10 +01:00
|
|
|
|
|
|
|
# $out for the library, $bin for rootston, and $examples for the example
|
|
|
|
# programs (in examples) AND rootston
|
|
|
|
outputs = [ "out" "bin" "examples" ];
|
2017-10-31 21:31:05 +00:00
|
|
|
|
2018-12-22 16:25:56 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkgconfig ];
|
2017-10-31 21:31:05 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2018-02-24 12:06:44 +00:00
|
|
|
wayland libGL wayland-protocols libinput libxkbcommon pixman
|
2018-03-28 14:24:33 +01:00
|
|
|
xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu
|
2018-10-22 21:51:10 +01:00
|
|
|
libpng ffmpeg_4
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
|
2018-11-30 13:23:33 +00:00
|
|
|
"-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
|
2017-10-31 21:31:05 +00:00
|
|
|
];
|
|
|
|
|
2017-12-23 13:02:59 +00:00
|
|
|
postInstall = ''
|
2018-10-22 21:51:10 +01:00
|
|
|
# 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
|
2018-10-24 22:40:20 +01:00
|
|
|
cd ./examples
|
|
|
|
for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
|
2018-10-22 21:51:10 +01:00
|
|
|
patchelf \
|
|
|
|
--set-rpath "$examples/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
|
|
|
|
"$binary"
|
2018-10-24 22:40:20 +01:00
|
|
|
cp "$binary" "$examples/bin/wlroots-$binary"
|
2018-10-22 21:51:10 +01:00
|
|
|
done
|
2017-12-23 13:02:59 +00:00
|
|
|
'';
|
|
|
|
|
2017-10-31 21:31:05 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A modular Wayland compositor library";
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
}
|