2016-06-04 16:05:12 +00:00
|
|
|
{ stdenv, fetchFromGitHub, python3Packages, glibcLocales, coreutils }:
|
2015-03-26 18:25:17 +00:00
|
|
|
|
2016-02-19 12:12:11 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2015-03-26 18:25:17 +00:00
|
|
|
name = "xonsh-${version}";
|
2016-06-04 16:05:12 +00:00
|
|
|
version = "0.3.2";
|
2015-03-26 18:25:17 +00:00
|
|
|
|
2016-06-04 16:05:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scopatz";
|
|
|
|
repo = "xonsh";
|
|
|
|
rev = version;
|
|
|
|
sha256= "0cqfrpvkgzk0q3dykavqxwfqrx61y8rbzixmwcv8pfa9r2sya24q";
|
|
|
|
};
|
|
|
|
|
|
|
|
## 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
|
|
|
|
rm tests/test_main.py
|
|
|
|
rm tests/test_man.py
|
2015-03-26 18:25:17 +00:00
|
|
|
'';
|
|
|
|
|
2016-06-04 16:05:12 +00:00
|
|
|
checkPhase = ''
|
|
|
|
HOME=$TMPDIR nosetests -x
|
|
|
|
'';
|
2015-03-26 18:25:17 +00:00
|
|
|
|
2016-06-04 16:05:12 +00:00
|
|
|
buildInputs = with python3Packages; [ glibcLocales nose pygments ];
|
|
|
|
propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit ];
|
2015-03-26 18:25:17 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Python-ish, BASHwards-compatible shell";
|
|
|
|
homepage = "http://xonsh.org";
|
|
|
|
license = licenses.bsd3;
|
2016-06-04 16:05:12 +00:00
|
|
|
maintainers = with maintainers; [ spwhitt garbas ];
|
2015-03-26 18:25:17 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|