From ed9b7d3d9e9b32621f573d7b333d28ecc13706c0 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:14:59 +0800 Subject: [PATCH 1/6] libpg_query: format --- pkgs/by-name/li/libpg_query/package.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/li/libpg_query/package.nix b/pkgs/by-name/li/libpg_query/package.nix index 46920c977cbc..293504c5d9bc 100644 --- a/pkgs/by-name/li/libpg_query/package.nix +++ b/pkgs/by-name/li/libpg_query/package.nix @@ -1,5 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, which, squawk }: - +{ + lib, + stdenv, + fetchFromGitHub, + which, + squawk, +}: stdenv.mkDerivation rec { pname = "libpg_query"; version = "16-5.1.0"; @@ -13,7 +18,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which ]; - makeFlags = [ "build" "build_shared" ]; + makeFlags = [ + "build" + "build_shared" + ]; installPhase = '' install -Dm644 -t $out/lib libpg_query.a @@ -22,18 +30,19 @@ stdenv.mkDerivation rec { ''; doCheck = true; + checkTarget = "test"; passthru.tests = { inherit squawk; }; - meta = with lib; { + meta = { homepage = "https://github.com/pganalyze/libpg_query"; description = "C library for accessing the PostgreSQL parser outside of the server environment"; changelog = "https://github.com/pganalyze/libpg_query/blob/${version}/CHANGELOG.md"; - license = licenses.bsd3; - platforms = platforms.unix; + license = lib.licenses.bsd3; + platforms = lib.platforms.unix; maintainers = [ ]; }; } From e32d6c0b5cba9a49ad7083a9ed9ba5ae8e44cbf3 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:15:06 +0800 Subject: [PATCH 2/6] libpg_query: 16-5.1.0 -> 17-6.0.0 --- pkgs/by-name/li/libpg_query/package.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/li/libpg_query/package.nix b/pkgs/by-name/li/libpg_query/package.nix index 293504c5d9bc..fd39d60da250 100644 --- a/pkgs/by-name/li/libpg_query/package.nix +++ b/pkgs/by-name/li/libpg_query/package.nix @@ -4,16 +4,18 @@ fetchFromGitHub, which, squawk, + protobufc, + xxHash, }: stdenv.mkDerivation rec { pname = "libpg_query"; - version = "16-5.1.0"; + version = "17-6.0.0"; src = fetchFromGitHub { owner = "pganalyze"; repo = "libpg_query"; - rev = version; - hash = "sha256-X48wjKdgkAc4wUubQ5ip1zZYiCKzQJyQTgGvO/pOY3I="; + tag = version; + hash = "sha256-hwF3kowuMmc1eXMdvhoCpBxT6++wp29MRYhy4S5Jhfg="; }; nativeBuildInputs = [ which ]; @@ -24,9 +26,19 @@ stdenv.mkDerivation rec { ]; installPhase = '' - install -Dm644 -t $out/lib libpg_query.a - install -Dm644 -t $out/include pg_query.h - install -Dm644 -t $out/lib libpg_query${stdenv.hostPlatform.extensions.sharedLibrary} + runHook preInstall + + install -Dm644 libpg_query.a -t $out/lib + install -Dm644 libpg_query${stdenv.hostPlatform.extensions.sharedLibrary} -t $out/lib + cp -r src/include $out/include + cp -r src/postgres/include/* $out/include + cp -r protobuf $out/include/protobuf + ln -s ${protobufc.dev}/include/protobuf-c $out/include/protobuf-c + cp -r ${protobufc.dev}/include/protobuf-c/* $out/include + ln -s ${xxHash}/include $out/include/xxhash + install -Dm644 pg_query.h -t $out/include + + runHook postInstall ''; doCheck = true; From dcb9589644e79f4200d281f0cf57cd3d0a5b2b1f Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:13:50 +0800 Subject: [PATCH 3/6] pgroll: format --- pkgs/by-name/pg/pgroll/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/pg/pgroll/package.nix b/pkgs/by-name/pg/pgroll/package.nix index 0adbe0481b98..a6652e3d0992 100644 --- a/pkgs/by-name/pg/pgroll/package.nix +++ b/pkgs/by-name/pg/pgroll/package.nix @@ -3,7 +3,6 @@ fetchFromGitHub, lib, }: - buildGoModule rec { pname = "pgroll"; version = "0.7.0"; @@ -20,10 +19,10 @@ buildGoModule rec { # Tests require a running docker daemon doCheck = false; - meta = with lib; { + meta = { description = "PostgreSQL zero-downtime migrations made easy"; - license = licenses.asl20; + license = lib.licenses.asl20; homepage = "https://github.com/xataio/pgroll"; - maintainers = with maintainers; [ ilyakooo0 ]; + maintainers = with lib.maintainers; [ ilyakooo0 ]; }; } From a7292e0037b9eed46abba2078fff3156b9f5bcbb Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:14:27 +0800 Subject: [PATCH 4/6] pgroll: 0.7.0 -> 0.8.0 --- pkgs/by-name/pg/pgroll/package.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/pg/pgroll/package.nix b/pkgs/by-name/pg/pgroll/package.nix index a6652e3d0992..3aadec005797 100644 --- a/pkgs/by-name/pg/pgroll/package.nix +++ b/pkgs/by-name/pg/pgroll/package.nix @@ -2,19 +2,30 @@ buildGoModule, fetchFromGitHub, lib, + libpg_query, + xxHash, }: buildGoModule rec { pname = "pgroll"; - version = "0.7.0"; + version = "0.8.0"; src = fetchFromGitHub { owner = "xataio"; repo = "pgroll"; - rev = "v${version}"; - hash = "sha256-7hIdm/qdcwlXC+vrEbjmBunORfEyItsr+Hia5u4ZBZk="; + tag = "v${version}"; + hash = "sha256-iRa1dCUKmGUBpWjQXgKGrVu69WaTGQD8XhKmNxkF0JI="; }; - vendorHash = "sha256-jP4tTV/4kgT86d46L47Jcr/7ZtP2rL8boZiwqLvYo40="; + vendorHash = "sha256-XTypaCEB0+cfAmN4UyDRQgiF7spQhkiH2jCwjhd3I8Y="; + + excludedPackages = [ + "dev" + ]; + + buildInputs = [ + libpg_query + xxHash + ]; # Tests require a running docker daemon doCheck = false; From dce2ead662cda80c3f14808b5535fd808e477a36 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 04:23:59 +0800 Subject: [PATCH 5/6] squawk: format --- pkgs/by-name/sq/squawk/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sq/squawk/package.nix b/pkgs/by-name/sq/squawk/package.nix index f40ab2c2957e..09cda586f299 100644 --- a/pkgs/by-name/sq/squawk/package.nix +++ b/pkgs/by-name/sq/squawk/package.nix @@ -9,7 +9,6 @@ rustPlatform, stdenv, }: - rustPlatform.buildRustPackage rec { pname = "squawk"; version = "1.0.0"; @@ -50,11 +49,11 @@ rustPlatform.buildRustPackage rec { "--skip=parse::tests::test_parse_sql_query_json" ]; - meta = with lib; { + meta = { description = "Linter for PostgreSQL, focused on migrations"; - homepage = "https://squawkhq.com/"; + homepage = "https://squawkhq.com"; changelog = "https://github.com/sbdchd/squawk/blob/v${version}/CHANGELOG.md"; - license = licenses.gpl3Only; + license = with lib.licenses; [ gpl3Only ]; maintainers = with lib.maintainers; [ andrewsmith ]; }; } From d9c41db7e554db2412b2dbd327217e009c8933c5 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 04:25:20 +0800 Subject: [PATCH 6/6] squawk: 1.0.0 -> 1.4.0 --- pkgs/by-name/sq/squawk/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/sq/squawk/package.nix b/pkgs/by-name/sq/squawk/package.nix index 09cda586f299..8b236d549141 100644 --- a/pkgs/by-name/sq/squawk/package.nix +++ b/pkgs/by-name/sq/squawk/package.nix @@ -11,16 +11,18 @@ }: rustPlatform.buildRustPackage rec { pname = "squawk"; - version = "1.0.0"; + version = "1.4.0"; src = fetchFromGitHub { owner = "sbdchd"; - repo = pname; - rev = "v${version}"; - hash = "sha256-Uc357UspC2O/IxRRTy04jubzhKDRnIAN2CoHvbrGbHg="; + repo = "squawk"; + tag = "v${version}"; + hash = "sha256-uvgzfMMW/7oiy/SON+Hp4NItiGeKAAM+bMpQ7FPtfqY="; }; - cargoHash = "sha256-G0t3wvcp1Dm0ZCDnzTVf1XJ2Dtr0LyrKM1Vvso0IoaA="; + useFetchCargoVendor = true; + + cargoHash = "sha256-oIVtlVkW46UeNw2MCwECQON09fRzTKot3pDgWoC35D0="; nativeBuildInputs = [ pkg-config