|
614 | 614 | "--enable-static" |
615 | 615 | ]; |
616 | 616 | }); |
617 | | - cairo = previous.cairo.overrideAttrs (old: { dontDisableStatic = true; }); |
| 617 | + cairo = (previous.cairo.overrideAttrs (old: { dontDisableStatic = true; })).override { |
| 618 | + # Disabling OpenGL support for now because I don't know if statically |
| 619 | + # linking it is possible (it may depend on the hardware). |
| 620 | + libGLSupported = false; |
| 621 | + glSupport = false; |
| 622 | + }; |
618 | 623 | libpng = previous.libpng.overrideAttrs (old: { dontDisableStatic = true; }); |
619 | 624 | libpng_apng = previous.libpng_apng.overrideAttrs (old: { dontDisableStatic = true; }); |
620 | 625 | libpng12 = previous.libpng12.overrideAttrs (old: { dontDisableStatic = true; }); |
@@ -642,20 +647,45 @@ let |
642 | 647 | dbus = previous.dbus.overrideAttrs (old: { dontDisableStatic = true; }); |
643 | 648 | utillinuxMinimal = previous.utillinuxMinimal.overrideAttrs (old: { dontDisableStatic = true; }); |
644 | 649 |
|
645 | | - libxcb = previous.xorg.libxcb.overrideAttrs (old: { dontDisableStatic = true; }); |
646 | | - libX11 = previous.xorg.libX11.overrideAttrs (old: { dontDisableStatic = true; }); |
647 | | - libXau = previous.xorg.libXau.overrideAttrs (old: { dontDisableStatic = true; }); |
648 | | - libXcursor = previous.xorg.libXcursor.overrideAttrs (old: { dontDisableStatic = true; }); |
649 | | - libXdmcp = previous.xorg.libXdmcp.overrideAttrs (old: { dontDisableStatic = true; }); |
650 | | - libXext = previous.xorg.libXext.overrideAttrs (old: { dontDisableStatic = true; }); |
651 | | - libXtst = previous.xorg.libXtst.overrideAttrs (old: { dontDisableStatic = true; }); |
652 | | - libXfixes = previous.xorg.libXfixes.overrideAttrs (old: { dontDisableStatic = true; }); |
653 | | - libXi = previous.xorg.libXi.overrideAttrs (old: { dontDisableStatic = true; }); |
654 | | - libXinerama = previous.xorg.libXinerama.overrideAttrs (old: { dontDisableStatic = true; }); |
655 | | - libXrandr = previous.xorg.libXrandr.overrideAttrs (old: { dontDisableStatic = true; }); |
656 | | - libXrender = previous.xorg.libXrender.overrideAttrs (old: { dontDisableStatic = true; }); |
657 | | - libXScrnSaver = previous.xorg.libXScrnSaver.overrideAttrs (old: { dontDisableStatic = true; }); |
658 | | - libXxf86vm = previous.xorg.libXxf86vm.overrideAttrs (old: { dontDisableStatic = true; }); |
| 650 | + # Note that the addition of `xorg.*` packages to the global |
| 651 | + # package set available to derivation (`callPackage`) arguments |
| 652 | + # is set up here: |
| 653 | + # https://github.com/NixOS/nixpkgs/blob/9a2c7caa43f1cb83b3efd156de35aea85196f32f/pkgs/top-level/splice.nix#L125-L132 |
| 654 | + # According to `clever`, the right place to override them should |
| 655 | + # be inside `xorg` and then the top-level ones should be |
| 656 | + # overridden automatically. |
| 657 | + # |
| 658 | + # Btw, creating overridable scopes works like this: |
| 659 | + # https://github.com/cleverca22/nix-tests/blob/22a32a1c43162817dba0cd9dd6f2b35590582e63/kexec/simple-test.nix#L52 |
| 660 | + xorg = previous.xorg.overrideScope' (final_xorg: previous_xorg: |
| 661 | + lib.mapAttrs |
| 662 | + (name: value: value.overrideAttrs (old: { dontDisableStatic = true; })) |
| 663 | + previous_xorg |
| 664 | + ); |
| 665 | + epoxy = previous.epoxy.override { |
| 666 | + enableStatic = true; |
| 667 | + enableEgl = false; |
| 668 | + }; |
| 669 | + graphite2 = previous.graphite2.override { enableStatic = true; }; |
| 670 | + harfbuzz = previous.harfbuzz.override { enableStatic = true; }; |
| 671 | + wayland = previous.wayland.override { enableStatic = true; }; |
| 672 | + |
| 673 | + at-spi2-atk = previous.at-spi2-atk.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 674 | + at-spi2-core = previous.at-spi2-core.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 675 | + atk = previous.atk.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 676 | + fribidi = previous.fribidi.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 677 | + gdk-pixbuf = previous.gdk-pixbuf.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 678 | + glib = previous.glib.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 679 | + libxkbcommon = previous.libxkbcommon.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 680 | + pango = previous.pango.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 681 | + # mesa_glu = previous.mesa_glu.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 682 | + libglvnd = previous.libglvnd.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 683 | + |
| 684 | + # Changing `shared_library` -> `library` and using `-Ddefault_library=both` |
| 685 | + # in mesa did not work for me (still to investigate why), but doing the |
| 686 | + # same with `-Ddefault_library=static` worked. |
| 687 | + # mesa = previous.mesa.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=both" ]; }); |
| 688 | + mesa = previous.mesa.overrideAttrs (old: { mesonFlags = (old.mesonFlags or []) ++ [ "-Ddefault_library=static" ]; }); |
659 | 689 |
|
660 | 690 | SDL2 = previous.SDL2.overrideAttrs (old: { dontDisableStatic = true; }); |
661 | 691 | SDL2_gfx = previous.SDL2_gfx.overrideAttrs (old: { dontDisableStatic = true; }); |
|
669 | 699 |
|
670 | 700 | openssl = previous.openssl.override { static = true; }; |
671 | 701 |
|
| 702 | + # Disabling kerberos support for now, as openssh's `./configure` fails to |
| 703 | + # detect its functions due to linker error, so the build breaks, see #68. |
| 704 | + openssh = previous.openssh.override { withKerberos = false; }; |
| 705 | + |
672 | 706 | krb5 = previous.krb5.override { |
673 | 707 | # Note [krb5 can only be static XOR shared] |
674 | 708 | # krb5 does not support building both static and shared at the same time. |
@@ -711,11 +745,16 @@ let |
711 | 745 | doCheck = false; |
712 | 746 | }); |
713 | 747 |
|
714 | | - gtk3 = previous.gtk3.overrideAttrs (old: { |
| 748 | + gtk3 = (previous.gtk3.overrideAttrs (old: { |
715 | 749 | mesonFlags = (old.mesonFlags or []) ++ [ |
| 750 | + # Just `static` doesn't currently work, the `g-ir-scanner` fails during gtk's build then. |
716 | 751 | "-Ddefault_library=both" |
717 | 752 | #"-Dintrospection=false" |
718 | 753 | ]; |
| 754 | + })).override (old_gtk3: { |
| 755 | + # Wayland requires EGL support for which we have not figured out yet |
| 756 | + # whether it can be statically linked. |
| 757 | + waylandSupport = false; |
719 | 758 | }); |
720 | 759 |
|
721 | 760 | gtk4 = (previous.gtk3.override { |
|
809 | 848 | meson, ninja, pkgconfig, gtk3, |
810 | 849 | pcre_static, |
811 | 850 | zlib_both, |
| 851 | + bzip2_static, |
812 | 852 | harfbuzz, |
813 | 853 | libpthreadstubs, |
814 | 854 | libXdmcp, |
|
820 | 860 | at-spi2-core, |
821 | 861 | dbus, |
822 | 862 | libXtst, |
| 863 | + libGL, |
| 864 | + mesa, |
| 865 | + binutils, |
823 | 866 | }: final.stdenv.mkDerivation { |
824 | 867 | pname = "meson-tutorial-gtk"; |
825 | 868 | version = "0.0.1"; |
|
829 | 872 | gtk3 |
830 | 873 | pcre_static |
831 | 874 | zlib_both |
| 875 | + bzip2_static |
832 | 876 | harfbuzz |
833 | 877 | libpthreadstubs |
834 | 878 | libXdmcp |
|
840 | 884 | at-spi2-core |
841 | 885 | dbus |
842 | 886 | libXtst |
| 887 | + libGL |
| 888 | + mesa |
843 | 889 | ]; |
844 | 890 | preConfigure = '' |
845 | 891 | echo |
@@ -1283,32 +1329,14 @@ let |
1283 | 1329 | # Most likely it is because the `libX*` packages are available once on the top-level |
1284 | 1330 | # namespace (where we override them), and once under `xorg.libX*`, where we don't |
1285 | 1331 | # override them; it seems that `X11` depends on the latter. |
1286 | | - # Note that the addition of `xorg.*` packages to the global |
1287 | | - # package set available to derivation (`callPackage`) arguments |
1288 | | - # is set up here: |
1289 | | - # https://github.com/NixOS/nixpkgs/blob/9a2c7caa43f1cb83b3efd156de35aea85196f32f/pkgs/top-level/splice.nix#L125-L132 |
1290 | | - # According to `clever`, the right place to override them should |
1291 | | - # be inside `xorg` and then the top-level ones should be |
1292 | | - # overridden automatically. |
1293 | 1332 | X11 = super.X11.override { |
1294 | 1333 | libX11 = final.libX11; |
1295 | 1334 | libXext = final.libXext; |
1296 | 1335 | libXinerama = final.libXinerama; |
1297 | 1336 | libXrandr = final.libXrandr; |
1298 | 1337 | libXrender = final.libXrender; |
1299 | 1338 | libXScrnSaver = final.libXScrnSaver; |
1300 | | - |
1301 | 1339 | }; |
1302 | | - xorg = super.xorg.override (old: { |
1303 | | - libX11 = final.libX11; |
1304 | | - libXext = final.libXext; |
1305 | | - libXinerama = final.libXinerama; |
1306 | | - libXrandr = final.libXrandr; |
1307 | | - libXrender = final.libXrender; |
1308 | | - libXScrnSaver = final.libXScrnSaver; |
1309 | | - |
1310 | | - libXtst = final.libXtst; |
1311 | | - }); |
1312 | 1340 |
|
1313 | 1341 |
|
1314 | 1342 | # Note that xmonad links, but it doesn't run, because it tries to open |
|
0 commit comments