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

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

64 lines
1.7 KiB
Nix
Raw Normal View History

2022-12-01 01:44:39 +01:00
{ lib, buildGoModule, fetchFromGitHub, coreutils, runtimeShell, testers, skeema }:
2022-01-30 07:37:18 +01:00
buildGoModule rec {
pname = "skeema";
2023-04-27 05:46:46 +02:00
version = "1.10.0";
2022-01-30 07:37:18 +01:00
src = fetchFromGitHub {
owner = "skeema";
repo = "skeema";
rev = "v${version}";
2023-04-27 05:46:46 +02:00
hash = "sha256-JhOQKfJCaZc5PlDWPuYe1Ag9AHkw9RjEQ4N9MSda4rY=";
2022-01-30 07:37:18 +01:00
};
2022-12-01 01:44:39 +01:00
vendorHash = null;
2022-01-30 07:37:18 +01:00
CGO_ENABLED = 0;
ldflags = [ "-s" "-w" ];
2023-03-18 15:04:56 +01: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-12-01 01:44:39 +01:00
passthru.tests.version = testers.testVersion {
package = skeema;
};
2022-01-30 07:37:18 +01: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 ];
};
}