From 7bf9febfa6271012b1ef86647a3a06f06875fdcf Mon Sep 17 00:00:00 2001 From: éclairevoyant <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 1 May 2024 05:53:48 -0400 Subject: vscode-extensions.*: format with nixfmt (RFC 166) --- .../extensions/ms-dotnettools.csharp/default.nix | 113 +++++++++++---------- 1 file changed, 62 insertions(+), 51 deletions(-) (limited to 'pkgs/applications/editors/vscode/extensions/ms-dotnettools.csharp') diff --git a/pkgs/applications/editors/vscode/extensions/ms-dotnettools.csharp/default.nix b/pkgs/applications/editors/vscode/extensions/ms-dotnettools.csharp/default.nix index 213ce3550f45c..189804e981781 100644 --- a/pkgs/applications/editors/vscode/extensions/ms-dotnettools.csharp/default.nix +++ b/pkgs/applications/editors/vscode/extensions/ms-dotnettools.csharp/default.nix @@ -1,11 +1,11 @@ -{ lib -, vscode-utils -, patchelf -, icu -, stdenv -, openssl -, coreutils -, +{ + lib, + vscode-utils, + patchelf, + icu, + stdenv, + openssl, + coreutils, }: let inherit (stdenv.hostPlatform) system; @@ -26,31 +26,32 @@ let ".debugger/x86_64/vsdbg" ]; in - { - x86_64-linux = { - arch = "linux-x64"; - hash = "sha256-si4HKGVIHu44QNlNI2WEnMff9+QZOMWiBfWQaaFGyQE="; - binaries = linuxBins; - }; - aarch64-linux = { - arch = "linux-arm64"; - hash = "sha256-1IXkSRgCHOLD4VeCdqyy54MXCBUX5RDDb3pf7GQH5jA="; - binaries = linuxBins; - }; - x86_64-darwin = { - arch = "darwin-x64"; - hash = "sha256-AAbYjZ+YYyGEXSLkiFfluLf7P4OzPhmHzK44N5XT9UI="; - binaries = darwinBins; - }; - aarch64-darwin = { - arch = "darwin-arm64"; - hash = "sha256-1m47kX0Jo+UvthNfgdoPdBBOcDyCA8DfP+zRk3SicR0="; - binaries = darwinBins ++ [ - ".debugger/arm64/vsdbg-ui" - ".debugger/arm64/vsdbg" - ]; - }; - }.${system} or (throw "Unsupported system: ${system}"); + { + x86_64-linux = { + arch = "linux-x64"; + hash = "sha256-si4HKGVIHu44QNlNI2WEnMff9+QZOMWiBfWQaaFGyQE="; + binaries = linuxBins; + }; + aarch64-linux = { + arch = "linux-arm64"; + hash = "sha256-1IXkSRgCHOLD4VeCdqyy54MXCBUX5RDDb3pf7GQH5jA="; + binaries = linuxBins; + }; + x86_64-darwin = { + arch = "darwin-x64"; + hash = "sha256-AAbYjZ+YYyGEXSLkiFfluLf7P4OzPhmHzK44N5XT9UI="; + binaries = darwinBins; + }; + aarch64-darwin = { + arch = "darwin-arm64"; + hash = "sha256-1m47kX0Jo+UvthNfgdoPdBBOcDyCA8DfP+zRk3SicR0="; + binaries = darwinBins ++ [ + ".debugger/arm64/vsdbg-ui" + ".debugger/arm64/vsdbg" + ]; + }; + } + .${system} or (throw "Unsupported system: ${system}"); in buildVscodeMarketplaceExtension { mktplcRef = { @@ -60,16 +61,13 @@ buildVscodeMarketplaceExtension { inherit (extInfo) hash arch; }; - nativeBuildInputs = [ - patchelf - ]; + nativeBuildInputs = [ patchelf ]; - postPatch = '' + postPatch = + '' patchelf_add_icu_as_needed() { declare elf="''${1?}" - declare icu_major_v="${ - lib.head (lib.splitVersion (lib.getVersion icu.name)) - }" + declare icu_major_v="${lib.head (lib.splitVersion (lib.getVersion icu.name))}" for icu_lib in icui18n icuuc icudata; do patchelf --add-needed "lib''${icu_lib}.so.$icu_major_v" "$elf" @@ -82,7 +80,13 @@ buildVscodeMarketplaceExtension { patchelf_add_icu_as_needed "$elf" patchelf --add-needed "libssl.so" "$elf" patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${lib.makeLibraryPath [stdenv.cc.cc openssl icu.out]}:\$ORIGIN" \ + --set-rpath "${ + lib.makeLibraryPath [ + stdenv.cc.cc + openssl + icu.out + ] + }:\$ORIGIN" \ "$elf" } @@ -90,22 +94,29 @@ buildVscodeMarketplaceExtension { --replace 'uname -m' '${lib.getExe' coreutils "uname"} -m' '' - + (lib.concatStringsSep "\n" (map - (bin: '' + + (lib.concatStringsSep "\n" ( + map (bin: '' chmod +x "${bin}" - '') - extInfo.binaries)) - + lib.optionalString stdenv.isLinux (lib.concatStringsSep "\n" (map - (bin: '' - patchelf_common "${bin}" - '') - extInfo.binaries)); + '') extInfo.binaries + )) + + lib.optionalString stdenv.isLinux ( + lib.concatStringsSep "\n" ( + map (bin: '' + patchelf_common "${bin}" + '') extInfo.binaries + ) + ); meta = { description = "Official C# support for Visual Studio Code"; homepage = "https://github.com/dotnet/vscode-csharp"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ ggg ]; - platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; }; } -- cgit 1.4.1