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