diff --git a/pkgs/development/tools/pgloader/default.nix b/pkgs/development/tools/pgloader/default.nix new file mode 100644 index 000000000000..47b426604da0 --- /dev/null +++ b/pkgs/development/tools/pgloader/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchurl, makeWrapper, sbcl, sqlite, freetds, libzip, curl, git, cacert, openssl }: +stdenv.mkDerivation rec { + pname = "pgloader"; + version = "3.6.1"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://github.com/dimitri/pgloader/releases/download/v3.6.1/pgloader-bundle-3.6.1.tgz"; + sha256 = "1sm8xmq30d1biin5br0y3vrv4fydbrzfqglz1hnvrkdyxrg7d6f9"; + }; + + nativeBuildInputs = [ git makeWrapper ]; + buildInputs = [ sbcl cacert sqlite freetds libzip curl openssl ]; + + LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ]; + + buildPhase = '' + export PATH=$PATH:$out/bin + export HOME=$TMPDIR + + make pgloader + ''; + + dontStrip = true; + enableParallelBuilding = false; + + installPhase = '' + install -Dm755 bin/pgloader "$out/bin/pgloader" + wrapProgram $out/bin/pgloader --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}" + ''; + + meta = with stdenv.lib; { + homepage = https://pgloader.io/; + description = "pgloader loads data into PostgreSQL and allows you to implement Continuous Migration from your current database to PostgreSQL"; + maintainers = with maintainers; [ mguentner ]; + license = licenses.postgresql; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ab0e1c87c7cf..eeccab50b902 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3435,6 +3435,8 @@ in pgf_graphics = callPackage ../tools/graphics/pgf { }; + pgloader = callPackage ../development/tools/pgloader { }; + pigz = callPackage ../tools/compression/pigz { }; pixz = callPackage ../tools/compression/pixz { };