nixpkgs/pkgs/tools/system/skeema/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.6 KiB
Nix
Raw Normal View History

2023-09-27 05:41:30 +00:00
{ lib, buildGoModule, fetchFromGitHub, coreutils, testers, skeema }:
2022-01-30 06:37:18 +00:00
buildGoModule rec {
pname = "skeema";
2024-07-02 02:51:58 +00:00
version = "1.12.0";
2022-01-30 06:37:18 +00:00
src = fetchFromGitHub {
owner = "skeema";
repo = "skeema";
rev = "v${version}";
2024-07-02 02:51:58 +00:00
hash = "sha256-MdaMK65PWreIPTuhsm+2ZVRQ8t/wYijkENk8qvX9oEM=";
2022-01-30 06:37:18 +00:00
};
2022-12-01 00:44:39 +00:00
vendorHash = null;
2022-01-30 06:37:18 +00:00
CGO_ENABLED = 0;
ldflags = [ "-s" "-w" ];
preCheck = ''
# Fix tests expecting /usr/bin/printf and /bin/echo
substituteInPlace skeema_cmd_test.go \
--replace /usr/bin/printf "${coreutils}/bin/printf"
substituteInPlace internal/fs/dir_test.go \
--replace /bin/echo "${coreutils}/bin/echo" \
--replace /usr/bin/printf "${coreutils}/bin/printf"
substituteInPlace internal/applier/ddlstatement_test.go \
--replace /bin/echo "${coreutils}/bin/echo"
'';
checkFlags =
2023-03-18 14:04:56 +00:00
let
skippedTests = [
# Tests requiring network access to gitlab.com
"TestDirRelPath"
"TestParseDir"
2023-03-18 14:04:56 +00:00
# Flaky tests
2023-09-27 05:41:30 +00:00
"TestCommandTimeout"
2023-03-18 14:04:56 +00:00
"TestShellOutTimeout"
# Fails with 'internal/fs/testdata/cfgsymlinks1/validrel/.skeema is a symlink pointing outside of its repo'.
"TestParseDirSymlinks"
2023-03-18 14:04:56 +00:00
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
2022-12-01 00:44:39 +00:00
passthru.tests.version = testers.testVersion {
package = skeema;
};
2022-01-30 06:37:18 +00:00
meta = with lib; {
description = "Declarative pure-SQL schema management for MySQL and MariaDB";
homepage = "https://skeema.io/";
license = licenses.asl20;
maintainers = with maintainers; [ aaronjheng ];
2023-11-27 01:17:53 +00:00
mainProgram = "skeema";
2022-01-30 06:37:18 +00:00
};
}