From 5add3c51c3e34d319c376b0a1c9b3f28cfbe4187 Mon Sep 17 00:00:00 2001 From: myypo Date: Sun, 13 Apr 2025 17:23:08 +0300 Subject: [PATCH 1/2] postgres-lsp: modernize --- pkgs/by-name/po/postgres-lsp/package.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/po/postgres-lsp/package.nix b/pkgs/by-name/po/postgres-lsp/package.nix index 538ba40addef..29603e99439a 100644 --- a/pkgs/by-name/po/postgres-lsp/package.nix +++ b/pkgs/by-name/po/postgres-lsp/package.nix @@ -4,8 +4,7 @@ fetchFromGitHub, protobuf, }: - -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "postgres-lsp"; version = "0-unstable-2024-03-24"; @@ -26,15 +25,15 @@ rustPlatform.buildRustPackage rec { ]; cargoBuildFlags = [ "-p=postgres_lsp" ]; - cargoTestFlags = cargoBuildFlags; + cargoTestFlags = finalAttrs.cargoBuildFlags; RUSTC_BOOTSTRAP = 1; # We need rust unstable features - meta = with lib; { + meta = { description = "Language Server for Postgres"; homepage = "https://github.com/supabase/postgres_lsp"; - license = licenses.mit; - maintainers = with maintainers; [ figsoda ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ figsoda ]; mainProgram = "postgres_lsp"; }; -} +}) From bccab8b1c7e06363e22576d6482175cab5b3206e Mon Sep 17 00:00:00 2001 From: myypo Date: Sat, 19 Apr 2025 21:45:11 +0300 Subject: [PATCH 2/2] postgres-lsp: 0-unstable-2024-03-24 -> 0.5.0 --- pkgs/by-name/po/postgres-lsp/package.nix | 36 +++++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/po/postgres-lsp/package.nix b/pkgs/by-name/po/postgres-lsp/package.nix index 29603e99439a..be8814b96a81 100644 --- a/pkgs/by-name/po/postgres-lsp/package.nix +++ b/pkgs/by-name/po/postgres-lsp/package.nix @@ -2,38 +2,46 @@ lib, rustPlatform, fetchFromGitHub, - protobuf, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "postgres-lsp"; - version = "0-unstable-2024-03-24"; + version = "0.5.0"; src = fetchFromGitHub { - owner = "supabase"; - repo = "postgres_lsp"; - rev = "43ca9b675cb152ca7f38cfa6aff6dd2131dfa9a2"; - hash = "sha256-n7Qbt9fGzC0CcleAtTWDInPz4oaPjI+pvIPrR5EYJ9U="; + owner = "supabase-community"; + repo = "postgres-language-server"; + tag = finalAttrs.version; + hash = "sha256-JRCuqJvC+OBdYe2JORwOfghr7smVLsROwrhk5H+SSkc="; fetchSubmodules = true; }; useFetchCargoVendor = true; - cargoHash = "sha256-9T3bm/TSjnFeF8iE4338I44espnFq6l36yOq8YFPaPQ="; + cargoHash = "sha256-lUZpjX3HljOXi0Wt2xZCUru8uinWlngLEs5wlqfFiJA="; nativeBuildInputs = [ - protobuf rustPlatform.bindgenHook ]; - cargoBuildFlags = [ "-p=postgres_lsp" ]; - cargoTestFlags = finalAttrs.cargoBuildFlags; + env = { + SQLX_OFFLINE = 1; - RUSTC_BOOTSTRAP = 1; # We need rust unstable features + # As specified in the upstream: https://github.com/supabase-community/postgres-language-server/blob/main/.github/workflows/release.yml + RUSTFLAGS = "-C strip=symbols -C codegen-units=1"; + PGT_VERSION = finalAttrs.version; + }; + + cargoBuildFlags = [ "-p=pgt_cli" ]; + cargoTestFlags = finalAttrs.cargoBuildFlags; + checkFlags = [ + # Tries to write to the file system relatively to the current path + "--skip=syntax_error" + ]; meta = { - description = "Language Server for Postgres"; - homepage = "https://github.com/supabase/postgres_lsp"; + description = "Tools and language server for Postgres"; + homepage = "https://pgtools.dev"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ figsoda ]; - mainProgram = "postgres_lsp"; + mainProgram = "postgrestools"; }; })