Commit Graph

75 Commits

Author SHA1 Message Date
John Ericson
f110a182a6 stdenv: Fix overriding + overrideAttrs
The old stdenv adapters were subtly wrong in two ways:

 - `overrideAttrs` leaked the original, unoverridden `mkDerivation`.

 - `stdenv.override` would throw away any manually-set `mkDerivation`
   from a stdenv reverting to the original.

Now, `mkDerivation` is controlled (nearly directly) via an argument, and
always correctly closes over the final ("self") stdenv. This means the
adapters can work entirely via `.override` without any manual `stdenv //
...`, and both those issues are fixed.

Note hashes are changed, because stdenvs no previously overridden like
`stdenvNoCC` and `crossLibcStdenv` now are. I had to add some
`dontDisableStatic = true` accordingly. The flip side however is that
since the overrides compose, we no longer need to override anything but
the default `stdenv` from which all the others are created.
2021-08-18 17:22:50 +00:00
Alyssa Ross
b0b5ef7286 stdenv: introduce dontAddStaticConfigureFlags
With removeUnknownConfigureFlags, it's impossible to express a package
that needs --enable-static, but will not accept --disable-shared,
without overriding the result of removeUnknownConfigureFlags _again_
in pkgs/top-level/static.nix.

It would be much better (and more in line with the rest of Nixpkgs) if
we encoded changes needed for static builds in package definitions
themselves, rather than in an ever-expanding list in static.nix.  This
is especially true when doing it in static.nix is going to require
multiple overrides to express what could be expressed with stdenv
options.

So as a step in that direction, and to fix the problem described
above, here I replace removeUnknownConfigureFlags with a new stdenv
option, dontAddStaticConfigureFlags.  With this mechanism, a package
that needs one but not both of the flags just needs to set
dontAddStaticConfigureFlags and then set up configureFlags manually
based on stdenv.hostPlatform.isStatic.
2021-06-11 14:16:05 -07:00
John Ericson
470640e7fe treewide: Do a number of no-op cleanups for cross and darwin
I am taking the non-invasive parts of #110914 to hopefully help out with #111988.

In particular:

 - Use `lib.makeScopeWithSplicing` to make the `darwin` package set have
   a proper `callPackage`.

 - Adjust Darwin `stdenv`'s overlays keeping things from the previous
   stage to not stick around too much.

 - Expose `binutilsNoLibc` / `darwin.binutilsNoLibc` to hopefully get us
   closer to a unified LLVM and GCC bootstrap.
2021-05-06 11:17:26 -04:00
sternenseemann
79cd04d14f pkgsStatic: apply stdenvAdapters to all llvm stdenvs 2021-04-02 13:55:11 +02:00
DavHau
241f38b76e pkgsStatic: comment on brotli disabled 2021-03-29 19:40:05 +07:00
DavHau
2f41b6e43c pkgsStatic: refactor to alphanumerical order 2021-03-23 12:19:50 +07:00
DavHau
6b774d4ff6 curl: fix static build 2021-03-23 12:18:09 +07:00
John Ericson
a52f9a18bf haskell: Inline static overlay
We don't force `enableStaticLibraries` for Windows or WASM because it
will just fail an assertion.
2021-01-11 03:17:29 +00:00
John Ericson
5c2965145f 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.
2021-01-03 21:46:14 +00:00
John Ericson
f52263ced0 treewide: Start to break up static overlay
We can use use `stdenv.hostPlatform.isStatic` instead, and move the
logic per package. The least opionated benefit of this is that it makes
it much easier to replace packages with modified ones, as there is no
longer any issue of overlay order.

CC @FRidh @matthewbauer
2021-01-03 19:18:16 +00:00
github-actions[bot]
7d6630d7db
Merge master into staging-next 2020-12-09 00:39:29 +00:00
Joe Hermaszewski
4fe23ed6ca libcap: fix static build
This makes the build correct when cap==null

