|
371 | 371 |
|
372 | 372 | keyutils_static = pkgs.keyutils.overrideAttrs (old: { dontDisableStatic = true; });
|
373 | 373 |
|
| 374 | + libxcb_static = pkgs.xorg.libxcb.overrideAttrs (old: { dontDisableStatic = true; }); |
| 375 | + # We'd like to make this depend on libxcb_static somehow, but neither adding |
| 376 | + # it to `buildInputs` via `overrideAttrs`, nor setting it with `.override` |
| 377 | + # seems to have the desired effect for the eventual link of `xmonad`. |
| 378 | + # So we use a custom `--ghc-options` hack for `xmonad` below. |
| 379 | + libX11_static = pkgs.xorg.libX11.overrideAttrs (old: { dontDisableStatic = true; }); |
| 380 | + libXext_static = pkgs.xorg.libXext.overrideAttrs (old: { dontDisableStatic = true; }); |
| 381 | + libXinerama_static = pkgs.xorg.libXinerama.overrideAttrs (old: { dontDisableStatic = true; }); |
| 382 | + libXrandr_static = pkgs.xorg.libXrandr.overrideAttrs (old: { dontDisableStatic = true; }); |
| 383 | + libXrender_static = pkgs.xorg.libXrender.overrideAttrs (old: { dontDisableStatic = true; }); |
| 384 | + libXScrnSaver_static = pkgs.xorg.libXScrnSaver.overrideAttrs (old: { dontDisableStatic = true; }); |
| 385 | + libXau_static = pkgs.xorg.libXau.overrideAttrs (old: { dontDisableStatic = true; }); |
| 386 | + libXdmcp_static = pkgs.xorg.libXdmcp.overrideAttrs (old: { dontDisableStatic = true; }); |
| 387 | + |
374 | 388 | krb5_static = pkgs.krb5.override {
|
375 | 389 | # Note krb5 does not support building both static and shared at the same time.
|
376 | 390 | staticOnly = true;
|
|
641 | 655 | executableToolDepends = [ pkgs.git ];
|
642 | 656 | });
|
643 | 657 |
|
| 658 | + X11 = super.X11.override { |
| 659 | + libX11 = libX11_static; |
| 660 | + libXext = libXext_static; |
| 661 | + libXinerama = libXinerama_static; |
| 662 | + libXrandr = libXrandr_static; |
| 663 | + libXrender = libXrender_static; |
| 664 | + libXScrnSaver = libXScrnSaver_static; |
| 665 | + }; |
| 666 | + |
| 667 | + # Note that xmonad links, but it doesn't run, because it tries to open |
| 668 | + # `libgmp.so.3` at run time. |
| 669 | + xmonad = |
| 670 | + appendConfigureFlag (addStaticLinkerFlagsWithPkgconfig |
| 671 | + super.xmonad |
| 672 | + [ libxcb_static libXau_static libXdmcp_static ] |
| 673 | + "--libs xcb Xau Xdmcp") [ |
| 674 | + # The above `--libs` `pkgconfig` override seems to have no effect |
| 675 | + # but it at least makes the libraries available for manual `-l` flags. |
| 676 | + # It's also not clear why we incur a dependency on `Xdmcp` at all. |
| 677 | + "--ghc-option=-lxcb --ghc-option=-lXau --ghc-option=-lXrender --ghc-option=-lXdmcp" |
| 678 | + ]; |
| 679 | + |
644 | 680 | cryptonite =
|
645 | 681 | if integer-simple
|
646 | 682 | then disableCabalFlag super.cryptonite "integer-gmp"
|
|
0 commit comments