Unverified Commit ee64092a authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

Merge master into staging-nixos

parents faba8a4a 13043924
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -291,14 +291,17 @@ Some of them are as follows:
* *vendor* - can point to the source of the package, or to Nixpkgs itself
* *product* - name of the package
* *version* - version of the package
* *update* - name of the latest update, can be a patch version for semantically versioned packages
* *edition* - any additional specification about the version
* *update* - vendor-specific string part of the version string of the latest update (e.g. `rc1`, `beta`, etc...)
* *edition* - deprecated and should be set to `*`

You can find information about all of these attributes in the [official specification](https://csrc.nist.gov/projects/security-content-automation-protocol/specifications/cpe/naming) (heading 5.3.3, pages 11-13).

Any fields that don't have a value are set to either `-` if the value is not available or `*` when the field can match any value.
Any fields that don't have a value are set to either:

For example, for glibc 2.40.1 CPE would be `cpe:2.3:a:gnu:glibc:2.40:1:*:*:*:*:*:*`.
* `*` (ANY) when the field can match any value
* `-` (NA) when the value is not meaningful or not used in the description

For example, for glibc 2.40.1 CPE would be `cpe:2.3:a:gnu:glibc:2.40.1:*:*:*:*:*:*:*`.

#### `meta.identifiers.cpeParts` {#var-meta-identifiers-cpeParts}

@@ -314,14 +317,13 @@ It is up to the package author to make sure all parts are correct and match expe
Following functions help with filling out `version` and `update` fields:

* [`lib.meta.cpeFullVersionWithVendor`](#function-library-lib.meta.cpeFullVersionWithVendor)
* [`lib.meta.cpePatchVersionInUpdateWithVendor`](#function-library-lib.meta.cpePatchVersionInUpdateWithVendor)

For many packages to make CPE available it should be enough to specify only:

```nix
{
  # ...
  meta.identifiers.cpeParts = lib.meta.cpePatchVersionInUpdateWithVendor vendor version;
  meta.identifiers.cpeParts = lib.meta.cpeFullVersionWithVendor vendor version;
}
```

+0 −128
Original line number Diff line number Diff line
@@ -633,132 +633,4 @@ rec {
    update = "*";
  };

  /**
    Alternate version of [`lib.meta.cpePatchVersionInUpdateWithVendor`](#function-library-lib.meta.cpePatchVersionInUpdateWithVendor).
    If `cpePatchVersionInUpdateWithVendor` succeeds, returns an attribute set with `success` set to `true` and `value` set to the result.
    Otherwise, `success` is set to `false` and `error` is set to the string representation of the error.

    # Inputs

    `vendor`

    : package's vendor

    `version`

    : package's version

    # Type

    ```
    tryCPEPatchVersionInUpdateWithVendor :: String -> String -> ({ success = true; value :: { update :: String; vendor :: String; version :: String; }; } | { success = false; error :: String; })
    ```

    # Examples
    :::{.example}
    ## `lib.meta.tryCPEPatchVersionInUpdateWithVendor` usage example

    ```nix
    lib.meta.tryCPEPatchVersionInUpdateWithVendor "gnu" "1.2.3"
    => {
      success = true;
      value = {
        vendor = "gnu";
        version = "1.2";
        update = "3";
      };
    }
    ```

    :::
    :::{.example}
    ## `lib.meta.cpePatchVersionInUpdateWithVendor` error example

    ```nix
    lib.meta.tryCPEPatchVersionInUpdateWithVendor "gnu" "5.3p0"
    => {
      success = false;
      error = "version 5.3p0 doesn't match regex `([0-9]+\\.[0-9]+)\\.([0-9]+)`";
    }
    ```

    :::
  */
  tryCPEPatchVersionInUpdateWithVendor =
    vendor: version:
    let
      regex = "([0-9]+\\.[0-9]+)\\.([0-9]+)";
      # we have to call toString here in case version is an attrset with __toString attribute
      versionMatch = builtins.match regex (toString version);
    in
    if versionMatch == null then
      {
        success = false;
        error = "version ${version} doesn't match regex `${regex}`";
      }
    else
      {
        success = true;
        value = {
          inherit vendor;
          version = elemAt versionMatch 0;
          update = elemAt versionMatch 1;
        };
      };

  /**
    Generate [CPE parts](#var-meta-identifiers-cpeParts) from inputs. Copies `vendor` to the result. When `version` matches `X.Y.Z` where all parts are numerical, sets `version` and `update` fields to `X.Y` and `Z`. Throws an error if the version doesn't match the expected template.

    # Inputs

    `vendor`

    : package's vendor

    `version`

    : package's version

    # Type

    ```
    cpePatchVersionInUpdateWithVendor :: String -> String -> { update :: String; vendor :: String; version :: String; }
    ```

    # Examples
    :::{.example}
    ## `lib.meta.cpePatchVersionInUpdateWithVendor` usage example

    ```nix
    lib.meta.cpePatchVersionInUpdateWithVendor "gnu" "1.2.3"
    => {
      vendor = "gnu";
      version = "1.2";
      update = "3";
    }
    ```

    :::
    :::{.example}
    ## `lib.meta.cpePatchVersionInUpdateWithVendor` usage in derivations

    ```nix
    mkDerivation rec {
      version = "1.2.3";
      # ...
      meta = {
        # ...
        identifiers.cpeParts = lib.meta.cpePatchVersionInUpdateWithVendor "gnu" version;
      };
    }
    ```

    :::
  */
  cpePatchVersionInUpdateWithVendor =
    vendor: version:
    let
      result = tryCPEPatchVersionInUpdateWithVendor vendor version;
    in
    if result.success then result.value else throw result.error;
}
+27 −0
Original line number Diff line number Diff line
@@ -1401,6 +1401,33 @@ let

          leaf-defaults = ignoreCompilationError super.leaf-defaults; # elisp error

          liberime = super.liberime.overrideAttrs (
            let
              libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
            in
            prevAttrs: {
              buildInputs = prevAttrs.buildInputs ++ [
                pkgs.librime
              ];
              nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [
                pkgs.which
              ];
              postBuild =
                prevAttrs.postBuild or ""
                + "\n"
                + ''
                  make CC=$CC SUFFIX=${libExt}
                '';
              postInstall =
                prevAttrs.postInstall or ""
                + "\n"
                + ''
                  rm -rv $out/share/emacs/site-lisp/elpa/liberime-*/{src,emacs-module,Makefile}
                  install src/liberime-core${libExt} $out/share/emacs/site-lisp/elpa/liberime-*
                '';
            }
          );

          # https://github.com/abo-abo/lispy/pull/683
          # missing optional dependencies
          lispy = addPackageRequires (mkHome super.lispy) [ self.indium ];
+3 −3
Original line number Diff line number Diff line
@@ -1004,13 +1004,13 @@
    "vendorHash": "sha256-ucXmHK7jrahc78nE2cf5p5PPCSNV5DAQ53KM2SfJnjo="
  },
  "okta_okta": {
    "hash": "sha256-sr3Q39Lx47+OT4alUEic7PBvtZKTwQ9Do15YfbVn9b4=",
    "hash": "sha256-Ub41ML88NKsMC6q1C67DCBTrG9qD0cBhAkizZdIRRBc=",
    "homepage": "https://registry.terraform.io/providers/okta/okta",
    "owner": "okta",
    "repo": "terraform-provider-okta",
    "rev": "v6.6.1",
    "rev": "v6.9.0",
    "spdx": "MPL-2.0",
    "vendorHash": "sha256-EqXLfVayaOG/G3c6EkgQoPGNwnG2qKSlDo2ai/onmQE="
    "vendorHash": "sha256-0NaqVCibwiK7WY6hIFGd2kB/okyh6ZsZ+BAe5mGP38A="
  },
  "oktadeveloper_oktaasa": {
    "hash": "sha256-2LhxgowqKvDDDOwdznusL52p2DKP+UiXALHcs9ZQd0U=",
+5 −10
Original line number Diff line number Diff line
@@ -10,13 +10,13 @@
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "check-sieve";
  version = "0.11";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "dburkart";
    repo = "check-sieve";
    tag = "check-sieve-${finalAttrs.version}";
    hash = "sha256-vmfHXjcZ5J/+kO3/a0p8krLOuC67+q8SxcPJgW+UaTw=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-dElVfLSVtlELleuxCScR6BGuLsJ+KRqcNA8y0lgrBfI=";
  };

  nativeBuildInputs = [
@@ -28,8 +28,6 @@ stdenv.mkDerivation (finalAttrs: {
    (python3.withPackages (p: [ p.setuptools ]))
  ];

  # https://github.com/dburkart/check-sieve/issues/67
  # Remove after the next (>0.10) release
  env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result";

  installPhase = ''
@@ -39,17 +37,14 @@ stdenv.mkDerivation (finalAttrs: {
  '';

  preCheck = ''
    substituteInPlace test/AST/util.py \
    substituteInPlace test/{AST,simulate}/util.py \
      --replace-fail "/usr/bin/diff" "${diffutils}/bin/diff"
    # Disable flaky tests: https://github.com/dburkart/check-sieve/issues/68
    # Remove after the next (>0.10) release
    rm -rf test/{6785,7352}
  '';

  doCheck = true;

  passthru.updateScript = nix-update-script {
    extraArgs = [ "--version-regex=check-sieve-(.*)" ];
    extraArgs = [ "--version-regex=v(.*)" ];
  };

  meta = {
Loading