depot/third_party/nixpkgs/pkgs/tools/misc/goose/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

52 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, stdenv
}:
buildGoModule rec {
pname = "goose";
version = "3.21.1";
src = fetchFromGitHub {
owner = "pressly";
repo = pname;
rev = "v${version}";
hash = "sha256-Klmgw5dYt2/JYc0nuqIZwos3/onlRwsfzTOJ/Yi2pMw=";
};
proxyVendor = true;
vendorHash = "sha256-V875bGtp6Aki64TM3x0n1aERc5sVPIDZ3rNPF9D/osk=";
# skipping: end-to-end tests require a docker daemon
postPatch = ''
rm -r tests/gomigrations
'';
subPackages = [
"cmd/goose"
];
ldflags = [
"-s"
"-w"
"-X=main.version=${version}"
];
checkFlags = [
# 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"
];
doCheck = !stdenv.isDarwin;
meta = with lib; {
description = "Database migration tool which supports SQL migrations and Go functions";
homepage = "https://pressly.github.io/goose/";
license = licenses.bsd3;
maintainers = [ ];
mainProgram = "goose";
};
}