liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 612d6d7a51988a765cfae29cc573318f6ccca775
parent e1ae986cf66c396f6d5970735abd2042c99ead1f
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 24 Jul 2024 21:12:52 +0100

build openssl without threads to avoid stdatomic

Diffstat:
Moverlay.nix | 42+++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/overlay.nix b/overlay.nix @@ -177,21 +177,33 @@ extraPkgs // { ]; }); - openssl = prev.openssl.overrideAttrs (o: { - # we want to apply - # https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch"; - # which disables overriding the -march cflags to the wrong values, - # but openssl is used for bootstrapping so that's easier said than - # done. Do it the ugly way.. - postPatch = - o.postPatch - + ( - with final; - lib.optionalString ( - stdenv.buildPlatform != stdenv.hostPlatform - ) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n" - ); - }); + openssl = prev.openssl.overrideAttrs (o: + with final; + let cross = stdenv.buildPlatform != stdenv.hostPlatform; + in + { + # we want to apply + # https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch"; + # which disables overriding the -march cflags to the wrong values, + # but openssl is used for bootstrapping so that's easier said than + # done. Do it the ugly way.. + postPatch = + o.postPatch + + ( + lib.optionalString cross '' + sed -i.bak 's/linux.*-mips/linux-mops/' Configure + '' + ); + # openssl with threads requires stdatomic which drags in libgcc + # as a dependency + configureFlags = [] + ++ (lib.optional cross "no-threads") + ++ o.configureFlags; + + # don't need or want this bash script + postInstall = o.postInstall + + (lib.optionalString cross "rm $bin/bin/c_rehash\n"); + }); pppBuild = prev.ppp;