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.
This commit is contained in:
Michael Weiss 2018-10-22 22:51:10 +02:00
parent 7615027fad
commit f4615bef06

View File

@ -1,39 +1,82 @@
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig { stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig
, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman , wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu , xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu
, libpng, ffmpeg_4
, python3Packages # TODO: Temporary
}: }:
let pname = "wlroots"; let
version = "unstable-2018-03-16"; pname = "wlroots";
version = "0.1";
meson480 = meson.overrideAttrs (oldAttrs: rec {
name = pname + "-" + version;
pname = "meson";
version = "0.48.0";
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "0qawsm6px1vca3babnqwn0hmkzsxy4w0gi345apd2qk3v0cv7ipc";
};
patches = builtins.filter # Remove gir-fallback-path.patch
(str: !(stdenv.lib.hasSuffix "gir-fallback-path.patch" str))
oldAttrs.patches;
});
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "${pname}-${version}"; name = "${pname}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "swaywm"; owner = "swaywm";
repo = "wlroots"; repo = "wlroots";
rev = "9cc875429b40e2567b219f8e9ffd23316d136204"; rev = version;
sha256 = "1prhic3pyf9n65qfg5akzkc9qv2z3ab60dpcacr7wgr9nxrvnsdq"; sha256 = "0xfipgg2qh2xcf3a1pzx8pyh1aqpb9rijdyi0as4s6fhgy4w269c";
}; };
# $out for the library and $bin for rootston patches = [ (fetchpatch { # TODO: Only required for version 0.1
outputs = [ "out" "bin" ]; url = https://github.com/swaywm/wlroots/commit/be6210cf8216c08a91e085dac0ec11d0e34fb217.patch;
sha256 = "0njv7mr4ark603w79cxcsln29galh87vpzsx2dzkrl1x5x4i6cj5";
}) ];
nativeBuildInputs = [ meson ninja pkgconfig ]; # $out for the library, $bin for rootston, and $examples for the example
# programs (in examples) AND rootston
outputs = [ "out" "bin" "examples" ];
nativeBuildInputs = [ meson480 ninja pkgconfig ];
buildInputs = [ buildInputs = [
wayland libGL wayland-protocols libinput libxkbcommon pixman wayland libGL wayland-protocols libinput libxkbcommon pixman
xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu
libpng ffmpeg_4
];
mesonFlags = [
"-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
"-Dxcb-icccm=enabled" "-Dxcb-xkb=enabled" "-Dxcb-errors=enabled"
]; ];
# Install rootston (the reference compositor) to $bin
postInstall = '' postInstall = ''
mkdir -p $bin/bin # Install rootston (the reference compositor) to $bin and $examples
cp rootston/rootston $bin/bin/ for output in "$bin" "$examples"; do
mkdir $bin/lib mkdir -p $output/bin
cp libwlroots* $bin/lib/ cp rootston/rootston $output/bin/
patchelf --set-rpath "$bin/lib:${stdenv.lib.makeLibraryPath buildInputs}" $bin/bin/rootston mkdir $output/lib
mkdir $bin/etc cp libwlroots* $output/lib/
cp ../rootston/rootston.ini.example $bin/etc/rootston.ini 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
for binary in $(find ./examples -executable -type f | grep -vE '\.so'); do
patchelf \
--set-rpath "$examples/lib:${stdenv.lib.makeLibraryPath buildInputs}" \
"$binary"
cp "$binary" $examples/bin/
done
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {