2021-08-25 08:27:29 +00:00
|
|
|
{ lib
|
|
|
|
, astor
|
|
|
|
, buildPythonPackage
|
|
|
|
, colorama
|
|
|
|
, fetchFromGitHub
|
|
|
|
, funcparserlib
|
2022-05-18 14:49:53 +00:00
|
|
|
, hy
|
2021-08-25 08:27:29 +00:00
|
|
|
, pytestCheckHook
|
2022-05-18 14:49:53 +00:00
|
|
|
, python
|
2021-08-25 08:27:29 +00:00
|
|
|
, pythonOlder
|
|
|
|
, rply
|
2022-05-18 14:49:53 +00:00
|
|
|
, testers
|
2021-08-25 08:27:29 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hy";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.24.0";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
2021-08-25 08:27:29 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-08-25 08:27:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hylang";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-PmnYOniYqNHGTxpWuAc+zBhOsgRgMMbERHq81KpHheg=";
|
2021-08-25 08:27:29 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10
|
|
|
|
HY_VERSION = version;
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
colorama
|
|
|
|
funcparserlib
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++
|
|
|
|
lib.optionals (pythonOlder "3.9") [
|
2021-08-25 08:27:29 +00:00
|
|
|
astor
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
2021-08-25 08:27:29 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
preCheck = ''
|
|
|
|
# For test_bin_hy
|
|
|
|
export PATH="$out/bin:$PATH"
|
|
|
|
'';
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
disabledTests = [
|
2022-10-21 18:38:19 +00:00
|
|
|
"test_circular_macro_require"
|
|
|
|
"test_macro_require"
|
2021-08-25 08:27:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "hy" ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = hy;
|
|
|
|
command = "hy -v";
|
|
|
|
};
|
2022-10-21 18:38:19 +00:00
|
|
|
# For backwards compatibility with removed pkgs/development/interpreters/hy
|
|
|
|
# Example usage:
|
|
|
|
# hy.withPackages (ps: with ps; [ hyrule requests ])
|
|
|
|
withPackages = python-packages:
|
|
|
|
(python.withPackages
|
|
|
|
(ps: (python-packages ps) ++ [ ps.hy ])).overrideAttrs (old: {
|
|
|
|
name = "${hy.name}-env";
|
|
|
|
meta = lib.mergeAttrs (builtins.removeAttrs hy.meta [ "license" ]) {
|
|
|
|
mainProgram = "hy";
|
|
|
|
};
|
|
|
|
});
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
meta = with lib; {
|
2022-05-18 14:49:53 +00:00
|
|
|
description = "A LISP dialect embedded in Python";
|
|
|
|
homepage = "https://hylang.org/";
|
|
|
|
changelog = "https://github.com/hylang/hy/releases/tag/${version}";
|
2021-08-25 08:27:29 +00:00
|
|
|
license = licenses.mit;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ fab mazurel nixy thiagokokada ];
|
2021-08-25 08:27:29 +00:00
|
|
|
};
|
|
|
|
}
|