2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, testers
|
|
|
|
, pgweb
|
|
|
|
}:
|
2020-11-24 20:58:05 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildGoModule rec {
|
2020-11-24 20:58:05 +00:00
|
|
|
pname = "pgweb";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.14.3";
|
2020-11-24 20:58:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sosedoff";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-We7MyKOdauf93tBihvjouEiZ4FnkvsUtfJpswK6ef7Q=";
|
2020-11-24 20:58:05 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Disable tests require network access.
|
|
|
|
rm -f pkg/client/{client,dump}_test.go
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-Jpvf6cST3kBvYzCQLoJ1fijUC/hP1ouptd2bQZ1J/Lo=";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
2020-11-24 20:58:05 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
checkFlags =
|
|
|
|
let
|
|
|
|
skippedTests = [
|
|
|
|
# There is a `/tmp/foo` file on the test machine causing the test case to fail on macOS
|
|
|
|
"TestParseOptions"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
[ "-skip" "${builtins.concatStringsSep "|" skippedTests}" ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
version = "v${version}";
|
|
|
|
package = pgweb;
|
|
|
|
command = "pgweb --version";
|
|
|
|
};
|
|
|
|
|
2020-11-24 20:58:05 +00:00
|
|
|
meta = with lib; {
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/sosedoff/pgweb/releases/tag/v${version}";
|
2020-11-24 20:58:05 +00:00
|
|
|
description = "A web-based database browser for PostgreSQL";
|
|
|
|
longDescription = ''
|
|
|
|
A simple postgres browser that runs as a web server. You can view data,
|
|
|
|
run queries and examine tables and indexes.
|
|
|
|
'';
|
|
|
|
homepage = "https://sosedoff.github.io/pgweb/";
|
|
|
|
license = licenses.mit;
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "pgweb";
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ zupo luisnquin ];
|
2020-11-24 20:58:05 +00:00
|
|
|
};
|
|
|
|
}
|