1{ lib, stdenv, fetchurl, makeWrapper, jre }:
2
3stdenv.mkDerivation rec {
4 pname = "jython";
5
6 version = "2.7.3";
7
8 src = fetchurl {
9 url = "http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/${version}/jython-standalone-${version}.jar";
10 sha256 = "sha256-2n89gpsUi8+oawWdyWTjqFVv7bAhCWyNsH4wxm+qubQ=";
11 };
12
13 nativeBuildInputs = [ makeWrapper ];
14
15 dontUnpack = true;
16
17 installPhase = ''
18 mkdir -pv $out/bin
19 cp $src $out/jython.jar
20 makeWrapper ${jre}/bin/java $out/bin/jython --add-flags "-jar $out/jython.jar"
21 '';
22
23 meta = {
24 description = "Python interpreter written in Java";
25 homepage = "https://jython.org/";
26 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
27 license = lib.licenses.psfl;
28 platforms = jre.meta.platforms;
29 };
30}