depot/third_party/nixpkgs/pkgs/by-name/xo/xonsh/package.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

23 lines
527 B
Nix

{ lib
, callPackage
, extraPackages ? (ps: [ ])
, runCommand
}:
let
xonsh-unwrapped = callPackage ./unwrapped.nix { };
inherit (xonsh-unwrapped.passthru) python;
pythonEnv = python.withPackages (ps: [
(ps.toPythonModule xonsh-unwrapped)
] ++ extraPackages ps);
in
runCommand "xonsh-${xonsh-unwrapped.version}"
{
inherit (xonsh-unwrapped) pname version meta passthru;
} ''
mkdir -p $out/bin
for bin in ${lib.getBin xonsh-unwrapped}/bin/*; do
ln -s ${pythonEnv}/bin/$(basename "$bin") $out/bin/
done
''