2021-08-25 08:27:29 +00:00
|
|
|
{ lib
|
|
|
|
, astor
|
|
|
|
, buildPythonPackage
|
|
|
|
, 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
|
2022-05-18 14:49:53 +00:00
|
|
|
, testers
|
2021-08-25 08:27:29 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hy";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "0.26.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;
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-02-16 17:41:37 +00:00
|
|
|
hash = "sha256-Ow3FAiH97lSaI3oSx702+jgScfNgf+JstuDpgPSB8LM=";
|
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 = [
|
|
|
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-25 08:27:29 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|