diff options
author | Cole Mickens <cole.mickens@gmail.com> | 2018-11-05 19:10:22 -0800 |
---|---|---|
committer | Cole Mickens <cole.mickens@gmail.com> | 2018-11-12 03:42:08 -0800 |
commit | c7478ea6ade3aa8bbf2ffe50048d528e4971a30b (patch) | |
tree | b766210438b61e454a976f5eab28cf2ae91651c3 /pkgs/wlroots | |
parent | 54de53d3ff5fcd3efdc01b528a0c17c0b47f6ec4 (diff) |
places packages into a pkgs/ directory
Signed-off-by: Cole Mickens <cole.mickens@gmail.com>
Diffstat (limited to 'pkgs/wlroots')
-rw-r--r-- | pkgs/wlroots/default.nix | 85 | ||||
-rw-r--r-- | pkgs/wlroots/metadata.nix | 5 |
2 files changed, 90 insertions, 0 deletions
diff --git a/pkgs/wlroots/default.nix b/pkgs/wlroots/default.nix new file mode 100644 index 0000000..74b0900 --- /dev/null +++ b/pkgs/wlroots/default.nix @@ -0,0 +1,85 @@ +{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig +, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman +, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu +, libpng, ffmpeg_4 +, python3Packages # TODO: Temporary +}: + +let + metadata = import ./metadata.nix; + pname = "wlroots"; + version = metadata.rev; + 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 { + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "swaywm"; + repo = "wlroots"; + rev = metadata.rev; + sha256 = metadata.sha256; + }; + + # $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 = [ + 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-xkb=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 + 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 ]; + }; +} diff --git a/pkgs/wlroots/metadata.nix b/pkgs/wlroots/metadata.nix new file mode 100644 index 0000000..62c4a17 --- /dev/null +++ b/pkgs/wlroots/metadata.nix @@ -0,0 +1,5 @@ +{ + rev = "3181c4bec06d2fe51da052c0a08c8287725ec900"; + sha256 = "1pnzlqxk4gbshlmvn91vnyd2vl1r6pm6fwyk6jpg7d469v7q98r2"; + revdate = "2018-11-10T14:38:37Z"; +} |