Commit bccab8b1 authored by myypo's avatar myypo
Browse files

postgres-lsp: 0-unstable-2024-03-24 -> 0.5.0

parent 5add3c51
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -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;

    # 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;
  };

  RUSTC_BOOTSTRAP = 1; # We need rust unstable features
  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";
  };
})