From ea099211e0c4dc8163ad6cbda3abddd3e75bf5b4 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 3 Apr 2021 13:36:34 +0200 Subject: [PATCH] wayland: Refactor the Nix expression This should make it a bit easier to read, expat is not optional (only for cross-compiling - WIP), and fetchpatch is no longer required. --- .../development/libraries/wayland/default.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index 99800bb2c54..875b6508d6f 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -1,16 +1,15 @@ { lib , stdenv , fetchurl -, fetchpatch +, substituteAll , meson , pkg-config -, substituteAll , ninja -, libffi -, libxml2 , wayland -, expat ? null # Build wayland-scanner (currently cannot be disabled as of 1.7.0) +, expat +, libxml2 , withLibraries ? stdenv.isLinux +, libffi , withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform , graphviz-nox , doxygen @@ -25,8 +24,6 @@ # Documentation is only built when building libraries. assert withDocumentation -> withLibraries; -# Require the optional to be enabled until upstream fixes or removes the configure flag -assert expat != null; let isCross = stdenv.buildPlatform != stdenv.hostPlatform; in @@ -46,6 +43,10 @@ stdenv.mkDerivation rec { }) ]; + postPatch = lib.optionalString withDocumentation '' + patchShebangs doc/doxygen/gen-doxygen.py + ''; + outputs = [ "out" ] ++ lib.optionals withDocumentation [ "doc" "man" ]; separateDebugInfo = true; @@ -54,10 +55,6 @@ stdenv.mkDerivation rec { "-Ddocumentation=${lib.boolToString withDocumentation}" ]; - postPatch = lib.optionalString withDocumentation '' - patchShebangs doc/doxygen/gen-doxygen.py - ''; - depsBuildBuild = [ pkg-config ];