2022-12-02 08:20:57 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, coreutils, runtimeShell, testers, skeema }:
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "skeema";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.10.0";
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "skeema";
|
|
|
|
repo = "skeema";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-JhOQKfJCaZc5PlDWPuYe1Ag9AHkw9RjEQ4N9MSda4rY=";
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
vendorHash = null;
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
preCheck =
|
|
|
|
let
|
|
|
|
skippedTests = [
|
|
|
|
# Tests requiring network access to gitlab.com
|
|
|
|
"TestDirRelPath"
|
|
|
|
"TestParseDirSymlinks"
|
|
|
|
|
|
|
|
# Flaky tests
|
|
|
|
"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"
|
|
|
|
|
|
|
|
substituteInPlace internal/util/shellout_unix_test.go \
|
|
|
|
--replace /bin/echo "${coreutils}/bin/echo" \
|
|
|
|
--replace /usr/bin/printf "${coreutils}/bin/printf"
|
|
|
|
|
|
|
|
substituteInPlace internal/util/shellout_unix.go \
|
|
|
|
--replace /bin/sh "${runtimeShell}"
|
|
|
|
'';
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = skeema;
|
|
|
|
};
|
|
|
|
|
2022-02-21 08:47:16 +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 ];
|
|
|
|
};
|
|
|
|
}
|