2023-11-16 04:20:00 +00:00
|
|
|
{ rustPlatform, fetchFromGitHub, lib, stdenv }:
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rustc-demangle";
|
|
|
|
version = "0.1.20";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alexcrichton";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-elxclyuLmr3N66s+pR4/6OU98k1oXI2wKVJtzWPY8FI=";
|
|
|
|
};
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
cargoLock = {
|
2021-09-18 10:52:07 +00:00
|
|
|
# generated using `cargo generate-lockfile` since repo is missing lockfile
|
2023-02-22 10:55:15 +00:00
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
cargoBuildFlags = [ "-p" "rustc-demangle-capi" ];
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
ln -s ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib
|
2023-11-16 04:20:00 +00:00
|
|
|
cp target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release/librustc_demangle.so $out/lib
|
2021-09-18 10:52:07 +00:00
|
|
|
cp -R crates/capi/include $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Rust symbol demangling";
|
|
|
|
homepage = "https://github.com/alexcrichton/rustc-demangle";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
# upstream supports other platforms, but maintainer can only test on linux
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ _1000teslas ];
|
|
|
|
};
|
|
|
|
}
|