about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorFlorian Agbuya <fa@m-labs.ph>2023-09-18 02:57:45 +0800
committerFlorian Agbuya <fa@m-labs.ph>2023-09-19 22:23:55 +0800
commit44f22143b7cbe1de57ed445fb690dca2a4e2d1db (patch)
treeb37bd568ffd002782942bde5a92784f4599c27f9 /pkgs/by-name
parentc820266e8706e393fe060251be1ed7541d129e2a (diff)
outputcheck: init at 0.4.2
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/ou/outputcheck/package.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/by-name/ou/outputcheck/package.nix b/pkgs/by-name/ou/outputcheck/package.nix
new file mode 100644
index 0000000000000..22b033ea11923
--- /dev/null
+++ b/pkgs/by-name/ou/outputcheck/package.nix
@@ -0,0 +1,52 @@
+{ lib
+, python3
+, fetchFromGitHub
+, lit
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "outputcheck";
+  version = "0.4.2";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "stp";
+    repo = "OutputCheck";
+    rev = "eab62a5dd5129f6a4ebfbe4bbe41d35611f7c48d";
+    hash = "sha256-0D5Lljn66jB/EW/ntC2eTuXAt0w0cceeeqf3aKuyeF0=";
+  };
+
+  # - Fix deprecated 'U' mode in python 3.11
+  #   https://github.com/python/cpython/blob/3.11/Doc/library/functions.rst?plain=1#L1386
+  # - Fix expected error and actual parser error mismatch
+  # - Fix version number cannot find error
+  postPatch = ''
+    substituteInPlace OutputCheck/Driver.py \
+      --replace "argparse.FileType('rU')" "argparse.FileType('r')"
+
+    substituteInPlace tests/invalid-regex-syntax.smt2 \
+      --replace "unbalanced parenthesis" "missing ), unterminated subpattern"
+
+    echo ${version} > RELEASE-VERSION
+  '';
+
+  nativeCheckInputs = [ lit ];
+
+  checkPhase = ''
+    runHook preCheck
+
+    lit -v tests/
+
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [ "OutputCheck" ];
+
+  meta = with lib; {
+    description = "A tool for checking tool output inspired by LLVM's FileCheck";
+    homepage = "https://github.com/stp/OutputCheck";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fsagbuya ];
+    mainProgram = "OutputCheck";
+  };
+}