depot/third_party/nixpkgs/pkgs/development/tools/database/pgweb/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

55 lines
1.4 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, testers
, pgweb
}:
buildGoModule rec {
pname = "pgweb";
version = "0.16.0";
src = fetchFromGitHub {
owner = "sosedoff";
repo = pname;
rev = "v${version}";
hash = "sha256-3iSnFzHqk3KBLvs7XixqpT4j2T/t2O2R7rMD4nlkIuw=";
};
postPatch = ''
# Disable tests require network access.
rm -f pkg/client/{client,dump}_test.go
'';
vendorHash = "sha256-Jpvf6cST3kBvYzCQLoJ1fijUC/hP1ouptd2bQZ1J/Lo=";
ldflags = [ "-s" "-w" ];
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}" ];
passthru.tests.version = testers.testVersion {
version = "v${version}";
package = pgweb;
command = "pgweb --version";
};
meta = with lib; {
changelog = "https://github.com/sosedoff/pgweb/releases/tag/v${version}";
description = "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;
mainProgram = "pgweb";
maintainers = with maintainers; [ zupo luisnquin ];
};
}