diff --git a/pkgs/development/tools/database/liquibase/default.nix b/pkgs/development/tools/database/liquibase/default.nix index 5305297a27af..b49719ae0b96 100644 --- a/pkgs/development/tools/database/liquibase/default.nix +++ b/pkgs/development/tools/database/liquibase/default.nix @@ -1,4 +1,13 @@ -{ stdenv, fetchurl, jre, makeWrapper }: +{ stdenv, fetchurl, writeText, jre, makeWrapper, fetchMavenArtifact +, mysqlSupport ? true, mysql_jdbc ? null }: + +assert mysqlSupport -> mysql_jdbc != null; + +with stdenv.lib; +let + extraJars = optional mysqlSupport mysql_jdbc; + +in stdenv.mkDerivation rec { name = "${pname}-${version}"; @@ -16,18 +25,38 @@ stdenv.mkDerivation rec { tar xfz ${src} ''; - installPhase = '' - mkdir -p $out/{bin,lib,sdk} - mv ./* $out/ - wrapProgram $out/liquibase --prefix PATH ":" ${jre}/bin --set LIQUIBASE_HOME $out; - ln -s $out/liquibase $out/bin/liquibase + installPhase = + let addJars = dir: '' + for jar in ${dir}/*.jar; do + CP="\$CP":"\$jar" + done + ''; + in '' + mkdir -p $out/{bin,lib,sdk} + mv ./* $out/ + + # we provide our own script + rm $out/liquibase + + # there’s a lot of escaping, but I’m not sure how to improve that + cat > $out/bin/liquibase <