Unverified Commit e5d7fa1e authored by Ryan Lahfa's avatar Ryan Lahfa Committed by GitHub
Browse files

Merge pull request #265924 from RaitoBezarius/nix_23

parents 7ddfd3f6 94a5cfaa
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
{ lib, fetchFromGitHub
{ lib
, fetchFromGitHub
, version
, suffix ? ""
, hash ? null
, src ? fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = version; inherit hash; }
, patches ? [ ]
, maintainers ? with lib.maintainers; [ eelco lovesegfault artturin ]
}:
assert (hash == null) -> (src != null);
let
@@ -27,6 +29,8 @@ in
, callPackage
, coreutils
, curl
, docbook_xsl_ns
, docbook5
, editline
, flex
, gnutar
@@ -37,6 +41,8 @@ in
, libarchive
, libcpuid
, libsodium
, libxml2
, libxslt
, lowdown
, mdbook
, mdbook-linkcheck
@@ -86,13 +92,17 @@ self = stdenv.mkDerivation {

  nativeBuildInputs = [
    pkg-config
  ] ++ lib.optionals atLeast24 [
    autoconf-archive
    autoreconfHook
    bison
    flex
    jq
  ] ++ lib.optionals (atLeast24 && enableDocumentation) [
  ] ++ lib.optionals (enableDocumentation && !atLeast24) [
    libxslt
    libxml2
    docbook_xsl_ns
    docbook5
  ] ++ lib.optionals (enableDocumentation && atLeast24) [
    (lib.getBin lowdown)
    mdbook
  ] ++ lib.optionals (atLeast213 && enableDocumentation) [
@@ -111,13 +121,12 @@ self = stdenv.mkDerivation {
    openssl
    sqlite
    xz
  ] ++ lib.optionals stdenv.isDarwin [
    Security
  ] ++ lib.optionals atLeast24 [
    gtest
    libarchive
    lowdown
  ] ++ lib.optionals (atLeast24 && stdenv.isx86_64) [
  ] ++ lib.optionals stdenv.isDarwin [
    Security
  ] ++ lib.optionals (stdenv.isx86_64) [
    libcpuid
  ] ++ lib.optionals atLeast214 [
    rapidcheck
@@ -133,13 +142,6 @@ self = stdenv.mkDerivation {
    nlohmann_json
  ];

  NIX_LDFLAGS = lib.optionals (!atLeast24) [
    # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba
    (lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto")
    # https://github.com/NixOS/nix/commits/74b4737d8f0e1922ef5314a158271acf81cd79f8
    (lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux" || stdenv.hostPlatform.system == "armv6l-linux") "-latomic")
  ];

  postPatch = ''
    patchShebangs --build tests
  '';
@@ -180,9 +182,6 @@ self = stdenv.mkDerivation {
    "--enable-gc"
  ] ++ lib.optionals (!enableDocumentation) [
    "--disable-doc-gen"
  ] ++ lib.optionals (!atLeast24) [
    # option was removed in 2.4
    "--disable-init-state"
  ] ++ lib.optionals atLeast214 [
    "CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include"
  ] ++ lib.optionals stdenv.isLinux [
@@ -246,7 +245,7 @@ self = stdenv.mkDerivation {
    '';
    homepage = "https://nixos.org/";
    license = licenses.lgpl2Plus;
    maintainers = with maintainers; [ eelco lovesegfault artturin ];
    inherit maintainers;
    platforms = platforms.unix;
    outputsToInstall = [ "out" ] ++ optional enableDocumentation "man";
    mainProgram = "nix";
+4 −6
Original line number Diff line number Diff line
@@ -145,15 +145,13 @@ let
    pkg;

in lib.makeExtensible (self: ({
  nix_2_3 = (common rec {
    version = "2.3.16";
    src = fetchurl {
      url = "https://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz";
      hash = "sha256-fuaBtp8FtSVJLSAsO+3Nne4ZYLuBj2JpD2xEk7fCqrw=";
    };
  nix_2_3 = (common {
    version = "2.3.17";
    hash = "sha256-EK0pgHDekJFqr0oMj+8ANIjq96WPjICe2s0m4xkUdH4=";
    patches = [
      patch-monitorfdhup
    ];
    maintainers = with lib.maintainers; [ flokli raitobezarius ];
  }).override { boehmgc = boehmgc-nix_2_3; };

  nix_2_10 = common {