2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-08-10 07:59:29 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildDotnetModule
|
|
|
|
, dotnetCorePackages
|
2022-08-12 12:06:08 +00:00
|
|
|
, libX11
|
|
|
|
, libICE
|
|
|
|
, libSM
|
2023-08-10 07:59:29 +00:00
|
|
|
, libXi
|
|
|
|
, libXcursor
|
|
|
|
, libXext
|
|
|
|
, libXrandr
|
|
|
|
, fontconfig
|
|
|
|
, glew
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, icoutils
|
|
|
|
, autoPatchelfHook
|
|
|
|
, bintools
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, autoSignDarwinBinariesHook
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
buildDotnetModule rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "avalonia-ilspy";
|
|
|
|
version = "7.2-rc";
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "icsharpcode";
|
|
|
|
repo = "AvaloniaILSpy";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "cCQy5cSpJNiVZqgphURcnraEM0ZyXGhzJLb5AThNfPQ=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
patches = [
|
|
|
|
# Remove dead nuget package source
|
|
|
|
./remove-broken-sources.patch
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
copyDesktopItems
|
2023-08-10 07:59:29 +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 ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-08-10 07:59:29 +00:00
|
|
|
# Dependencies of nuget packages w/ native binaries
|
2022-08-12 12:06:08 +00:00
|
|
|
stdenv.cc.cc.lib
|
|
|
|
fontconfig
|
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
runtimeDeps = [
|
|
|
|
# Avalonia UI
|
2022-08-12 12:06:08 +00:00
|
|
|
libX11
|
|
|
|
libICE
|
|
|
|
libSM
|
2023-08-10 07:59:29 +00:00
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXext
|
|
|
|
libXrandr
|
|
|
|
fontconfig
|
|
|
|
glew
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +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
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_6_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_6_0;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
projectFile = "ILSpy/ILSpy.csproj";
|
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
executables = [ "ILSpy" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "ILSpy";
|
|
|
|
desktopName = "ILSpy";
|
|
|
|
exec = "ILSpy";
|
|
|
|
icon = "ILSpy";
|
|
|
|
comment = ".NET assembly browser and decompiler";
|
|
|
|
categories = [
|
|
|
|
"Development"
|
|
|
|
];
|
|
|
|
keywords = [
|
|
|
|
".net"
|
|
|
|
"il"
|
|
|
|
"assembly"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = ".NET assembly browser and decompiler";
|
|
|
|
homepage = "https://github.com/icsharpcode/AvaloniaILSpy";
|
2023-08-10 07:59:29 +00:00
|
|
|
license = with licenses; [
|
|
|
|
mit
|
|
|
|
# third party dependencies
|
|
|
|
lgpl21Only
|
|
|
|
mspl
|
|
|
|
];
|
|
|
|
sourceProvenance = with sourceTypes; [ fromSource binaryBytecode binaryNativeCode ];
|
|
|
|
maintainers = with maintainers; [ AngryAnt emilytrau ];
|
2023-07-15 17:15:38 +00:00
|
|
|
mainProgram = "ILSpy";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
}
|