summary refs log tree commit diff
path: root/pkgs/tools/misc/q-text-as-data
diff options
context:
space:
mode:
authorClaudio Bley <cbley@exa-online.de>2020-12-02 11:32:00 +0100
committerClaudio Bley <claudio.bley@gmail.com>2020-12-02 22:27:41 +0100
commit57ab84545b0be145372b56a4a31413ea98fed045 (patch)
tree654f93b54029414f2e47d65c00f3112074b94074 /pkgs/tools/misc/q-text-as-data
parent13481f2a56eef5cddc5397349e22ff9bee39c8ab (diff)
downloadnixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar.gz
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar.bz2
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar.lz
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar.xz
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.tar.zst
nixpkgs-57ab84545b0be145372b56a4a31413ea98fed045.zip
q-text-as-data: 1.7.4 -> 2.0.19
Diffstat (limited to 'pkgs/tools/misc/q-text-as-data')
-rw-r--r--pkgs/tools/misc/q-text-as-data/default.nix28
1 files changed, 17 insertions, 11 deletions
diff --git a/pkgs/tools/misc/q-text-as-data/default.nix b/pkgs/tools/misc/q-text-as-data/default.nix
index e70b8274d36..69d11ab3458 100644
--- a/pkgs/tools/misc/q-text-as-data/default.nix
+++ b/pkgs/tools/misc/q-text-as-data/default.nix
@@ -1,26 +1,32 @@
-{ stdenvNoCC, fetchFromGitHub, python2 }:
+{ lib, fetchFromGitHub, python3Packages }:
 
-stdenvNoCC.mkDerivation rec {
+python3Packages.buildPythonApplication rec {
   pname = "q-text-as-data";
-  version = "1.7.4";
+  version = "2.0.19";
 
   src = fetchFromGitHub {
     owner = "harelba";
     repo = "q";
     rev = version;
-    sha256 = "0p8rbfwwcqjyrix51v52zp9b03z4xg1fv2raf2ygqp9a4l27dca8";
+    sha256 = "18cwyfjgxxavclyd08bmb943c8bvzp1gnqp4klkq5xlgqwivr4sv";
   };
 
-  buildInputs = [ python2 ];
-  dontBuild = true;
+  propagatedBuildInputs = with python3Packages; [
+    setuptools
+    six
+  ];
 
-  installPhase = ''
-    mkdir -p $out/bin
-    cp bin/q $out/bin
-    chmod +x $out/bin/q
+  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 stdenvNoCC.lib; {
+  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).