nixpkgs/pkgs/by-name/go/goose/package.nix
2024-11-22 02:07:54 +00:00

53 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, stdenv
}:
buildGoModule rec {
pname = "goose";
version = "3.23.0";
src = fetchFromGitHub {
owner = "pressly";
repo = pname;
rev = "v${version}";
hash = "sha256-xfCkhVUR/GXYQEpaAhaeBV6UfXMdHyzTn+mIJfuHjBA=";
};
proxyVendor = true;
vendorHash = "sha256-kNe+qc1EIHqXRv0DAGfBK6XNahn/YNmz74mfWrG3+rc=";
# 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.hostPlatform.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";
};
}