Unverified Commit 20f77aa0 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge #295458: staging-next 2024-03-13

parents 41e7f036 6e6944db
Loading
Loading
Loading
Loading
+30 −14
Original line number Diff line number Diff line
@@ -67,14 +67,8 @@ NATIVE_TARGETS=(
    i686-unknown-linux-gnu
    x86_64-unknown-linux-gnu
    x86_64-unknown-linux-musl

    # TODO: add darwin here once a few prerequisites are satisfied:
    #   - bootstrap-files are factored out into a separate file
    #   - the build artifacts are factored out into an `on-server`
    #     directory. Right onw if does not match `linux` layout.
    #
    #aarch64-apple-darwin
    #x86_64-apple-darwin
    aarch64-apple-darwin
    x86_64-apple-darwin
)

is_native() {
@@ -106,6 +100,18 @@ is_cross() {
    return 1
}

nar_sri_get() {
    local ouput sri
    output=$(nix-build  --expr \
        'import <nix/fetchurl.nix> {
           url = "'"$1"'";
           unpack = true;
         }' 2>&1 || true)
    sri=$(echo "$output" | awk '/^\s+got:\s+/{ print $2 }')
    [[ -z "$sri" ]] && die "$output"
    echo "$sri"
}

# collect passed options

targets=()
@@ -222,6 +228,7 @@ EOF
          case "$fname" in
              bootstrap-tools.tar.xz) attr=bootstrapTools ;;
              busybox) attr=$fname ;;
              unpack.nar.xz) attr=unpack ;;
              *) die "Don't know how to map '$fname' to attribute name. Please update me."
          esac

@@ -231,16 +238,25 @@ EOF
              executable_arg="--executable"
              executable_nix="executable = true;"
          fi
          unpack_nix=
          if [[ $fname = *.nar.* ]]; then
              unpack_nix="unpack = true;"
              sri=$(nar_sri_get "file://$p")
          else
              sha256=$(nix-prefetch-url $executable_arg --name "$fname" "file://$p")
              [[ $? -ne 0 ]] && die "Failed to get the hash for '$p'"
              sri=$(nix-hash --to-sri "sha256:$sha256")
              [[ $? -ne 0 ]] && die "Failed to convert '$sha256' hash to an SRI form"
          fi

          # individual file entries
          cat <<EOF
  $attr = import <nix/fetchurl.nix> {
    url = "http://tarballs.nixos.org/${s3_prefix}/${nixpkgs_revision}/$fname";
    hash = "${sri}";$(printf "\n%s" "${executable_nix}")
    hash = "${sri}";$(
    [[ -n ${executable_nix} ]] && printf "\n    %s" "${executable_nix}"
    [[ -n ${unpack_nix} ]]     && printf "\n    %s" "${unpack_nix}"
)
  };
EOF
      done
+19 −3
Original line number Diff line number Diff line
@@ -101,7 +101,23 @@ let
    pre-down = "pre-down.d/";
  };

  macAddressOpt = mkOption {
  macAddressOptWifi = mkOption {
    type = types.either types.str (types.enum [ "permanent" "preserve" "random" "stable" "stable-ssid" ]);
    default = "preserve";
    example = "00:11:22:33:44:55";
    description = lib.mdDoc ''
      Set the MAC address of the interface.

      - `"XX:XX:XX:XX:XX:XX"`: MAC address of the interface
      - `"permanent"`: Use the permanent MAC address of the device
      - `"preserve"`: Don’t change the MAC address of the device upon activation
      - `"random"`: Generate a randomized value upon each connect
      - `"stable"`: Generate a stable, hashed MAC address
      - `"stable-ssid"`: Generate a stable MAC addressed based on Wi-Fi network
    '';
  };

  macAddressOptEth = mkOption {
    type = types.either types.str (types.enum [ "permanent" "preserve" "random" "stable" ]);
    default = "preserve";
    example = "00:11:22:33:44:55";
@@ -258,10 +274,10 @@ in
        '';
      };

      ethernet.macAddress = macAddressOpt;
      ethernet.macAddress = macAddressOptEth;

      wifi = {
        macAddress = macAddressOpt;
        macAddress = macAddressOptWifi;

        backend = mkOption {
          type = types.enum [ "wpa_supplicant" "iwd" ];
+1 −2
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
, scons
, boost
, ladspaH
, libcxxabi
}:

stdenv.mkDerivation (finalAttrs: {
@@ -23,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: {
      --replace "-fomit-frame-pointer -ffast-math -mfpmath=sse" "-I${boost.dev}/include -I${ladspaH}/include" \
      --replace "env.has_key('cxx')" "True" \
      --replace "env['cxx']" "'${stdenv.cc.targetPrefix}c++'" \
      --replace "-Wl,--strip-all" "${lib.optionalString stdenv.isDarwin "-L${libcxxabi}/lib"}"
      --replace "-Wl,--strip-all" ""

    substituteInPlace filters.cpp \
      --replace "LADSPA_HINT_SAMPLE_RATE, 0, 0.5" "LADSPA_HINT_SAMPLE_RATE, 0.0001, 0.5"
+12 −0
Original line number Diff line number Diff line
@@ -83,6 +83,18 @@ self: let
          rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile
        '';
      });

      # native compilation for tests/seq-tests.el never ends
      # delete tests/seq-tests.el to workaround this
      seq = super.seq.overrideAttrs (old: {
        dontUnpack = false;
        postUnpack = (old.postUnpack or "") + "\n" + ''
          local content_directory=$(echo seq-*)
          rm --verbose $content_directory/tests/seq-tests.el
          src=$PWD/$content_directory.tar
          tar --create --verbose --file=$src $content_directory
        '';
      });
    };

    elpaDevelPackages = super // overrides;
+12 −3
Original line number Diff line number Diff line
@@ -63,9 +63,6 @@ self: let
      cl-print = null; # builtin
      tle = null; # builtin
      advice = null; # builtin
      seq = if lib.versionAtLeast self.emacs.version "27"
            then null
            else super.seq;
      # Compilation instructions for the Ada executables:
      # https://www.nongnu.org/ada-mode/
      ada-mode = super.ada-mode.overrideAttrs (old: {
@@ -174,6 +171,18 @@ self: let
        '';
      });

      # native compilation for tests/seq-tests.el never ends
      # delete tests/seq-tests.el to workaround this
      seq = super.seq.overrideAttrs (old: {
        dontUnpack = false;
        postUnpack = (old.postUnpack or "") + "\n" + ''
          local content_directory=$(echo seq-*)
          rm --verbose $content_directory/tests/seq-tests.el
          src=$PWD/$content_directory.tar
          tar --create --verbose --file=$src $content_directory
        '';
      });


    };

Loading