forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.3 KiB
Nix
46 lines
1.3 KiB
Nix
{ lib, stdenv, fetchFromGitHub, fetchpatch, rustPlatform, makeWrapper, Security }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "racerd";
|
|
version = "unstable-2019-09-02";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jwilm";
|
|
repo = "racerd";
|
|
rev = "e3d380b9a1d3f3b67286d60465746bc89fea9098";
|
|
sha256 = "13jqdvjk4savcl03mrn2vzgdsd7vxv2racqbyavrxp2cm9h6cjln";
|
|
};
|
|
|
|
cargoPatches = [
|
|
(fetchpatch {
|
|
url = "https://github.com/jwilm/racerd/commit/856f3656e160cd2909c5166e962f422c901720ee.patch";
|
|
sha256 = "1qq2k4bnwjz5qgn7s8yxd090smwn2wvdm8dd1rrlgpln0a5vxkpb";
|
|
})
|
|
];
|
|
|
|
cargoSha256 = "1z0dh2j9ik66i6nww3z7z2gw7nhc0b061zxbjzamk1jybpc845lq";
|
|
|
|
# a nightly compiler is required unless we use this cheat code.
|
|
RUSTC_BOOTSTRAP=1;
|
|
|
|
doCheck = false;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustcSrc;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -p $releaseDir/racerd $out/bin/
|
|
wrapProgram $out/bin/racerd --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
broken = true;
|
|
description = "JSON/HTTP Server based on racer for adding Rust support to editors and IDEs";
|
|
homepage = "https://github.com/jwilm/racerd";
|
|
license = licenses.asl20;
|
|
};
|
|
}
|