From 60d8c843d6d95284a2bb3b08c507fb197a35e6cd Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Sun, 29 Nov 2020 16:00:27 -0500 Subject: [PATCH] python3Packages.hjson: fix wrapper And add a basic import test with the standard hook. --- pkgs/development/python-modules/hjson/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/hjson/default.nix b/pkgs/development/python-modules/hjson/default.nix index 6a86a2000d2c..13dce54b9c3a 100644 --- a/pkgs/development/python-modules/hjson/default.nix +++ b/pkgs/development/python-modules/hjson/default.nix @@ -1,6 +1,8 @@ { stdenv , buildPythonPackage , fetchFromGitHub +, pythonImportsCheckHook +, makeWrapper }: buildPythonPackage rec { @@ -15,6 +17,15 @@ buildPythonPackage rec { sha256 = "1jc7j790rcqnhbrfj4lhnz3f6768dc55aij840wmx16jylfqpc2n"; }; + nativeBuildInputs = [ makeWrapper pythonImportsCheckHook ]; + + pythonImportsCheck = [ "hjson" ]; + + postInstall = '' + rm $out/bin/hjson.cmd + wrapProgram $out/bin/hjson --set PYTHONPATH "$PYTHONPATH" + ''; + meta = with stdenv.lib; { description = "A user interface for JSON"; homepage = "https://github.com/hjson/hjson-py";