Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a7331d1403e7
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a6916aba3ec
Choose a head ref
  • 2 commits
  • 17 files changed
  • 2 contributors

Commits on Jan 3, 2021

  1. treewide: Inline more of the static overlay

    Picking up where #107238 left off. I think I'll have gotten all the easy
    stuff with this.
    Ericson2314 committed Jan 3, 2021
    Copy the full SHA
    5c29651 View commit details

Commits on Jan 5, 2021

  1. Merge pull request #108350 from Ericson2314/no-static-overlay

    treewide: Inline more of the static overlay
    Ericson2314 authored Jan 5, 2021
    Copy the full SHA
    4a6916a View commit details
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
, rebuildBytecode ? true
, stripBytecode ? false
, includeSiteCustomize ? true
, static ? false
, static ? stdenv.hostPlatform.isStatic
# Not using optimizations on Darwin
# configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found.
, enableOptimizations ? (!stdenv.isDarwin)
9 changes: 6 additions & 3 deletions pkgs/development/libraries/cdo/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ stdenv, fetchurl, curl, hdf5, netcdf
, enable_cdi_lib ? false # build, install and link to a CDI library [default=no]
, enable_all_static ? false # build a completely statically linked CDO binary [default=no]
, enable_cxx ? false # Use CXX as default compiler [default=no]
, # build, install and link to a CDI library [default=no]
enable_cdi_lib ? false
, # build a completely statically linked CDO binary
enable_all_static ? stdenv.hostPlatform.isStatic
, # Use CXX as default compiler [default=no]
enable_cxx ? false
}:

stdenv.mkDerivation rec {
3 changes: 2 additions & 1 deletion pkgs/development/libraries/crc32c/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv, lib, fetchFromGitHub, cmake, gflags
, staticOnly ? false }:
, staticOnly ? stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
pname = "crc32c";
3 changes: 2 additions & 1 deletion pkgs/development/libraries/gsm/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv, fetchurl
, staticSupport ? false # Compile statically (support for packages that look for the static object)
, # Compile statically (support for packages that look for the static object)
staticSupport ? stdenv.hostPlatform.isStatic
}:

let
5 changes: 4 additions & 1 deletion pkgs/development/libraries/libev/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ stdenv, fetchurl, static ? false }:
{ stdenv, fetchurl
, # Note: -static hasn’t work on darwin
static ? with stdenv.hostPlatform; isStatic && !isDarwin
}:

# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
4 changes: 3 additions & 1 deletion pkgs/development/libraries/libressl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch, buildShared ? true }:
{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch
, buildShared ? !stdenv.hostPlatform.isStatic
}:

let

2 changes: 1 addition & 1 deletion pkgs/development/libraries/nghttp2/default.nix
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
, enableAsioLib ? false, boost ? null
, enableGetAssets ? false, libxml2 ? null
, enableJemalloc ? false, jemalloc ? null
, enableApp ? !stdenv.hostPlatform.isWindows
, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic
, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
}:

4 changes: 3 additions & 1 deletion pkgs/development/libraries/snappy/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetchFromGitHub, cmake, static ? false }:
{ stdenv, fetchFromGitHub, cmake
, static ? stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
pname = "snappy";
4 changes: 3 additions & 1 deletion pkgs/development/web/woff2/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ brotli, cmake, pkgconfig, fetchFromGitHub, stdenv, static ? false }:
{ brotli, cmake, pkgconfig, fetchFromGitHub, stdenv
, static ? stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
pname = "woff2";
3 changes: 2 additions & 1 deletion pkgs/os-specific/linux/kmod/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig
, libxslt, xz, elf-header
, withStatic ? false }:
, withStatic ? stdenv.hostPlatform.isStatic
}:

let
systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
33 changes: 24 additions & 9 deletions pkgs/servers/x11/xorg/overrides.nix
Original file line number Diff line number Diff line change
@@ -74,23 +74,27 @@ self: super:
mkfontdir = self.mkfontscale;

libxcb = super.libxcb.overrideAttrs (attrs: {
configureFlags = [ "--enable-xkb" "--enable-xinput" ];
configureFlags = [ "--enable-xkb" "--enable-xinput" ]
++ stdenv.lib.optional stdenv.hostPlatform.isStatic "--disable-shared";
outputs = [ "out" "dev" "man" "doc" ];
});

libX11 = super.libX11.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
depsBuildBuild = [ buildPackages.stdenv.cc ];
depsBuildBuild = [
buildPackages.stdenv.cc
] ++ stdenv.lib.optionals stdenv.hostPlatform.isStatic [
(self.buildPackages.stdenv.cc.libc.static or null)
];
preConfigure = ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
'';
postInstall =
''
# Remove useless DocBook XML files.
rm -rf $out/share/doc
'';
postInstall = ''
# Remove useless DocBook XML files.
rm -rf $out/share/doc
'';
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ self.xorgproto ];
});
@@ -138,6 +142,11 @@ self: super:
xdpyinfo = super.xdpyinfo.overrideAttrs (attrs: {
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
preConfigure = attrs.preConfigure or ""
# missing transitive dependencies
+ stdenv.lib.optionalString stdenv.hostPlatform.isStatic ''
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -lXau -lXdmcp"
'';
});

