summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql/ext/pg_rational.nix
diff options
context:
space:
mode:
authorChronos <34162313+netcrns@users.noreply.github.com>2021-05-26 04:07:33 +0200
committerGitHub <noreply@github.com>2021-05-25 21:07:33 -0500
commit890e8a8e3369054573d371863388c658d395ab7e (patch)
tree0f0eae631c8a0e5568054f1f28182fca4041c254 /pkgs/servers/sql/postgresql/ext/pg_rational.nix
parent69f5a9460c6fff30d1d445da39826c5d51905ee5 (diff)
downloadnixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar.gz
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar.bz2
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar.lz
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar.xz
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.tar.zst
nixpkgs-890e8a8e3369054573d371863388c658d395ab7e.zip
postgresqlPackages.pg_rational: init at 0.0.2 (#124257)
Diffstat (limited to 'pkgs/servers/sql/postgresql/ext/pg_rational.nix')
-rw-r--r--pkgs/servers/sql/postgresql/ext/pg_rational.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/servers/sql/postgresql/ext/pg_rational.nix b/pkgs/servers/sql/postgresql/ext/pg_rational.nix
new file mode 100644
index 00000000000..5cfd6240990
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/ext/pg_rational.nix
@@ -0,0 +1,39 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, postgresql
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pg_rational";
+  version = "0.0.2";
+
+  src = fetchFromGitHub {
+    owner  = "begriffs";
+    repo   = "pg_rational";
+    rev    = "v${version}";
+    sha256 = "sha256-Sp5wuX2nP3KGyWw7MFa11rI1CPIKIWBt8nvBSsASIEw=";
+  };
+
+  buildInputs = [ postgresql ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{lib,share/postgresql/extension}
+
+    cp *.so      $out/lib
+    cp *.sql     $out/share/postgresql/extension
+    cp *.control $out/share/postgresql/extension
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Precise fractional arithmetic for PostgreSQL";
+    homepage    = "https://github.com/begriffs/pg_rational";
+    maintainers = with maintainers; [ netcrns ];
+    platforms   = postgresql.meta.platforms;
+    license     = licenses.mit;
+  };
+}