2016-06-04 18:05:12 +02:00
|
|
|
{ stdenv, fetchFromGitHub, python3Packages, glibcLocales, coreutils }:
|
2015-03-26 19:25:17 +01:00
|
|
|
|
2016-02-19 13:12:11 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2015-03-26 19:25:17 +01:00
|
|
|
name = "xonsh-${version}";
|
2016-07-21 01:01:57 +02:00
|
|
|
version = "0.4.3";
|
2015-03-26 19:25:17 +01:00
|
|
|
|
2016-06-04 18:05:12 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scopatz";
|
|
|
|
repo = "xonsh";
|
|
|
|
rev = version;
|
2016-07-21 01:01:57 +02:00
|
|
|
sha256= "1lx95i468px908y18fa9fmfgmjsydhkpas89dxbwfnybqxxyd3ls";
|
2016-06-04 18:05:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
## The logo xonsh prints during build contains unicode characters, and this
|
|
|
|
## fails because locales have not been set up in the build environment.
|
|
|
|
## We can fix this on Linux by setting:
|
|
|
|
## export LOCALE_ARCHIVE=${pkgs.glibcLocales}/lib/locale/locale-archive
|
|
|
|
## but this would not be a cross platform solution, so it's simpler to just
|
|
|
|
## patch the setup.py script to not print the logo during build.
|
|
|
|
#prePatch = ''
|
|
|
|
# substituteInPlace setup.py --replace "print(logo)" ""
|
|
|
|
#'';
|
|
|
|
patchPhase = ''
|
|
|
|
rm xonsh/winutils.py
|
|
|
|
sed -i -e "s|/bin/ls|${coreutils}/bin/ls|" tests/test_execer.py
|
2016-06-25 18:27:11 +02:00
|
|
|
sed -ie 's|test_win_ipconfig|_test_win_ipconfig|g' tests/test_execer.py
|
|
|
|
sed -ie 's|test_ipconfig|_test_ipconfig|g' tests/test_execer.py
|
2016-06-04 18:05:12 +02:00
|
|
|
rm tests/test_main.py
|
|
|
|
rm tests/test_man.py
|
2016-06-26 01:07:38 +02:00
|
|
|
rm tests/test_replay.py
|
2015-03-26 19:25:17 +01:00
|
|
|
'';
|
|
|
|
|
2016-06-04 18:05:12 +02:00
|
|
|
checkPhase = ''
|
2016-06-26 01:07:38 +02:00
|
|
|
HOME=$TMPDIR XONSH_INTERACTIVE=0 nosetests -x
|
2016-06-04 18:05:12 +02:00
|
|
|
'';
|
2015-03-26 19:25:17 +01:00
|
|
|
|
2016-06-25 18:27:11 +02:00
|
|
|
buildInputs = with python3Packages; [ glibcLocales nose pytest ];
|
2016-06-04 18:05:12 +02:00
|
|
|
propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit ];
|
2015-03-26 19:25:17 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Python-ish, BASHwards-compatible shell";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://xonsh.org;
|
2015-03-26 19:25:17 +01:00
|
|
|
license = licenses.bsd3;
|
2016-06-25 18:27:11 +02:00
|
|
|
maintainers = with maintainers; [ spwhitt garbas vrthra ];
|
2015-03-26 19:25:17 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2016-05-14 15:03:37 +02:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/xonsh";
|
|
|
|
};
|
2015-03-26 19:25:17 +01:00
|
|
|
}
|