about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/hy
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-07-09 12:30:28 +0000
committerAlyssa Ross <hi@alyssa.is>2021-07-23 09:11:31 +0000
commit55cc63c079f49e81d695a25bc2f5b3902f2bd290 (patch)
treee705335d97f50b927c76ccb4a3fbde9fab8372b9 /nixpkgs/pkgs/development/interpreters/hy
parentc26eb6f74d9393127a21eee7a9620a920769f613 (diff)
parent87807e64a5ef5206b745a40af118c7be8db73681 (diff)
downloadnixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.gz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.bz2
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.lz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.xz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.zst
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.zip
Merge commit '87807e64a5ef5206b745a40af118c7be8db73681'
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/hy')
-rw-r--r--nixpkgs/pkgs/development/interpreters/hy/builder.nix40
-rw-r--r--nixpkgs/pkgs/development/interpreters/hy/default.nix50
2 files changed, 54 insertions, 36 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/hy/builder.nix b/nixpkgs/pkgs/development/interpreters/hy/builder.nix
new file mode 100644
index 000000000000..6757f859ac14
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/interpreters/hy/default.nix b/nixpkgs/pkgs/development/interpreters/hy/default.nix
index e39bf915cfcf..f5d80c11d711 100644
--- a/nixpkgs/pkgs/development/interpreters/hy/default.nix
+++ b/nixpkgs/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;
 }