# Propagate some build inputs because of header file dependencies.
@@ -223,8 +232,9 @@ self: super:
libXi = super.libXi.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ self.libXfixes ];
configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"xorg_cv_malloc0_returns_null=no";
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"xorg_cv_malloc0_returns_null=no"
] ++ stdenv.lib.optional stdenv.hostPlatform.isStatic "--disable-shared";
});

libXinerama = super.libXinerama.overrideAttrs (attrs: {
@@ -745,6 +755,11 @@ self: super:

xauth = super.xauth.overrideAttrs (attrs: {
doCheck = false; # fails
preConfigure = attrs.preConfigure or ""
# missing transitive dependencies
+ stdenv.lib.optionalString stdenv.hostPlatform.isStatic ''
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -lxcb -lXau -lXdmcp"
'';
});

xcursorthemes = super.xcursorthemes.overrideAttrs (attrs: {
4 changes: 3 additions & 1 deletion pkgs/tools/compression/brotli/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetchFromGitHub, cmake, fetchpatch, staticOnly ? false }:
{ stdenv, fetchFromGitHub, cmake, fetchpatch
, staticOnly ? stdenv.hostPlatform.isStatic
}:

# ?TODO: there's also python lib in there

2 changes: 1 addition & 1 deletion pkgs/tools/compression/zstd/default.nix
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
, fixDarwinDylibNames
, file
, legacySupport ? false
, static ? false
, static ? stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
4 changes: 3 additions & 1 deletion pkgs/tools/filesystems/e2fsprogs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, buildPackages, fetchurl, fetchpatch, pkgconfig, libuuid, gettext, texinfo, shared ? true }:
{ stdenv, buildPackages, fetchurl, fetchpatch, pkgconfig, libuuid, gettext, texinfo
, shared ? !stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
pname = "e2fsprogs";
5 changes: 4 additions & 1 deletion pkgs/tools/graphics/gifsicle/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ stdenv, fetchurl, xorgproto, libXt, libX11, gifview ? false, static ? false }:
{ stdenv, fetchurl, xorgproto, libXt, libX11
, gifview ? false
, static ? stdenv.hostPlatform.isStatic
}:

with stdenv.lib;

3 changes: 2 additions & 1 deletion pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@
, gnutlsSupport ? false, gnutls ? null
, wolfsslSupport ? false, wolfssl ? null
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
, gssSupport ? !stdenv.hostPlatform.isWindows, libkrb5 ? null
, # a very sad story re static: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, libkrb5 ? null
, c-aresSupport ? false, c-ares ? null
, brotliSupport ? false, brotli ? null
}:
80 changes: 0 additions & 80 deletions pkgs/top-level/static.nix
Original file line number Diff line number Diff line change
@@ -108,18 +108,11 @@ in {
haskellStaticAdapter;
};

nghttp2 = super.nghttp2.override {
enableApp = false;
};

zlib = super.zlib.override {
# Don’t use new stdenv zlib because
# it doesn’t like the --disable-shared flag
stdenv = super.stdenv;
};
gifsicle = super.gifsicle.override {
static = true;
};
openssl = super.openssl_1_1.overrideAttrs (o: {
# OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags.
configureFlags = (removeUnknownConfigureFlags o.configureFlags);
@@ -129,86 +122,13 @@ in {
# --disable-shared flag
stdenv = super.stdenv;
};
cdo = super.cdo.override {
enable_all_static = true;
};
gsm = super.gsm.override {
staticSupport = true;
};
crc32c = super.crc32c.override {
staticOnly = true;
};
perl = super.perl.override {
# Don’t use new stdenv zlib because
# it doesn’t like the --disable-shared flag
stdenv = super.stdenv;
};
woff2 = super.woff2.override {
static = true;
};
snappy = super.snappy.override {
static = true;
};
libressl = super.libressl.override {
buildShared = false;
};

kmod = super.kmod.override {
withStatic = true;
};

curl = super.curl.override {
# a very sad story: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
gssSupport = false;
};

e2fsprogs = super.e2fsprogs.override {
shared = false;
};

brotli = super.brotli.override {
staticOnly = true;
};

zstd = super.zstd.override {
static = true;
};

ocaml-ng = self.lib.mapAttrs (_: set:
if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set
) super.ocaml-ng;

python27 = super.python27.override { static = true; };
python36 = super.python36.override { static = true; };
python37 = super.python37.override { static = true; };
python38 = super.python38.override { static = true; };
python39 = super.python39.override { static = true; };
python3Minimal = super.python3Minimal.override { static = true; };

# Note: -static doesn’t work on darwin
libev = super.libev.override { static = !super.stdenv.hostPlatform.isDarwin; };

xorg = super.xorg.overrideScope' (xorgself: xorgsuper: {
libX11 = xorgsuper.libX11.overrideAttrs (attrs: {
depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ];
});
xauth = xorgsuper.xauth.overrideAttrs (attrs: {
# missing transitive dependencies
preConfigure = attrs.preConfigure or "" + ''
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -lxcb -lXau -lXdmcp"
'';
});
xdpyinfo = xorgsuper.xdpyinfo.overrideAttrs (attrs: {
# missing transitive dependencies
preConfigure = attrs.preConfigure or "" + ''
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -lXau -lXdmcp"
'';
});
libxcb = xorgsuper.libxcb.overrideAttrs (attrs: {
configureFlags = attrs.configureFlags ++ [ "--disable-shared" ];
});
libXi= xorgsuper.libXi.overrideAttrs (attrs: {
configureFlags = attrs.configureFlags ++ [ "--disable-shared" ];
});
});
}