nixpkgs/pkgs/applications/misc/avalonia-ilspy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

118 lines
2.7 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2023-07-20 04:25:42 +00:00
, fetchFromGitHub
, buildDotnetModule
, dotnetCorePackages
, libX11
, libICE
, libSM
2023-07-20 04:25:42 +00:00
, libXi
, libXcursor
, libXext
, libXrandr
, fontconfig
, glew
, makeDesktopItem
, copyDesktopItems
, icoutils
, autoPatchelfHook
, bintools
, fixDarwinDylibNames
, autoSignDarwinBinariesHook
}:
2023-07-20 04:25:42 +00:00
buildDotnetModule rec {
pname = "avalonia-ilspy";
version = "7.2-rc";
2023-07-20 04:25:42 +00:00
src = fetchFromGitHub {
owner = "icsharpcode";
repo = "AvaloniaILSpy";
rev = "v${version}";
sha256 = "cCQy5cSpJNiVZqgphURcnraEM0ZyXGhzJLb5AThNfPQ=";
};
2023-07-20 04:25:42 +00:00
patches = [
# Remove dead nuget package source
./remove-broken-sources.patch
];
nativeBuildInputs = [
copyDesktopItems
2023-07-20 04:25:42 +00:00
icoutils
] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ bintools fixDarwinDylibNames ]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook ];
buildInputs = [
2023-07-20 04:25:42 +00:00
# Dependencies of nuget packages w/ native binaries
stdenv.cc.cc.lib
fontconfig
];
2023-07-20 04:25:42 +00:00
runtimeDeps = [
# Avalonia UI
libX11
libICE
libSM
2023-07-20 04:25:42 +00:00
libXi
libXcursor
libXext
libXrandr
fontconfig
glew
];
2023-07-20 04:25:42 +00:00
postInstall = ''
icotool --icon -x ILSpy/ILSpy.ico
for i in 16 32 48 256; do
size=''${i}x''${i}
install -Dm444 *_''${size}x32.png $out/share/icons/hicolor/$size/apps/ILSpy.png
done
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
install -Dm444 ILSpy/Info.plist $out/Applications/ILSpy.app/Contents/Info.plist
install -Dm444 ILSpy/ILSpy.icns $out/Applications/ILSpy.app/Contents/Resources/ILSpy.icns
mkdir -p $out/Applications/ILSpy.app/Contents/MacOS
ln -s $out/bin/ILSpy $out/Applications/ILSpy.app/Contents/MacOS/ILSpy
'';
2023-07-20 04:25:42 +00:00
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.runtime_6_0;
2023-07-20 04:25:42 +00:00
projectFile = "ILSpy/ILSpy.csproj";
nugetDeps = ./deps.nix;
executables = [ "ILSpy" ];
2023-07-20 04:25:42 +00:00
desktopItems = [
(makeDesktopItem {
name = "ILSpy";
desktopName = "ILSpy";
exec = "ILSpy";
icon = "ILSpy";
comment = ".NET assembly browser and decompiler";
categories = [
"Development"
];
keywords = [
".net"
"il"
"assembly"
];
})
];
meta = with lib; {
description = ".NET assembly browser and decompiler";
homepage = "https://github.com/icsharpcode/AvaloniaILSpy";
2023-07-20 04:25:42 +00:00
license = with licenses; [
mit
# third party dependencies
lgpl21Only
mspl
];
sourceProvenance = with sourceTypes; [ fromSource binaryBytecode binaryNativeCode ];
maintainers = with maintainers; [ AngryAnt emilytrau ];
mainProgram = "ILSpy";
};
}