uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "rust-analyzer",
|
||||
"version": "0.3.1059",
|
||||
"dependencies": {
|
||||
"d3": "^7.3.0",
|
||||
"d3-graphviz": "^4.1.0",
|
||||
"vscode-languageclient": "8.0.0-next.14",
|
||||
"@types/node": "~14.17.5",
|
||||
"@types/vscode": "~1.66.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
||||
"@typescript-eslint/parser": "^5.16.0",
|
||||
"@vscode/test-electron": "^2.1.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.11.0",
|
||||
"tslib": "^2.3.0",
|
||||
"typescript": "^4.6.3",
|
||||
"typescript-formatter": "^7.2.2",
|
||||
"vsce": "^2.7.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, vscode-utils
|
||||
, jq
|
||||
, rust-analyzer
|
||||
, nodePackages
|
||||
, moreutils
|
||||
, esbuild
|
||||
, pkg-config
|
||||
, libsecret
|
||||
, stdenv
|
||||
, darwin
|
||||
, setDefaultServerPath ? true
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "rust-analyzer";
|
||||
publisher = "rust-lang";
|
||||
|
||||
# Use the plugin version as in vscode marketplace, updated by update script.
|
||||
inherit (vsix) version;
|
||||
|
||||
releaseTag = "2022-05-17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rust-lang";
|
||||
repo = "rust-analyzer";
|
||||
rev = releaseTag;
|
||||
sha256 = "sha256-vrVpgQYUuJPgK1NMb1nxlCdxjoYo40YkUbZpH2Z2mwM=";
|
||||
};
|
||||
|
||||
build-deps = nodePackages."rust-analyzer-build-deps-../../applications/editors/vscode/extensions/rust-analyzer/build-deps";
|
||||
# FIXME: Making a new derivation to link `node_modules` and run `npm run package`
|
||||
# will cause a build failure.
|
||||
vsix = build-deps.override {
|
||||
src = "${src}/editors/code";
|
||||
outputs = [ "vsix" "out" ];
|
||||
|
||||
inherit releaseTag;
|
||||
|
||||
nativeBuildInputs = [
|
||||
jq moreutils esbuild
|
||||
# Required by `keytar`, which is a dependency of `vsce`.
|
||||
pkg-config libsecret
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.AppKit
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
];
|
||||
|
||||
# Follows https://github.com/rust-lang/rust-analyzer/blob/41949748a6123fd6061eb984a47f4fe780525e63/xtask/src/dist.rs#L39-L65
|
||||
postInstall = ''
|
||||
jq '
|
||||
.version = $ENV.version |
|
||||
.releaseTag = $ENV.releaseTag |
|
||||
.enableProposedApi = false |
|
||||
walk(del(.["$generated-start"]?) | del(.["$generated-end"]?))
|
||||
' package.json | sponge package.json
|
||||
|
||||
mkdir -p $vsix
|
||||
# vsce ask for continue due to missing LICENSE.md
|
||||
# Should be removed after https://github.com/rust-lang/rust-analyzer/commit/acd5c1f19bf7246107aaae7b6fe3f676a516c6d2
|
||||
echo y | npx vsce package -o $vsix/${pname}.zip
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
vscode-utils.buildVscodeExtension {
|
||||
inherit version vsix;
|
||||
name = "${pname}-${version}";
|
||||
src = "${vsix}/${pname}.zip";
|
||||
vscodeExtUniqueId = "${publisher}.${pname}";
|
||||
|
||||
nativeBuildInputs = lib.optionals setDefaultServerPath [ jq moreutils ];
|
||||
|
||||
preInstall = lib.optionalString setDefaultServerPath ''
|
||||
jq '.contributes.configuration.properties."rust-analyzer.server.path".default = $s' \
|
||||
--arg s "${rust-analyzer}/bin/rust-analyzer" \
|
||||
package.json | sponge package.json
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "An alternative rust language server to the RLS";
|
||||
homepage = "https://github.com/rust-lang/rust-analyzer";
|
||||
license = with licenses; [ mit asl20 ];
|
||||
maintainers = with maintainers; [ ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
51
pkgs/applications/editors/vscode/extensions/rust-analyzer/update.sh
Executable file
51
pkgs/applications/editors/vscode/extensions/rust-analyzer/update.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq libarchive
|
||||
#shellcheck shell=bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
nixpkgs=../../../../../../
|
||||
node_packages="$nixpkgs/pkgs/development/node-packages"
|
||||
owner=rust-lang
|
||||
repo=rust-analyzer
|
||||
ver=$(
|
||||
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
|
||||
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
|
||||
)
|
||||
node_src="$(nix-build "$nixpkgs" -A rust-analyzer.src --no-out-link)/editors/code"
|
||||
|
||||
# Check vscode compatibility
|
||||
req_vscode_ver="$(jq '.engines.vscode' "$node_src/package.json" --raw-output)"
|
||||
req_vscode_ver="${req_vscode_ver#^}"
|
||||
cur_vscode_ver="$(nix-instantiate --eval --strict "$nixpkgs" -A vscode.version | tr -d '"')"
|
||||
if [[ "$(nix-instantiate --eval --strict -E "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then
|
||||
echo "vscode $cur_vscode_ver is incompatible with the extension requiring ^$req_vscode_ver"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extension_ver=$(curl "https://github.com/$owner/$repo/releases/download/$ver/rust-analyzer-linux-x64.vsix" -L |
|
||||
bsdtar -xf - --to-stdout extension/package.json | # Use bsdtar to extract vsix(zip).
|
||||
jq --raw-output '.version')
|
||||
echo "Extension version: $extension_ver"
|
||||
|
||||
# We need devDependencies to build vsix.
|
||||
# `esbuild` is a binary package an is already in nixpkgs so we omit it here.
|
||||
jq '{ name, version: $ver, dependencies: (.dependencies + .devDependencies | del(.esbuild)) }' "$node_src/package.json" \
|
||||
--arg ver "$extension_ver" \
|
||||
>"build-deps/package.json.new"
|
||||
|
||||
old_deps="$(jq '.dependencies' build-deps/package.json)"
|
||||
new_deps="$(jq '.dependencies' build-deps/package.json.new)"
|
||||
if [[ "$old_deps" == "$new_deps" ]]; then
|
||||
echo "package.json dependencies not changed, do simple version change"
|
||||
|
||||
sed -E '/^ "rust-analyzer-build-deps/,+3 s/version = ".*"/version = "'"$extension_ver"'"/' \
|
||||
--in-place "$node_packages"/node-packages.nix
|
||||
mv build-deps/package.json{.new,}
|
||||
else
|
||||
echo "package.json dependencies changed, updating nodePackages"
|
||||
mv build-deps/package.json{.new,}
|
||||
|
||||
./"$node_packages"/generate.sh
|
||||
fi
|
||||
|
||||
echo "Remember to also update the revisionTag and hash in default.nix!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue