nixpkgs/pkgs/by-name/q-/q-text-as-data/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

43 lines
1.2 KiB
Nix

{ lib, fetchFromGitHub, python3Packages }:
python3Packages.buildPythonApplication rec {
pname = "q-text-as-data";
version = "2.0.19";
src = fetchFromGitHub {
owner = "harelba";
repo = "q";
rev = version;
sha256 = "18cwyfjgxxavclyd08bmb943c8bvzp1gnqp4klkq5xlgqwivr4sv";
};
propagatedBuildInputs = with python3Packages; [
setuptools
six
];
doCheck = false;
patchPhase = ''
# remove broken symlink
rm bin/qtextasdata.py
# not considered good practice pinning in install_requires
substituteInPlace setup.py --replace 'six==' 'six>='
'';
meta = with lib; {
description = "Run SQL directly on CSV or TSV files";
longDescription = ''
q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).
q treats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and column type detection, and provides full support for multiple encodings.
'';
homepage = "http://harelba.github.io/q/";
license = licenses.gpl3;
maintainers = [ maintainers.taneb ];
platforms = platforms.all;
mainProgram = "q";
};
}