1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 buildDotnetModule,
6 dotnetCorePackages,
7 powershell,
8 autoSignDarwinBinariesHook,
9 glibcLocales,
10}:
11buildDotnetModule (finalAttrs: {
12 pname = "ilspycmd";
13 version = "9.0-preview3";
14
15 src = fetchFromGitHub {
16 owner = "icsharpcode";
17 repo = "ILSpy";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-7cPXFaEKr76GtqcNsKx7tstRUeTpSTF8ggxbyEnQa9M=";
20 };
21
22 nativeBuildInputs = [
23 powershell
24 ]
25 ++ lib.optionals (stdenvNoCC.hostPlatform.isDarwin && stdenvNoCC.hostPlatform.isAarch64) [
26 autoSignDarwinBinariesHook
27 ];
28
29 # https://github.com/NixOS/nixpkgs/issues/38991
30 # bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
31 env.LOCALE_ARCHIVE = lib.optionalString stdenvNoCC.hostPlatform.isLinux "${glibcLocales}/lib/locale/locale-archive";
32
33 dotnet-sdk = dotnetCorePackages.sdk_8_0;
34
35 projectFile = "ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj";
36 nugetDeps = ./deps.json;
37
38 # see: https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/issues/94
39 linkNugetPackages = true;
40
41 meta = {
42 description = "Tool for decompiling .NET assemblies and generating portable PDBs";
43 mainProgram = "ilspycmd";
44 homepage = "https://github.com/icsharpcode/ILSpy";
45 changelog = "https://github.com/icsharpcode/ILSpy/releases/tag/${finalAttrs.src.rev}";
46 license = with lib.licenses; [
47 mit
48 # third party dependencies
49 mspl
50 asl20
51 ];
52 sourceProvenance = with lib.sourceTypes; [
53 fromSource
54 binaryBytecode
55 ];
56 maintainers = with lib.maintainers; [ emilytrau ];
57 };
58})