2017-06-24 04:05:20 +01:00
|
|
|
{ stdenv, fetchFromGitHub, v8, perl, postgresql }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "plv8-${version}";
|
2018-11-04 14:21:07 +00:00
|
|
|
version = "2.3.8";
|
2017-06-24 04:05:20 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
buildInputs = [ v8 postgresql ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "plv8";
|
|
|
|
repo = "plv8";
|
|
|
|
rev = "v${version}";
|
2018-11-04 14:21:07 +00:00
|
|
|
sha256 = "0hrmn1zzzdf52zwldg6axv57p0f3b279l9s8lbpijcv60fqrzx16";
|
2017-06-24 04:05:20 +01:00
|
|
|
};
|
|
|
|
|
2018-11-04 14:21:07 +00:00
|
|
|
makeFlags = [ "--makefile=Makefile.shared" ];
|
|
|
|
|
2017-06-24 04:05:20 +01:00
|
|
|
preConfigure = ''
|
2018-11-04 14:21:07 +00:00
|
|
|
patchShebangs ./generate_upgrade.sh
|
2017-06-24 04:05:20 +01:00
|
|
|
'';
|
|
|
|
|
2018-11-04 14:21:07 +00:00
|
|
|
buildPhase = "make -f Makefile.shared all";
|
|
|
|
|
2017-06-24 04:05:20 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2018-11-04 14:21:07 +00:00
|
|
|
install -D plv8*.so -t $out/lib
|
2017-06-24 04:05:20 +01:00
|
|
|
install -D {plls,plcoffee,plv8}{--${version}.sql,.control} -t $out/share/extension
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "PL/v8 - A Procedural Language in JavaScript powered by V8";
|
|
|
|
homepage = https://pgxn.org/dist/plv8/;
|
|
|
|
maintainers = with maintainers; [ volth ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.postgresql;
|
|
|
|
};
|
|
|
|
}
|