{ stdenv, fetchurl, perl, nettools, java, polyml, z3 }: # nettools needed for hostname stdenv.mkDerivation rec { pname = "isabelle"; version = "2018"; dirname = "Isabelle${version}"; src = if stdenv.isDarwin then fetchurl { url = "http://isabelle.in.tum.de/website-${dirname}/dist/${dirname}.dmg"; sha256 = "0jwnvsf5whklq14ihaxs7b9nbic94mm56nvxljrdbvl6y628j9r5"; } else fetchurl { url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux.tar.gz"; sha256 = "1928lwrw1v1p9s23kix30ncpqm8djmrnjixj82f3ni2a8sc3hrsp"; }; buildInputs = [ perl polyml z3 ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ nettools java ]; sourceRoot = dirname; postPatch = '' ENV=$(type -p env) patchShebangs "." substituteInPlace lib/Tools/env \ --replace /usr/bin/env $ENV substituteInPlace lib/Tools/install \ --replace /usr/bin/env $ENV sed -i 's|isabelle_java java|${java}/bin/java|g' lib/Tools/java substituteInPlace etc/settings \ --subst-var-by ML_HOME "${polyml}/bin" substituteInPlace contrib/jdk/etc/settings \ --replace ISABELLE_JDK_HOME= '#ISABELLE_JDK_HOME=' substituteInPlace lib/scripts/run-polyml* lib/scripts/polyml-version \ --replace '$ML_HOME/poly' ${polyml}/bin/poly substituteInPlace contrib/z3*/etc/settings \ --replace '$Z3_HOME/z3' '${z3}/bin/z3' cat >contrib/polyml-*/etc/settings <