Unverified Commit 43d58201 authored by Zexin Yuan's avatar Zexin Yuan Committed by Defelo
Browse files

taplo: fix completion generation on darwin

parent 85cd1ddd
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  stdenv,
  lib,
  rustPlatform,
  fetchCrate,
  fetchFromGitHub,
  pkg-config,
  openssl,
  withLsp ? true,
@@ -15,13 +15,22 @@ rustPlatform.buildRustPackage (finalAttrs: {
  pname = "taplo";
  version = "0.10.0";

  src = fetchCrate {
    inherit (finalAttrs) version;
    pname = "taplo-cli";
    hash = "sha256-iKc4Nu7AZE1LSuqXffi3XERbOqZMOkI3PV+6HaJzh4c=";
  src = fetchFromGitHub {
    owner = "tamasfe";
    repo = "taplo";
    tag = "release-taplo-cli-${finalAttrs.version}";
    hash = "sha256-FW8OQ5TRUuQK8M2NDmp4c6p22jsHodxKqzOMrcdiqXU=";
  };

  cargoHash = "sha256-tvijtB5fwOzQnnK/ClIvTbjCcMeqZpXcRdWWKZPIulM=";
  cargoPatches = [
    # Update reqwest to fix darwin sandboxing issues
    # See also: https://github.com/tamasfe/taplo/pull/669
    ./update-reqwest.patch
  ];

  cargoHash = "sha256-FMpGo+kRcNgDj4qwYvdQKGwGazUKKMIVq0HCYMrTql0=";

  buildAndTestSubdir = "crates/taplo-cli";

  nativeBuildInputs = [
    installShellFiles
@@ -32,15 +41,7 @@ rustPlatform.buildRustPackage (finalAttrs: {

  buildFeatures = lib.optional withLsp "lsp";

  postInstall =
    lib.optionalString
      (
        stdenv.buildPlatform.canExecute stdenv.hostPlatform
        &&
          # Creation of the completions fails on Darwin platforms.
          !stdenv.hostPlatform.isDarwin
      )
      ''
  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd taplo \
      --bash <($out/bin/taplo completions bash) \
      --fish <($out/bin/taplo completions fish) \
+1291 −0

File added.

Preview size limit exceeded, changes collapsed.