Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions nix/ext/postgresql-unit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ lib, stdenv, fetchFromGitHub, postgresql, flex, bison }:

stdenv.mkDerivation rec {
pname = "postgresql-unit";
version = "7.10";
name = "postgresql-unit";
buildInputs = [ postgresql ];
nativeBuildInputs = [ flex bison ];

src = fetchFromGitHub {
owner = "df7cb";
repo = pname;
rev = "${version}";
hash = "sha256-glVyW0n34I3QArlTscV+p1/sfhIfFbeH192rf9uYJp0=";
};


installPhase = ''
mkdir -p $out/{lib,share/postgresql/extension}

# Fix the @MODULEDIR@ / postgresql path reference
substituteInPlace *.sql \
--replace "${postgresql}/share/postgresql/extension/" "$out/share/postgresql/extension/"

cp *.so $out/lib
cp *.sql $out/share/postgresql/extension
cp *.data $out/share/postgresql/extension
cp *.control $out/share/postgresql/extension

'';

meta = with lib; {
description = "postgresql-unit implements a PostgreSQL datatype for SI units, plus byte.";
homepage = "https://github.com/${src.owner}/${src.repo}";
platforms = postgresql.meta.platforms;
license = licenses.gpl3;
};
}
1 change: 1 addition & 0 deletions nix/packages/postgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
../ext/wrappers/default.nix
../ext/supautils.nix
../ext/plv8
../ext/postgresql-unit.nix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

];

#Where we import and build the orioledb extension, we add on our custom extensions
Expand Down