unison: reduce closure size when enableX11 = false

Before: /nix/store/ifqr2nhgrci0ixga4k7pk9l6mqdfsk5b-unison-2.53.2        354.3M
After:  /nix/store/4cgr7fvqry0yrr8d76a5n0ykbm3wqx14-unison-2.53.2         40.9M
This commit is contained in:
Henri Menke 2023-09-26 09:41:28 +02:00
parent e5f6200d16
commit 1b94c25f63
No known key found for this signature in database
GPG Key ID: FB7AD61E3D806382

View File

@ -6,7 +6,6 @@
, copyDesktopItems
, makeDesktopItem
, wrapGAppsHook
, glib
, gsettings-desktop-schemas
, zlib
, enableX11 ? true
@ -26,10 +25,11 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
nativeBuildInputs = [ glib wrapGAppsHook ocamlPackages.ocaml ]
++ lib.optional enableX11 copyDesktopItems;
buildInputs = [ gsettings-desktop-schemas ncurses zlib ]
++ lib.optional stdenv.isDarwin Cocoa;
nativeBuildInputs = [ ocamlPackages.ocaml ]
++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook ];
buildInputs = [ ncurses zlib ]
++ lib.optionals enableX11 [ gsettings-desktop-schemas ]
++ lib.optionals stdenv.isDarwin [ Cocoa ];
preBuild = lib.optionalString enableX11 ''
sed -i "s|\(OCAMLOPT=.*\)$|\1 -I $(echo "${ocamlPackages.lablgtk3}"/lib/ocaml/*/site-lib/lablgtk3)|" src/Makefile.OCaml