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.
This commit is contained in:
Michael Weiss 2021-04-03 13:36:34 +02:00
parent 6c59345235
commit ea099211e0
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83

View File

@ -1,16 +1,15 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, fetchpatch , substituteAll
, meson , meson
, pkg-config , pkg-config
, substituteAll
, ninja , ninja
, libffi
, libxml2
, wayland , wayland
, expat ? null # Build wayland-scanner (currently cannot be disabled as of 1.7.0) , expat
, libxml2
, withLibraries ? stdenv.isLinux , withLibraries ? stdenv.isLinux
, libffi
, withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform , withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform
, graphviz-nox , graphviz-nox
, doxygen , doxygen
@ -25,8 +24,6 @@
# Documentation is only built when building libraries. # Documentation is only built when building libraries.
assert withDocumentation -> withLibraries; assert withDocumentation -> withLibraries;
# Require the optional to be enabled until upstream fixes or removes the configure flag
assert expat != null;
let let
isCross = stdenv.buildPlatform != stdenv.hostPlatform; isCross = stdenv.buildPlatform != stdenv.hostPlatform;
in 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" ]; outputs = [ "out" ] ++ lib.optionals withDocumentation [ "doc" "man" ];
separateDebugInfo = true; separateDebugInfo = true;
@ -54,10 +55,6 @@ stdenv.mkDerivation rec {
"-Ddocumentation=${lib.boolToString withDocumentation}" "-Ddocumentation=${lib.boolToString withDocumentation}"
]; ];
postPatch = lib.optionalString withDocumentation ''
patchShebangs doc/doxygen/gen-doxygen.py
'';
depsBuildBuild = [ depsBuildBuild = [
pkg-config pkg-config
]; ];