{ lib, stdenv, fetchurl, gitUpdater, jre, makeWrapper, mysqlSupport ? true, mysql_jdbc, postgresqlSupport ? true, postgresql_jdbc, redshiftSupport ? true, redshift_jdbc, liquibase_redshift_extension, }: let extraJars = lib.optional mysqlSupport mysql_jdbc ++ lib.optional postgresqlSupport postgresql_jdbc ++ lib.optionals redshiftSupport [ redshift_jdbc liquibase_redshift_extension ]; in stdenv.mkDerivation (finalAttrs: { pname = "liquibase"; version = "4.29.2"; src = fetchurl { url = "https://github.com/liquibase/liquibase/releases/download/v${finalAttrs.version}/liquibase-${finalAttrs.version}.tar.gz"; hash = "sha256-HQF6IGqVqzB2pS9mBnnC2AufIXSULLBxXjXVOTHiDuk="; }; nativeBuildInputs = [ makeWrapper ]; buildInputs = [ jre ]; sourceRoot = "."; installPhase = let addJars = dir: '' for jar in ${dir}/*.jar; do CP="\$CP":"\$jar" done ''; in '' mkdir -p $out mv ./{lib,licenses} $out/ mkdir -p $out/internal/lib mv ./internal/lib/*.jar $out/internal/lib/ mkdir -p $out/share/doc/liquibase-${finalAttrs.version} mv LICENSE.txt \ README.txt \ ABOUT.txt \ changelog.txt \ $out/share/doc/liquibase-${finalAttrs.version} mkdir -p $out/bin # there’s a lot of escaping, but I’m not sure how to improve that cat > $out/bin/liquibase <