Skip to content

Instantly share code, notes, and snippets.

@teburd
Created December 10, 2020 17:08
Show Gist options
  • Save teburd/38524234bcd01a5a4770042fdcf26b47 to your computer and use it in GitHub Desktop.
Save teburd/38524234bcd01a5a4770042fdcf26b47 to your computer and use it in GitHub Desktop.
libpq nix
{ pkgs ? import ../nixpkgs.nix {} }:
pkgs.callPackage({ stdenv, lib, fetchgit, openssl, zlib, perl, bison, flex, tzdata }:
stdenv.mkDerivation rec {
pname = "libpq";
version = "12.5";
src = fetchgit {
url = "https://git.postgresql.org/git/postgresql.git";
rev = "6bb1b38fa5388a4aa39ed9e56ef477f618fb28e1"; # REL_12_5
sha256 = "0vcjm2yvdqnsxmj675rfbsh5awzb7bi3rm93ydy0230rg4zr7jc8";
};
configureFlags = [
"--with-openssl"
"--without-readline"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
];
nativeBuildInputs = [ perl bison flex tzdata ];
buildInputs = [ openssl zlib ];
buildPhase = ''
make -C src/bin
make -C src/include
make -C src/interfaces
'';
installPhase = ''
make -C src/bin install
make -C src/include install
make -C src/interfaces install
'';
outputs = ["lib" "dev" "out"];
}
) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment