diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
commit | c4625b175f8200f643fd6e11010932ea44c78433 (patch) | |
tree | bce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase | |
parent | 49f735974dd103039ddc4cb576bb76555164a9e7 (diff) | |
parent | d661aa56a8843e991261510c1bb28fdc2f6975ae (diff) |
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie
git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7
git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase/default.nix | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase/default.nix new file mode 100644 index 000000000000..75ccca43a690 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/tools/database/liquibase/default.nix @@ -0,0 +1,66 @@ +{ stdenv, fetchurl, jre, makeWrapper +, mysqlSupport ? true, mysql_jdbc ? null }: + +assert mysqlSupport -> mysql_jdbc != null; + +with stdenv.lib; +let + extraJars = optional mysqlSupport mysql_jdbc; +in + +stdenv.mkDerivation rec { + pname = "liquibase"; + version = "4.0.0"; + + src = fetchurl { + url = "https://github.com/liquibase/liquibase/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "06wpvqyv7w749l3ndvzg1p774rv1apbmbpwbdlad57pih4nqa7mm"; + }; + + buildInputs = [ jre makeWrapper ]; + + unpackPhase = '' + tar xfz ${src} + ''; + + installPhase = + let addJars = dir: '' + for jar in ${dir}/*.jar; do + CP="\$CP":"\$jar" + done + ''; + in '' + mkdir -p $out + mv ./{lib,licenses,liquibase.jar} $out/ + + mkdir -p $out/share/doc/${pname}-${version} + mv LICENSE.txt \ + README.txt \ + ABOUT.txt \ + changelog.txt \ + $out/share/doc/${pname}-${version} + + mkdir -p $out/bin + # there’s a lot of escaping, but I’m not sure how to improve that + cat > $out/bin/liquibase <<EOF + #!/usr/bin/env bash + # taken from the executable script in the source + CP="$out/liquibase.jar" + ${addJars "$out/lib"} + ${concatStringsSep "\n" (map (p: addJars "${p}/share/java") extraJars)} + + ${getBin jre}/bin/java -cp "\$CP" \$JAVA_OPTS \ + liquibase.integration.commandline.Main \''${1+"\$@"} + EOF + chmod +x $out/bin/liquibase + ''; + + meta = { + description = "Version Control for your database"; + homepage = "https://www.liquibase.org/"; + changelog = "https://raw.githubusercontent.com/liquibase/liquibase/v${version}/changelog.txt"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + platforms = with platforms; unix; + }; +} |