2019-06-16 19:59:06 +00:00
|
|
|
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
|
2018-02-24 12:06:44 +00:00
|
|
|
, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
|
2019-05-28 19:09:34 +00:00
|
|
|
, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
|
2019-06-24 15:06:05 +00:00
|
|
|
, libpng, ffmpeg_4, freerdp
|
2017-10-31 21:31:05 +00:00
|
|
|
}:
|
|
|
|
|
2019-06-03 13:24:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-10-22 20:51:10 +00:00
|
|
|
pname = "wlroots";
|
2019-06-03 13:24:50 +00:00
|
|
|
version = "0.6.0";
|
2017-10-31 21:31:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "swaywm";
|
|
|
|
repo = "wlroots";
|
2018-10-22 20:51:10 +00:00
|
|
|
rev = version;
|
2019-06-03 13:24:50 +00:00
|
|
|
sha256 = "1rdcmll5b8w242n6yfjpsaprq280ck2jmbz46dxndhignxgda7k4";
|
2017-10-31 21:31:05 +00:00
|
|
|
};
|
|
|
|
|
2018-10-22 20:51:10 +00: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
|
2019-05-28 19:09:34 +00:00
|
|
|
xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
|
2019-06-24 15:06:05 +00:00
|
|
|
libpng ffmpeg_4 freerdp
|
2018-10-22 20:51:10 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
];
|
|
|
|
|
2019-02-03 10:46:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
# It happens from time to time that the version wasn't updated:
|
|
|
|
sed -iE "s/version: '[0-9]\.[0-9]\.[0-9]'/version: '${version}.0'/" meson.build
|
|
|
|
'';
|
|
|
|
|
2017-12-23 13:02:59 +00:00
|
|
|
postInstall = ''
|
2019-02-03 16:52:53 +00:00
|
|
|
# Copy the library to $bin and $examples
|
|
|
|
for output in "$bin" "$examples"; do
|
|
|
|
mkdir -p $output/lib
|
|
|
|
cp -P libwlroots* $output/lib/
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Install rootston (the reference compositor) to $bin and $examples (this
|
|
|
|
# has to be done after the fixup phase to prevent broken binaries):
|
2018-10-22 20:51:10 +00:00
|
|
|
for output in "$bin" "$examples"; do
|
|
|
|
mkdir -p $output/bin
|
|
|
|
cp rootston/rootston $output/bin/
|
|
|
|
patchelf \
|
2019-02-03 16:52:53 +00:00
|
|
|
--set-rpath "$(patchelf --print-rpath $output/bin/rootston | sed s,$out,$output,g)" \
|
2018-10-22 20:51:10 +00:00
|
|
|
$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 21:40:20 +00:00
|
|
|
cd ./examples
|
|
|
|
for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
|
|
|
|
cp "$binary" "$examples/bin/wlroots-$binary"
|
2019-02-03 16:52:53 +00:00
|
|
|
patchelf \
|
|
|
|
--set-rpath "$(patchelf --print-rpath $output/bin/rootston | sed s,$out,$examples,g)" \
|
|
|
|
"$examples/bin/wlroots-$binary"
|
2018-10-22 20:51:10 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|