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
75
pkgs/development/beam-modules/elixir-ls/default.nix
Normal file
75
pkgs/development/beam-modules/elixir-ls/default.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{ lib, elixir, fetchFromGitHub, fetchMixDeps, mixRelease }:
|
||||
# Based on the work of Hauleth
|
||||
# None of this would have happened without him
|
||||
|
||||
let
|
||||
pname = "elixir-ls";
|
||||
pinData = lib.importJSON ./pin.json;
|
||||
version = pinData.version;
|
||||
src = fetchFromGitHub {
|
||||
owner = "elixir-lsp";
|
||||
repo = "elixir-ls";
|
||||
rev = "v${version}";
|
||||
sha256 = pinData.sha256;
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
in
|
||||
mixRelease {
|
||||
inherit pname version src elixir;
|
||||
|
||||
mixFodDeps = fetchMixDeps {
|
||||
pname = "mix-deps-${pname}";
|
||||
inherit src version elixir;
|
||||
sha256 = pinData.depsSha256;
|
||||
};
|
||||
|
||||
# elixir_ls is an umbrella app
|
||||
# override configurePhase to not skip umbrella children
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
mix deps.compile --no-deps-check
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
# elixir_ls require a special step for release
|
||||
# compile and release need to be performed together because
|
||||
# of the no-deps-check requirement
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
mix do compile --no-deps-check, elixir_ls.release
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp -Rv release $out/lib
|
||||
# Prepare the wrapper script
|
||||
substitute release/language_server.sh $out/bin/elixir-ls \
|
||||
--replace 'exec "''${dir}/launch.sh"' "exec $out/lib/launch.sh"
|
||||
chmod +x $out/bin/elixir-ls
|
||||
# prepare the launcher
|
||||
substituteInPlace $out/lib/launch.sh \
|
||||
--replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" \
|
||||
"ERL_LIBS=$out/lib:\$ERL_LIBS" \
|
||||
--replace "exec elixir" "exec ${elixir}/bin/elixir"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/elixir-lsp/elixir-ls";
|
||||
description = ''
|
||||
A frontend-independent IDE "smartness" server for Elixir.
|
||||
Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
|
||||
'';
|
||||
longDescription = ''
|
||||
The Elixir Language Server provides a server that runs in the background, providing IDEs, editors, and other tools with information about Elixir Mix projects.
|
||||
It adheres to the Language Server Protocol, a standard for frontend-independent IDE support.
|
||||
Debugger integration is accomplished through the similar VS Code Debug Protocol.
|
||||
'';
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.unix;
|
||||
maintainers = teams.beam.members;
|
||||
};
|
||||
passthru.updateScript = ./update.sh;
|
||||
}
|
||||
5
pkgs/development/beam-modules/elixir-ls/pin.json
Normal file
5
pkgs/development/beam-modules/elixir-ls/pin.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"version": "0.9.0",
|
||||
"sha256": "sha256-dHHmA9TAM5YEfbUoujgy1XLzdh7zGWhR9SsFoTnKX48=",
|
||||
"depsSha256": "sha256-YkZ/tp537ULKfXka4IdD+RgLlXuv6ayxdYn9KFyXrr4="
|
||||
}
|
||||
31
pkgs/development/beam-modules/elixir-ls/update.sh
Executable file
31
pkgs/development/beam-modules/elixir-ls/update.sh
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i oil -p jq sd nix-prefetch-github ripgrep
|
||||
|
||||
# TODO set to `verbose` or `extdebug` once implemented in oil
|
||||
set -x
|
||||
|
||||
const directory = $(dirname $0 | xargs realpath)
|
||||
const owner = "elixir-lsp"
|
||||
const repo = "elixir-ls"
|
||||
const latest_rev = $(curl -q https://api.github.com/repos/${owner}/${repo}/releases/latest | \
|
||||
jq -r '.tag_name')
|
||||
const latest_version = $(echo $latest_rev | sd 'v' '')
|
||||
const current_version = $(jq -r '.version' $directory/pin.json)
|
||||
if ("$latest_version" === "$current_version") {
|
||||
echo "elixir-ls is already up-to-date"
|
||||
return 0
|
||||
} else {
|
||||
const tarball_meta = $(nix-prefetch-github $owner $repo --rev "$latest_rev")
|
||||
const tarball_hash = "sha256-$(echo $tarball_meta | jq -r '.sha256')"
|
||||
const sha256s = $(rg '"sha256-.+"' $directory/default.nix | sd '.+"(.+)";' '$1' )
|
||||
|
||||
jq ".version = \"$latest_version\" | \
|
||||
.\"sha256\" = \"$tarball_hash\" | \
|
||||
.\"depsSha256\" = \"\"" $directory/pin.json | sponge $directory/pin.json
|
||||
|
||||
const new_mix_hash = $(nix-build -A elixir_ls.mixFodDeps 2>&1 | \
|
||||
tail -n 1 | \
|
||||
sd '\s+got:\s+' '')
|
||||
|
||||
jq ".depsSha256 = \"$new_mix_hash\"" $directory/pin.json | sponge $directory/pin.json
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue