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

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

59 lines
1.5 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-04-04 02:47:26 +00:00
version = "1.11.2";
2022-01-30 06:37:18 +00:00
src = fetchFromGitHub {
owner = "skeema";
repo = "skeema";
rev = "v${version}";
2024-04-04 02:47:26 +00:00
hash = "sha256-rnoIuftPmx1Qbn2ifEBGz4RiA/lBVemjMjcPr9Woflc=";
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" ];
2023-03-18 14:04:56 +00:00
preCheck =
let
skippedTests = [
# Tests requiring network access to gitlab.com
"TestDirRelPath"
"TestParseDirSymlinks"
# Flaky tests
2023-09-27 05:41:30 +00:00
"TestCommandTimeout"
2023-03-18 14:04:56 +00:00
"TestShellOutTimeout"
];
in
''
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
# 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"
'';
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
};
}