2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "goose";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.22.1";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pressly";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-rXh50Yv8UXJc+E32Fgg6Iy2K6x5+IM7dmxsvwFuCQ9U=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proxyVendor = true;
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-xb3yBiV+XyOlMp42c+eCj27DpvJalP5qhEoKG1X2kG8=";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# skipping: end-to-end tests require a docker daemon
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
rm -r tests/gomigrations
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
subPackages = [
|
|
|
|
"cmd/goose"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2024-05-15 15:35:15 +00:00
|
|
|
"-X=main.version=${version}"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkFlags = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# NOTE:
|
|
|
|
# - skipping: these also require a docker daemon
|
|
|
|
# - these are for go tests that live outside of the /tests directory
|
|
|
|
"-skip=TestClickUpDown|TestClickHouseFirstThree|TestLockModeAdvisorySession|TestDialectStore|TestGoMigrationStats|TestPostgresSessionLocker"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Database migration tool which supports SQL migrations and Go functions";
|
|
|
|
homepage = "https://pressly.github.io/goose/";
|
|
|
|
license = licenses.bsd3;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "goose";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
}
|