about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-06-30 23:03:13 +0100
committerGitHub <noreply@github.com>2021-06-30 23:03:13 +0100
commite8d4f67e8af80a7176385a4f2f6d726afe64f093 (patch)
treef8debd4e3c568f121ba4a3d99b697231847d32c9 /pkgs/development/interpreters
parent0a876d91cb8b156b77fc15de110a904f2acaa78b (diff)
parent30a15dbc5e6c891feade4c32478e36827190fe14 (diff)
Merge pull request #128123 from Mazurel/master
hy: 0.19.0 -> 1.0a1 and improvements
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/hy/builder.nix40
-rw-r--r--pkgs/development/interpreters/hy/default.nix50
2 files changed, 54 insertions, 36 deletions
diff --git a/pkgs/development/interpreters/hy/builder.nix b/pkgs/development/interpreters/hy/builder.nix
new file mode 100644
index 0000000000000..6757f859ac14a
--- /dev/null
+++ b/pkgs/development/interpreters/hy/builder.nix
@@ -0,0 +1,40 @@
+{ lib
+, python3Packages
+, hyDefinedPythonPackages /* Packages like with python.withPackages */
+, ...
+}:
+python3Packages.buildPythonApplication rec {
+  pname = "hy";
+  version = "1.0a1";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-lCrbvbkeutSNmvvn/eHpTnJwPb5aEH7hWTXYSE+AJmU=";
+  };
+
+  checkInputs = with python3Packages; [ flake8 pytest ];
+
+  propagatedBuildInputs = with python3Packages; [
+    appdirs
+    astor
+    clint
+    colorama
+    fastentrypoints
+    funcparserlib
+    rply
+    pygments
+  ] ++ (hyDefinedPythonPackages python3Packages);
+
+  # Hy does not include tests in the source distribution from PyPI, so only test executable.
+  checkPhase = ''
+    $out/bin/hy --help > /dev/null
+  '';
+
+  meta = with lib; {
+    description = "A LISP dialect embedded in Python";
+    homepage = "https://hylang.org/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ nixy mazurel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/interpreters/hy/default.nix b/pkgs/development/interpreters/hy/default.nix
index e39bf915cfcf7..f5d80c11d7115 100644
--- a/pkgs/development/interpreters/hy/default.nix
+++ b/pkgs/development/interpreters/hy/default.nix
@@ -1,37 +1,15 @@
-{ lib, python3Packages }:
-
-python3Packages.buildPythonApplication rec {
-  pname = "hy";
-  version = "0.19.0";
-
-  src = python3Packages.fetchPypi {
-    inherit pname version;
-    sha256 = "05k05qmiiysiwdc05sxmanwhv1crfwbb3l8swxfisbzbvmv1snis";
-  };
-
-  checkInputs = with python3Packages; [ flake8 pytest ];
-
-  propagatedBuildInputs = with python3Packages; [
-    appdirs
-    astor
-    clint
-    colorama
-    fastentrypoints
-    funcparserlib
-    rply
-    pygments
-  ];
-
-  # Hy does not include tests in the source distribution from PyPI, so only test executable.
-  checkPhase = ''
-    $out/bin/hy --help > /dev/null
-  '';
-
-  meta = with lib; {
-    description = "A LISP dialect embedded in Python";
-    homepage = "http://hylang.org/";
-    license = licenses.mit;
-    maintainers = with maintainers; [ nixy ];
-    platforms = platforms.all;
-  };
+{ lib
+, callPackage
+, hyDefinedPythonPackages ? python-packages: [] /* Packages like with python.withPackages */
+}:
+let
+  withPackages = (
+    python-packages: callPackage ./builder.nix {
+      hyDefinedPythonPackages = python-packages;
+    }
+  );
+in
+(withPackages hyDefinedPythonPackages) // {
+  # Export withPackages function for hy customization
+  inherit withPackages;
 }