Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at litex 1.7 kB view raw
1{ lib 2, astor 3, buildPythonPackage 4, fetchFromGitHub 5, funcparserlib 6, hy 7, pytestCheckHook 8, python 9, pythonOlder 10, testers 11}: 12 13buildPythonPackage rec { 14 pname = "hy"; 15 version = "0.26.0"; 16 format = "setuptools"; 17 18 disabled = pythonOlder "3.7"; 19 20 src = fetchFromGitHub { 21 owner = "hylang"; 22 repo = pname; 23 rev = "refs/tags/${version}"; 24 hash = "sha256-Ow3FAiH97lSaI3oSx702+jgScfNgf+JstuDpgPSB8LM="; 25 }; 26 27 # https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10 28 HY_VERSION = version; 29 30 propagatedBuildInputs = [ 31 funcparserlib 32 ] ++ 33 lib.optionals (pythonOlder "3.9") [ 34 astor 35 ]; 36 37 nativeCheckInputs = [ 38 pytestCheckHook 39 ]; 40 41 preCheck = '' 42 # For test_bin_hy 43 export PATH="$out/bin:$PATH" 44 ''; 45 46 disabledTests = [ 47 "test_circular_macro_require" 48 "test_macro_require" 49 ]; 50 51 pythonImportsCheck = [ "hy" ]; 52 53 passthru = { 54 tests.version = testers.testVersion { 55 package = hy; 56 command = "hy -v"; 57 }; 58 # For backwards compatibility with removed pkgs/development/interpreters/hy 59 # Example usage: 60 # hy.withPackages (ps: with ps; [ hyrule requests ]) 61 withPackages = python-packages: 62 (python.withPackages 63 (ps: (python-packages ps) ++ [ ps.hy ])).overrideAttrs (old: { 64 name = "${hy.name}-env"; 65 meta = lib.mergeAttrs (builtins.removeAttrs hy.meta [ "license" ]) { 66 mainProgram = "hy"; 67 }; 68 }); 69 }; 70 71 meta = with lib; { 72 description = "A LISP dialect embedded in Python"; 73 homepage = "https://hylang.org/"; 74 changelog = "https://github.com/hylang/hy/releases/tag/${version}"; 75 license = licenses.mit; 76 maintainers = with maintainers; [ fab mazurel nixy thiagokokada ]; 77 }; 78}