This repository has no description
1.7 kB
56 lines
1{ lib, stdenv
2, fetchFromGitHub
3, python39Packages
4, glibcLocales
5, coreutils
6, git
7, extraInputs ? []
8}: let
9
10 python3Packages = python39Packages;
11
12in python3Packages.buildPythonApplication rec {
13 pname = "xonsh2";
14 version = "master";
15
16 # fetch from github because the pypi package ships incomplete tests
17 src = fetchFromGitHub {
18 owner = "anki-code";
19 repo = "xonsh2";
20 rev = "bd96fcdce9319ab6b90c7d9ac47d2249b61144d0";
21 sha256 = "0b632rac8macfp2mmvhh1f34cf1m5qfpjajwnf676qk7jzn79vx6";
22 };
23
24 LC_ALL = "en_US.UTF-8";
25
26 postPatch = ''
27 sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' scripts/xon.sh
28 find scripts -name 'xonsh*' -exec sed -i -e "s|env -S|env|" {} \;
29 find -name "*.xsh" | xargs sed -ie 's|/usr/bin/env|${coreutils}/bin/env|'
30 patchShebangs .
31 '';
32
33 doCheck = false;
34
35 checkPhase = ''
36 HOME=$TMPDIR pytest -k 'not test_repath_backslash and not test_os and not test_man_completion and not test_builtins and not test_main and not test_ptk_highlight and not test_pyghooks'
37 HOME=$TMPDIR pytest -k 'test_builtins or test_main' --reruns 5
38 HOME=$TMPDIR pytest -k 'test_ptk_highlight'
39 '';
40
41 checkInputs = [ python3Packages.pytest python3Packages.pytest-rerunfailures glibcLocales git ];
42
43 propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ] ++ extraInputs;
44
45 meta = with lib; {
46 description = "A Python-ish, BASHwards-compatible shell";
47 homepage = "https://xon.sh/";
48 # changelog = "https://github.com/xonsh/xonsh/releases/tag/${version}";
49 license = licenses.bsd3;
50 platforms = platforms.all;
51 };
52
53 passthru = {
54 shellPath = "/bin/xonsh2";
55 };
56}