Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

racket-minimal: build on darwin

Technically, racket compiles and packages too, but it doesn't pass all
tests yet, so the build fails.

gcc7Stdenv is GCC 7 with the MacOS-specific adaptations retained.
Building on MacOS with that works, but we should be using clang.

I'm hoping that the next person wanting to override the compiler
version in some other derivation sees that attribute and doesn't
inadvertently break a MacOS build again.

+12 -4
+7 -2
pkgs/development/interpreters/racket/default.nix
··· 4 4 , libpng, libtool, mpfr, openssl, pango, poppler 5 5 , readline, sqlite 6 6 , disableDocs ? false 7 + , CoreFoundation 7 8 }: 8 9 9 10 let ··· 47 48 48 49 FONTCONFIG_FILE = fontsConf; 49 50 LD_LIBRARY_PATH = libPath; 50 - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.cc.isGNU "-lgcc_s"; 51 + NIX_LDFLAGS = stdenv.lib.concatStringsSep " " [ 52 + (stdenv.lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s") 53 + (stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation") 54 + ]; 51 55 52 - buildInputs = [ fontconfig libffi libtool makeWrapper sqlite ]; 56 + buildInputs = [ fontconfig libffi libtool makeWrapper sqlite ] 57 + ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation ]; 53 58 54 59 preConfigure = '' 55 60 unset AR
+1 -1
pkgs/development/interpreters/racket/minimal.nix
··· 14 14 as well as libraries that live in collections. In particular, raco 15 15 and the pkg library are still bundled. 16 16 ''; 17 - platforms = [ "x86_64-linux" "aarch64-linux" ]; 17 + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; 18 18 }; 19 19 })
+4 -1
pkgs/top-level/all-packages.nix
··· 5822 5822 extraBuildInputs = lib.optional hostPlatform.isDarwin clang.cc; 5823 5823 }; 5824 5824 5825 + gcc7Stdenv = overrideCC gccStdenv gcc7; 5826 + 5825 5827 wrapCCMulti = cc: 5826 5828 if system == "x86_64-linux" then let 5827 5829 # Binutils with glibc multi ··· 7102 7104 # racket 6.11 doesn't build with gcc6 + recent glibc: 7103 7105 # https://github.com/racket/racket/pull/1886 7104 7106 # https://github.com/NixOS/nixpkgs/pull/31017#issuecomment-343574769 7105 - stdenv = overrideCC stdenv gcc7; 7107 + stdenv = if stdenv.isDarwin then stdenv else gcc7Stdenv; 7108 + inherit (darwin.apple_sdk.frameworks) CoreFoundation; 7106 7109 }; 7107 7110 racket-minimal = callPackage ../development/interpreters/racket/minimal.nix { }; 7108 7111