<commit_before>/*

# New packages

READ THIS FIRST

This module is for official packages in KDE Plasma 5. All available packages are
listed in `./srcs.nix`, although a few are not yet packaged in Nixpkgs (see
below).

IF YOUR PACKAGE IS NOT LISTED IN `./srcs.nix`, IT DOES NOT GO HERE.

Many of the packages released upstream are not yet built in Nixpkgs due to lack
of demand. To add a Nixpkgs build for an upstream package, copy one of the
existing packages here and modify it as necessary.

# Updates

1. Update the URL in `./fetch.sh`.
2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/desktops/plasma-5`
   from the top of the Nixpkgs tree.
3. Use `nox-review wip` to check that everything builds.
4. Commit the changes and open a pull request.

*/

{
  libsForQt5, lib, fetchurl,
  gconf, gsettings-desktop-schemas
}:

let
  srcs = import ./srcs.nix {
    inherit fetchurl;
    mirror = "mirror://kde";
  };

  mkDerivation = libsForQt5.callPackage ({ mkDerivation }: mkDerivation) {};

  packages = self: with self;
    let

      propagate = out:
        let setupHook = { writeScript }:
              writeScript "setup-hook" ''
                if [[ "''${hookName-}" != postHook ]]; then
                    postHooks+=("source @dev@/nix-support/setup-hook")
                else
                    # Propagate $${out} output
                    propagatedUserEnvPkgs+=" @${out}@"

                    if [ -z "$outputDev" ]; then
                        echo "error: \$outputDev is unset!" >&2
                        exit 1
                    fi

                    # Propagate $dev so that this setup hook is propagated
                    # But only if there is a separate $dev output
                    if [ "$outputDev" != out ]; then
                        propagatedBuildInputs+=" @dev@"
                    fi
                fi
              '';
        in callPackage setupHook {};

      propagateBin = propagate "bin";

      callPackage = self.newScope {
        inherit propagate propagateBin;

        mkDerivation = args:
          let
            inherit (args) name;
            sname = args.sname or name;
            inherit (srcs.${sname}) src version;

            outputs = args.outputs or [ "out" ];
            hasBin = lib.elem "bin" outputs;
            hasDev = lib.elem "dev" outputs;

            defaultSetupHook = if hasBin && hasDev then propagateBin else null;
            setupHook = args.setupHook or defaultSetupHook;

            meta = {
              license = with lib.licenses; [
                lgpl21Plus lgpl3Plus bsd2 mit gpl2Plus gpl3Plus fdl12
              ];
              platforms = lib.platforms.linux;
              maintainers = with lib.maintainers; [ ttuegel nyanloutre ];
              homepage = "http://www.kde.org";
            } // (args.meta or {});
          in
          mkDerivation (args // {
            name = "${name}-${version}";
            inherit meta outputs setupHook src;
          });
      };

    in {<commit_msg>plasma5: mark broken with Qt >= 5.15<commit_after>/*

# New packages

READ THIS FIRST

This module is for official packages in KDE Plasma 5. All available packages are
listed in `./srcs.nix`, although a few are not yet packaged in Nixpkgs (see
below).

IF YOUR PACKAGE IS NOT LISTED IN `./srcs.nix`, IT DOES NOT GO HERE.

Many of the packages released upstream are not yet built in Nixpkgs due to lack
of demand. To add a Nixpkgs build for an upstream package, copy one of the
existing packages here and modify it as necessary.

# Updates

1. Update the URL in `./fetch.sh`.
2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/desktops/plasma-5`
   from the top of the Nixpkgs tree.
3. Use `nox-review wip` to check that everything builds.
4. Commit the changes and open a pull request.

*/

{
  libsForQt5, lib, fetchurl,
  gconf, gsettings-desktop-schemas
}:

let
  srcs = import ./srcs.nix {
    inherit fetchurl;
    mirror = "mirror://kde";
  };

  mkDerivation = libsForQt5.callPackage ({ mkDerivation }: mkDerivation) {};
  qtbase = libsForQt5.callPackage ({ qtbase }: qtbase) {};

  packages = self: with self;
    let

      propagate = out:
        let setupHook = { writeScript }:
              writeScript "setup-hook" ''
                if [[ "''${hookName-}" != postHook ]]; then
                    postHooks+=("source @dev@/nix-support/setup-hook")
                else
                    # Propagate $${out} output
                    propagatedUserEnvPkgs+=" @${out}@"

                    if [ -z "$outputDev" ]; then
                        echo "error: \$outputDev is unset!" >&2
                        exit 1
                    fi

                    # Propagate $dev so that this setup hook is propagated
                    # But only if there is a separate $dev output
                    if [ "$outputDev" != out ]; then
                        propagatedBuildInputs+=" @dev@"
                    fi
                fi
              '';
        in callPackage setupHook {};

      propagateBin = propagate "bin";

      callPackage = self.newScope {
        inherit propagate propagateBin;

        mkDerivation = args:
          let
            inherit (args) name;
            sname = args.sname or name;
            inherit (srcs.${sname}) src version;

            outputs = args.outputs or [ "out" ];
            hasBin = lib.elem "bin" outputs;
            hasDev = lib.elem "dev" outputs;

            defaultSetupHook = if hasBin && hasDev then propagateBin else null;
            setupHook = args.setupHook or defaultSetupHook;

            meta = {
              broken = lib.versionAtLeast qtbase.version "5.15";
              license = with lib.licenses; [
                lgpl21Plus lgpl3Plus bsd2 mit gpl2Plus gpl3Plus fdl12
              ];
              platforms = lib.platforms.linux;
              maintainers = with lib.maintainers; [ ttuegel nyanloutre ];
              homepage = "http://www.kde.org";
            } // (args.meta or {});
          in
          mkDerivation (args // {
            name = "${name}-${version}";
            inherit meta outputs setupHook src;
          });
      };

    in {
{'fraction_non_alphanumeric': 0.09745419166531538, 'fraction_numerical': 0.007134749473001459, 'mean_word_length': 1.6922741161065038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6626912', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1703, 'n_words': 579}