Commit 86797b20 authored by Jan Tojnar's avatar Jan Tojnar
Browse files

Merge branch 'staging-next' into staging

Conflicts:
- pkgs/development/libraries/qt-6/default.nix
  Merge a5b92645 and 0597d865
parents 1dcd1986 ec1e6d83
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ let
    inherit (self.derivations) lazyDerivation;
    inherit (self.meta) addMetaAttrs dontDistribute setName updateName
      appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio
      hiPrioSet getLicenseFromSpdxId getExe;
      hiPrioSet getLicenseFromSpdxId getExe getExe';
    inherit (self.filesystem) pathType pathIsDirectory pathIsRegularFile;
    inherit (self.sources) cleanSourceFilter
      cleanSource sourceByRegex sourceFilesBySuffices
+20 −5
Original line number Diff line number Diff line
@@ -143,9 +143,24 @@ rec {
       => "/nix/store/am9ml4f4ywvivxnkiaqwr0hyxka1xjsf-mustache-go-1.3.0/bin/mustache"
  */
  getExe = x:
    "${lib.getBin x}/bin/${x.meta.mainProgram or (
    let
      y = x.meta.mainProgram or (
        # This could be turned into an error when 23.05 is at end of life
      lib.warn "getExe: Package ${lib.strings.escapeNixIdentifier x.meta.name or x.pname or x.name} does not have the meta.mainProgram attribute. We'll assume that the main program has the same name for now, but this behavior is deprecated, because it leads to surprising errors when the assumption does not hold. If the package has a main program, please set `meta.mainProgram` in its definition to make this warning go away. Otherwise, if the package does not have a main program, or if you don't control its definition, specify the full path to the program, such as \"\${lib.getBin foo}/bin/bar\"."
      lib.getName x
    )}";
        lib.warn "getExe: Package ${lib.strings.escapeNixIdentifier x.meta.name or x.pname or x.name} does not have the meta.mainProgram attribute. We'll assume that the main program has the same name for now, but this behavior is deprecated, because it leads to surprising errors when the assumption does not hold. If the package has a main program, please set `meta.mainProgram` in its definition to make this warning go away. Otherwise, if the package does not have a main program, or if you don't control its definition, use getExe' to specify the name to the program, such as lib.getExe' foo \"bar\"."
          lib.getName
          x
      );
    in
    getExe' x y;

  /* Get the path of a program of a derivation.

     Type: getExe' :: derivation -> string -> string
     Example:
       getExe' pkgs.hello "hello"
       => "/nix/store/g124820p9hlv4lj8qplzxw1c44dxaw1k-hello-2.12/bin/hello"
       getExe' pkgs.imagemagick "convert"
       => "/nix/store/5rs48jamq7k6sal98ymj9l4k2bnwq515-imagemagick-7.1.1-15/bin/convert"
  */
  getExe' = x: y: "${lib.getBin x}/bin/${y}";
}
+2 −2
Original line number Diff line number Diff line
@@ -629,10 +629,10 @@ rec {
            This behavior is deprecated and will throw an error in the future.''
    (let
      preLen = stringLength prefix;
      sLen = stringLength str;
    in
      if substring 0 preLen str == prefix then
        substring preLen (sLen - preLen) str
        # -1 will take the string until the end
        substring preLen (-1) str
      else
        str);

+21 −0
Original line number Diff line number Diff line
@@ -349,6 +349,27 @@ runTests {
    expected = true;
  };

  testRemovePrefixExample1 = {
    expr = removePrefix "foo." "foo.bar.baz";
    expected = "bar.baz";
  };
  testRemovePrefixExample2 = {
    expr = removePrefix "xxx" "foo.bar.baz";
    expected = "foo.bar.baz";
  };
  testRemovePrefixEmptyPrefix = {
    expr = removePrefix "" "foo";
    expected = "foo";
  };
  testRemovePrefixEmptyString = {
    expr = removePrefix "foo" "";
    expected = "";
  };
  testRemovePrefixEmptyBoth = {
    expr = removePrefix "" "";
    expected = "";
  };

  testNormalizePath = {
    expr = strings.normalizePath "//a/b//c////d/";
    expected = "/a/b/c/d/";
+18 −0
Original line number Diff line number Diff line
@@ -8724,6 +8724,11 @@
    githubId = 1927188;
    name = "karolchmist";
  };
  katexochen = {
    github = "katexochen";
    githubId = 49727155;
    name = "Paul Meyer";
  };
  kayhide = {
    email = "kayhide@gmail.com";
    github = "kayhide";
@@ -15081,6 +15086,13 @@
      fingerprint = "30BB FF3F AB0B BB3E 0435  F83C 8E8F F66E 2AE8 D970";
    }];
  };
  scm2342 = {
    name = "Sven Mattsen";
    email = "nix@sven.cc";
    matrix = "@scm:matrix.sven.cc";
    github = "scm2342";
    githubId = 154108;
  };
  scode = {
    email = "peter.schuller@infidyne.com";
    github = "scode";
@@ -17787,6 +17799,12 @@
      fingerprint = "5814 50EB 6E17 E715 7C63  E7F1 9879 8C3C 4D68 8D6D";
    }];
  };
  viluon = {
    email = "nix@viluon.me";
    github = "viluon";
    githubId = 7235381;
    name = "Ondřej Kvapil";
  };
  vincentbernat = {
    email = "vincent@bernat.ch";
    github = "vincentbernat";
Loading