btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / fl / flyway / package.nix
blobc27b44f28961fd26c568969946d38f5260993206
1 { lib, stdenv, fetchurl, jre_headless, makeWrapper, testers }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "flyway";
5   version = "10.20.1";
6   src = fetchurl {
7     url =
8       "mirror://maven/org/flywaydb/flyway-commandline/${finalAttrs.version}/flyway-commandline-${finalAttrs.version}.tar.gz";
9     sha256 = "sha256-ntFaXwF3EThHxR7rpAivTRDN4bgS1l0RFFyvbs/8dxE=";
10   };
11   nativeBuildInputs = [ makeWrapper ];
12   dontBuild = true;
13   dontStrip = true;
14   installPhase = ''
15     mkdir -p $out/bin $out/share/flyway
16     cp -r drivers conf licenses README.txt $out/share/flyway
17     install -Dt $out/share/flyway/lib lib/*.jar lib/flyway/*.jar lib/oracle_wallet/*.jar lib/aad/msal4j-1.15.1.jar lib/aad/slf4j-api-1.7.30.jar
18     makeWrapper "${jre_headless}/bin/java" $out/bin/flyway \
19       --add-flags "-Djava.security.egd=file:/dev/../dev/urandom" \
20       --add-flags "-classpath '$out/share/flyway/lib/*:$out/share/flyway/drivers/*'" \
21       --add-flags "org.flywaydb.commandline.Main" \
22   '';
23   passthru.tests = {
24     version = testers.testVersion { package = finalAttrs.finalPackage; };
25   };
26   meta = with lib; {
27     description =
28       "Evolve your Database Schema easily and reliably across all your instances";
29     longDescription = ''
30       The Flyway command-line tool is a standalone Flyway distribution.
31       It is primarily meant for users who wish to migrate their database from the command-line
32       without having to integrate Flyway into their applications nor having to install a build tool.
34       This package is only the Community Edition of the Flyway command-line tool.
35     '';
36     mainProgram = "flyway";
37     downloadPage = "https://github.com/flyway/flyway";
38     homepage = "https://flywaydb.org/";
39     changelog =
40       "https://documentation.red-gate.com/fd/release-notes-for-flyway-engine-179732572.html";
41     sourceProvenance = with sourceTypes; [ binaryBytecode ];
42     license = licenses.asl20;
43     platforms = platforms.unix;
44     maintainers = [ maintainers.cmcdragonkai ];
45   };