<commit_before>{ mkDerivation
, stdenv

, opencv3_1

# library dependencies
, aeson
, base
, base64-bytestring
, bindings-DSL
, bytestring
, containers
, deepseq
, inline-c
, inline-c-cpp
, linear
, primitive
, repa
, template-haskell
, text
, transformers
, vector

# test dependencies
, directory
, Glob
, haskell-src-exts
, QuickCheck
, tasty
, tasty-hunit
, tasty-quickcheck

# benchmark dependencies
, criterion
}:
mkDerivation {
  pname = "opencv";
  version = "0.0.0";
  src = ./.;

  libraryHaskellDepends = [
    aeson
    base
    base64-bytestring
    bindings-DSL
    bytestring
    containers
    deepseq
    inline-c
    inline-c-cpp
    linear
    primitive
    repa
    template-haskell
    text
    transformers
    vector
  ];

  testHaskellDepends = [
    base
    containers
    directory
    Glob
    haskell-src-exts
    QuickCheck
    tasty
    tasty-hunit
    tasty-quickcheck

    criterion
  ];

  libraryPkgconfigDepends = [ opencv3_1 ];

  configureFlags =
    [ "--with-gcc=g++"
      "--with-ld=g++"
    ];

  preConfigure = ''
    rm -rf dist
  '';

  homepage = "https://github.com/LumiGuide/haskell-opencv";
  license = stdenv.lib.licenses.bsd3;
  maintainers = [ "<EMAIL>" ];
}<commit_msg>haskell-opencv.nix: filter out sources which aren't needed for building<commit_after>{ mkDerivation
, stdenv
, lib

, opencv3_1

# library dependencies
, aeson
, base
, base64-bytestring
, bindings-DSL
, bytestring
, containers
, deepseq
, inline-c
, inline-c-cpp
, linear
, primitive
, repa
, template-haskell
, text
, transformers
, vector

# test dependencies
, directory
, Glob
, haskell-src-exts
, QuickCheck
, tasty
, tasty-hunit
, tasty-quickcheck

# benchmark dependencies
, criterion
}:
mkDerivation {
  pname = "opencv";
  version = "0.0.0";
  src = builtins.filterSource (path: type:
          # Filter out .cpp files under ./src generated by inline-c:
            !(lib.hasPrefix (toString (./. + "/src")) (dirOf path)
              && lib.hasSuffix ".cpp" (baseNameOf path))

          # Filter out generated images:
          && !(  type != "directory"
              && (  (lib.hasSuffix "doc/generated"          (dirOf path))
                 || (lib.hasSuffix "doc/generated/examples" (dirOf path))
                 )
              )

          # Filter out .nix files so that changing them doesn't necessarily cause a rebuild:
          && !(lib.hasSuffix ".nix" (baseNameOf path))

          # Filter out some other files or directories not needed for a build:
          && !(builtins.elem (toString path) (map (p: toString (./. + "/${p}")) [
                "cabal.config"
                "Makefile"
                "README.md"
                ".git"
                ".gitignore"
                "examples"
                "dist"
              ]))
        ) ./.;

  libraryHaskellDepends = [
    aeson
    base
    base64-bytestring
    bindings-DSL
    bytestring
    containers
    deepseq
    inline-c
    inline-c-cpp
    linear
    primitive
    repa
    template-haskell
    text
    transformers
    vector
  ];

  testHaskellDepends = [
    base
    containers
    directory
    Glob
    haskell-src-exts
    QuickCheck
    tasty
    tasty-hunit
    tasty-quickcheck

    criterion
  ];

  libraryPkgconfigDepends = [ opencv3_1 ];

  configureFlags =
    [ "--with-gcc=g++"
      "--with-ld=g++"
    ];

  homepage = "https://github.com/LumiGuide/haskell-opencv";
  license = stdenv.lib.licenses.bsd3;
  maintainers = [ "<EMAIL>" ];
}
{'fraction_non_alphanumeric': 0.1148105625717566, 'fraction_numerical': 0.006888633754305396, 'mean_word_length': 2.1368136813681367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '4395629', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1155, 'n_words': 249}