about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/ilspycmd/default.nix
blob: b04bb86f4443fcdd0eab5f3ec980620ad0c95b6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, stdenv
, fetchFromGitHub
, buildDotnetModule
, dotnetCorePackages
, powershell
, autoSignDarwinBinariesHook
, glibcLocales
}:
buildDotnetModule rec {
  pname = "ilspycmd";
  version = "8.0";

  src = fetchFromGitHub {
    owner = "icsharpcode";
    repo = "ILSpy";
    rev = "v${version}";
    hash = "sha256-ERBYXgpBRXISfqBSBEydEQuD/5T1dvJ+wNg2U5pKip4=";
  };

  nativeBuildInputs = [
    powershell
  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook ];

  # https://github.com/NixOS/nixpkgs/issues/38991
  # bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  env.LOCALE_ARCHIVE = lib.optionalString stdenv.hostPlatform.isLinux "${glibcLocales}/lib/locale/locale-archive";

  dotnet-sdk = dotnetCorePackages.sdk_6_0;
  dotnet-runtime = dotnetCorePackages.runtime_6_0;

  projectFile = "ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj";
  nugetDeps = ./deps.nix;

  meta = with lib; {
    description = "Tool for decompiling .NET assemblies and generating portable PDBs";
    mainProgram = "ilspycmd";
    homepage = "https://github.com/icsharpcode/ILSpy";
    changelog = "https://github.com/icsharpcode/ILSpy/releases/tag/${src.rev}";
    license = with licenses; [
      mit
      # third party dependencies
      mspl
      asl20
    ];
    sourceProvenance = with sourceTypes; [ fromSource binaryBytecode ];
    maintainers = with maintainers; [ emilytrau ];
  };
}