It also patches the Makefiles so that shared libraries aren't built during the install phase
2020-12-08 05:21:05 +01:00
Matthew Bauer
805c9d4847 top-level/static.nix: put makeStaticDarwin first in staticAdapters
This needs to go first since the .override will reset the mkDerivation
function, removing any other customisations done afterwards. Kind of
hacky, but seems to work correctly right now.
2020-12-06 17:09:07 -06:00
Matthew Bauer
399ac47521 top-level/static.nix: also enable static for nixUnstable 2020-12-06 17:06:50 -06:00
Matthew Bauer
924c4ebc08 top-level/static.nix: Don’t add -static LDFLAGS in darwin
We can’t do fully static here, like "static" flag in libev does. I’m
not 100% sure if this is necessary for Linux (makeStaticBinaries
should set -static flag automatically), but leaving as is to avoid
breaking anything.
2020-12-06 17:04:36 -06:00
Nick Hu
aea7f1b540
tree-sitter: make shared/static libraries configurable 2020-11-09 18:41:20 +00:00
Silvan Mosberger
4aabac8d88
Merge pull request #86223 from pikajude/darwin-static-eval
pkgsStatic: use clang for C compiler on Darwin
2020-09-30 23:44:18 +02:00
freezeboy
160f169f03 crc32c: enable static 2020-09-22 23:10:00 -07:00
Jonathan Ringer
91bec61635
python35: remove 2020-08-12 21:57:18 -07:00
Vladimír Čunát
5bd8316b6e
Merge #91975: Misc static cross fixes (into staging) 2020-07-26 09:31:24 +02:00
Dmitry Kalinkin
f6ef3ac294
zstd: build programs and tests against the shared library 2020-07-02 12:10:15 -04:00
Symphorien Gibol
80ba806339 xorg: fix static build 2020-07-02 00:20:06 +02:00
Symphorien Gibol
1aa45698d7 libjpeg_turbo: fix static build 2020-07-01 23:47:57 +02:00
Matthew Bauer
a9924d7ab8 libexecinfo: fix building statically 2020-06-08 17:47:51 -05:00
Domen Kožar
c86af902f4 nix: allow static compilation 2020-06-08 17:47:44 -05:00
Dmitry Kalinkin
f149c7030a
arrow-cpp: 0.16.0 -> 0.17.0 2020-05-11 22:34:24 -04:00
Jude Taylor
0de6275003 pkgsStatic: fix eval on Darwin 2020-04-28 08:41:48 -07:00
Frederik Rietdijk
c392d70518 pkgsStatic.python3: fix build 2020-03-30 17:06:38 +02:00
Maximilian Bosch
79a567c883
gcc5: remove
Latest gcc5 release was in 2017[1], doesn't build with glibc 2.30[2].

[1] https://gcc.gnu.org/gcc-5/
[2] https://hydra.nixos.org/build/110408216
2020-01-28 20:11:00 +01:00
Antonio Nuno Monteiro
4b34c18e31 pkgsStatic: make OpenSSL 1.1 compile (#77542)
* pkgsStatic: make OpenSSL 1.1 compile
2020-01-16 20:02:38 +01:00
Frederik Rietdijk
5ad16cb27f Merge master into staging-next 2020-01-10 10:34:04 +01:00
Ryan Mulligan
55adc491f0
Merge pull request #77180 from anmonteiro/anmonteiro/libev-static
libev: Add statically linked `libev` to `pkgsStatic`
2020-01-09 21:28:29 -08:00
Antonio Nuno Monteiro
66f12cac09 libev: Add statically linked libev to pkgsStatic 2020-01-06 22:16:11 -08:00
Frederik Rietdijk
f4b4ef130a
Merge pull request #76659 from veprbl/pr/cmake_static_adapter
pkgsStatic: set BUILD_SHARED_LIBS=OFF for cmake
2020-01-06 11:58:18 +01:00
Frederik Rietdijk
828f93a326 Merge master into staging-next 2020-01-05 16:00:21 +01:00
Dmitry Kalinkin
bb890c4561
double-conversion: remove the "static" option
pkgsStatic.double-conversion already has CMAKE_BUILD_SHARED set to OFF.
2020-01-03 11:44:23 -05:00
Dmitry Kalinkin
4541012bdb
glog: remove the "static" option
pkgsStatic.glog already has CMAKE_BUILD_SHARED set to OFF.
2020-01-03 11:42:52 -05:00
Dmitry Kalinkin
7e2c821e58
gtest: remove the "static" option
pkgsStatic.gtest already has CMAKE_BUILD_SHARED set to OFF.
2020-01-03 11:41:19 -05:00
Frederik Rietdijk
157ca8eb75 fmt: fix static musl build 2020-01-03 12:51:45 +01:00
Frederik Rietdijk
867552957f openblas: fix static musl build 2020-01-03 12:50:47 +01:00
Tobias Mayer
207db019ce arrow-cpp: add pkgsStatic support 2019-12-31 15:05:13 +01:00
Tobias Mayer
0a21b32234 thrift: build with CMake; add pkgsStatic support 2019-12-31 15:05:13 +01:00
Tobias Mayer
a244885c63 snappy: add pkgsStatic support 2019-12-29 23:30:22 +01:00
Tobias Mayer
0aeacdeaae woff2: add pkgsStatic support 2019-12-29 23:30:21 +01:00
Tobias Mayer
812ccd8e4c gtest: add pkgsStatic support 2019-12-29 10:57:16 +01:00
Tobias Mayer
93da24ca80 gflags: add pkgsStatic support 2019-12-29 10:57:16 +01:00
Tobias Mayer
d567c7e497 glog: add pkgsStatic support 2019-12-29 10:57:16 +01:00
Tobias Mayer
15fb93ac4f double-conversion: add pkgsStatic support 2019-12-29 10:57:16 +01:00
Tobias Mayer
c06a0b2c8c zstd: build with CMake
CMake is used for static builds because the Makefile does not
offer a way to disable the shared library.
2019-12-29 10:57:15 +01:00
Roberto Di Remigio
6cc9bbe2fd
mkl: extract static libraries optionally 2019-12-19 10:12:00 +01:00