From 275a8ac12a6c7ac60d1ec39941a36f116becc942 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sun, 13 Oct 2024 20:57:07 +0200 Subject: [PATCH] dnspy: init at 6.5.1 --- pkgs/by-name/dn/dnspy/deps.nix | 80 ++++++++++++++++++++++++++ pkgs/by-name/dn/dnspy/package.nix | 89 +++++++++++++++++++++++++++++ pkgs/by-name/dn/dnspy/wrapper.nix | 86 ++++++++++++++++++++++++++++ pkgs/by-name/dn/dnspy32/package.nix | 9 +++ 4 files changed, 264 insertions(+) create mode 100644 pkgs/by-name/dn/dnspy/deps.nix create mode 100644 pkgs/by-name/dn/dnspy/package.nix create mode 100644 pkgs/by-name/dn/dnspy/wrapper.nix create mode 100644 pkgs/by-name/dn/dnspy32/package.nix diff --git a/pkgs/by-name/dn/dnspy/deps.nix b/pkgs/by-name/dn/dnspy/deps.nix new file mode 100644 index 0000000000000..ce021bca1ef68 --- /dev/null +++ b/pkgs/by-name/dn/dnspy/deps.nix @@ -0,0 +1,80 @@ +# This file was automatically generated by passthru.fetch-deps. +# Please dont edit it manually, your changes might get overwritten! + +{ fetchNuGet }: [ + (fetchNuGet { pname = "dnlib"; version = "4.4.0"; hash = "sha256-x8Rha6NSDZFwHH5FcqY+lbkkpBLYlLYwBRU9JLKVD7o="; }) + (fetchNuGet { pname = "Humanizer.Core"; version = "2.14.1"; hash = "sha256-EXvojddPu+9JKgOG9NSQgUTfWq1RpOYw7adxDPKDJ6o="; }) + (fetchNuGet { pname = "Iced"; version = "1.21.0"; hash = "sha256-0xYTYX4935Ejm7yUqMWHhJtCNuj4oqK6Weojl6FIfHo="; }) + (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "8.0.0"; hash = "sha256-9aWmiwMJKrKr9ohD1KSuol37y+jdDxPGJct3m2/Bknw="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis"; version = "4.10.0"; hash = "sha256-Rj8ZR0bsD6gcwuRr3lrLw1uLwcoL/9vuAkqhOC+0x+0="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.3.4"; hash = "sha256-qDzTfZBSCvAUu9gzq2k+LOvh6/eRvJ9++VCNck/ZpnE="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.AnalyzerUtilities"; version = "3.3.0"; hash = "sha256-nzFs+H0FFEgZzjl/bcmWyQQVKS2PncS6kMYHOqrxXSw="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "4.10.0"; hash = "sha256-gtGxb7gPSOWVN2SS5CaHtZO+i6hvBbiXyA2AZ8dOKzY="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "4.10.0"; hash = "sha256-HjKeyCBJ+tylS3EaF18Z99Qj2F0eJQvUZo/pYrBcfLI="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp.Features"; version = "4.10.0"; hash = "sha256-Kh5KuxYX9v9K7MsTJufx1R6Rl3ub863mkEP1LrNleMA="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp.Scripting"; version = "4.10.0"; hash = "sha256-/fU2kN+aEaNpxnrkuCqmldnYGfChhrmVtpX+yy3fF8s="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp.Workspaces"; version = "4.10.0"; hash = "sha256-aV/9HDvmZiNzbLVadT2prMuFbVOs3iMbIc0uQpX+ymM="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Elfie"; version = "1.0.0"; hash = "sha256-E/+PlegvWZ59e5Ti3TvKJBLa3qCnDKmi7+DcnOo1ufg="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Features"; version = "4.10.0"; hash = "sha256-s7CLO4q0bH7f9kV0QKxPJ8fYUma7QrJvkDRlk7OGx9k="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Scripting.Common"; version = "4.10.0"; hash = "sha256-mvqF0kxxy3IVYx9zWYTDwl91szvytYxaqYUZ1aiCTUQ="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.VisualBasic"; version = "4.10.0"; hash = "sha256-70YwwVdgGXlBi4CIxFILnMi2Vz7PibxP0ZgNZh2MLok="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.VisualBasic.Features"; version = "4.10.0"; hash = "sha256-ULJ4PUzvINE5tcBwWycuK9h2Ti/sjajaQIcd1slJUxA="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.VisualBasic.Workspaces"; version = "4.10.0"; hash = "sha256-cAAtn1hgYy15zM1nC7PgK9T5Qy2KHMqS9NYIIRr5ZcI="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Workspaces.Common"; version = "4.10.0"; hash = "sha256-5zaaeBacdeqgEv50mJ9g/YN2yhNKvErXyMZsU7coOUM="; }) + (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.7.0"; hash = "sha256-Enknv2RsFF68lEPdrf5M+BpV1kHoLTVRApKUwuk/pj0="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim"; version = "8.0.510501"; hash = "sha256-g1QJZvNcCxdS/623XqwkJt3XseTC9sPwWfrQTOjNOxU="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-arm"; version = "8.0.510501"; hash = "sha256-Kl27aHMvI2Fyo9iT+SS8N0k+eexd+bf2GjIyxL+2vi4="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-arm64"; version = "8.0.510501"; hash = "sha256-2OymQoxpeId2w8YGvrQF+sK3etnl1jItdUv7woBksf4="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-musl-arm"; version = "8.0.510501"; hash = "sha256-3AM+MxPRIeQeTQ3bSXzZ07LtjDTAv45u/6xKWN4INDc="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-musl-arm64"; version = "8.0.510501"; hash = "sha256-ZBwBrOhRCXEBH0LROqq5pk+D+rSLHxNm+yVYONL4qzY="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-musl-x64"; version = "8.0.510501"; hash = "sha256-LxkH4k+XKGELuVCwTAQ5Fg6RP0UibI2VAlkDg4/Pnpg="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.linux-x64"; version = "8.0.510501"; hash = "sha256-09e/9r22NdwLKrpXQ4KsUkNI2QRn+E9eKUlVVeynfwY="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.osx-arm64"; version = "8.0.510501"; hash = "sha256-MR5+zcf0e16SlNxd0HZ6bOYehUZU2lDK5lr1SJY/62g="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.osx-x64"; version = "8.0.510501"; hash = "sha256-Lpgn5rwjf+gH6A56Uf7KyUxTcFXg8YXO4zpAZ/Y46Pg="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.win-arm"; version = "8.0.510501"; hash = "sha256-d1sTw6L4rrOW0WulyoEKAkH+bLj6wqd1vsHivVdlbO0="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.win-arm64"; version = "8.0.510501"; hash = "sha256-jyhrx+x1jKUgNq0zgyte0f8gExiwjgqduj1fLppbaK4="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.win-x64"; version = "8.0.510501"; hash = "sha256-2G/AFIR5/P5NFGzYyC4eQNl+9FZnrbxGjVf0VkQn4FU="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.DbgShim.win-x86"; version = "8.0.510501"; hash = "sha256-t+L9LbwakGnx625hVKunpiyX+jV1abcemP5vHiHGRO4="; }) + (fetchNuGet { pname = "Microsoft.Diagnostics.Runtime"; version = "1.1.142101"; hash = "sha256-6diZT/XBSfF2lpZrmcxvqEm8jRb5uAomoXTFiuZiJc8="; }) + (fetchNuGet { pname = "Microsoft.DiaSymReader"; version = "2.0.0"; hash = "sha256-8hotZmh8Rb6Q6oD9Meb74SvAdbDo39Y/1m8h43HHjjw="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Composition"; version = "17.10.37"; hash = "sha256-Lq0XlMb7eqfMsu+NsptjCZReU3vRH5+JGvPU1VbuyEY="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Composition.Analyzers"; version = "17.10.37"; hash = "sha256-pckf7uZKhMSLxGHtrR2P3qdeNTtEDjAJGvagQ0Oocww="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.CoreUtility"; version = "15.5.27130"; hash = "sha256-mb1Xz+Nc5L2DF/9dQDzExO6VhJbT17jCQMa1QGaLxbM="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Language.Intellisense"; version = "15.5.27130"; hash = "sha256-B50voQegMnPUXV4MZKjsQ1svPo+uwYLugtD60qQnO00="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Text.Data"; version = "15.5.27130"; hash = "sha256-p19pt6/oiOVcQUJ2vd7uav+ef4E/2L3s/XURCQ6sPNg="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Text.Logic"; version = "15.5.27130"; hash = "sha256-O9KvdkpX1ikP5fZKfFGL+fcUFm1qPXv+ZtmmtwmDxaE="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Text.UI"; version = "15.5.27130"; hash = "sha256-RNcSVzMflgsTSHBO2qrtymQdsQJ9/1KQ+Ze+qIVXyio="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Text.UI.Wpf"; version = "15.5.27130"; hash = "sha256-WxeN3vcQu3mUiB/hTuB1Pm49bUx+FZQ3b4kGKfgdUQE="; }) + (fetchNuGet { pname = "Microsoft.VisualStudio.Validation"; version = "17.8.8"; hash = "sha256-sB8GLRiJHX3Py7qeBUnUANiDWhyPtISon6HQs+8wKms="; }) + (fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.3"; hash = "sha256-hy/BieY4qxBWVVsDqqOPaLy1QobiIapkbrESm6v2PHc="; }) + (fetchNuGet { pname = "NuGet.Common"; version = "6.10.0"; hash = "sha256-cM3Q7srAykk6KA/FThZkDjs+MIIjiUJSXZjRSqPNP1o="; }) + (fetchNuGet { pname = "NuGet.Configuration"; version = "6.10.0"; hash = "sha256-H/qaaKbyp3oo/w2dBvaXEhG5+Tgcp75tJR1brpSdCqs="; }) + (fetchNuGet { pname = "NuGet.Frameworks"; version = "6.10.0"; hash = "sha256-E88PUsK5J0b9c0sN+xNZU+X1MOCfJaIvByr1H4ZHLUM="; }) + (fetchNuGet { pname = "Ookii.Dialogs.Wpf"; version = "5.0.1"; hash = "sha256-vwrvxeQ22nsFtex2gcGyhTi/XqZm2uIV1y/4PyvrdYk="; }) + (fetchNuGet { pname = "System.Buffers"; version = "4.5.1"; hash = "sha256-wws90sfi9M7kuCPWkv1CEYMJtCqx9QB/kj0ymlsNaxI="; }) + (fetchNuGet { pname = "System.Collections.Immutable"; version = "8.0.0"; hash = "sha256-F7OVjKNwpqbUh8lTidbqJWYi476nsq9n+6k0+QVRo3w="; }) + (fetchNuGet { pname = "System.ComponentModel.Composition"; version = "8.0.0"; hash = "sha256-MnKdjE/qIvAmEeRc3gOn5uJhT0TI3UnUJPjj3TLHFQo="; }) + (fetchNuGet { pname = "System.Composition"; version = "8.0.0"; hash = "sha256-rA118MFj6soKN++BvD3y9gXAJf0lZJAtGARuznG5+Xg="; }) + (fetchNuGet { pname = "System.Composition.AttributedModel"; version = "8.0.0"; hash = "sha256-n3aXiBAFIlQicSRLiNtLh++URSUxRBLggsjJ8OMNRpo="; }) + (fetchNuGet { pname = "System.Composition.Convention"; version = "8.0.0"; hash = "sha256-Z9HOAnH1lt1qc38P3Y0qCf5gwBwiLXQD994okcy53IE="; }) + (fetchNuGet { pname = "System.Composition.Hosting"; version = "8.0.0"; hash = "sha256-axKJC71oKiNWKy66TVF/c3yoC81k03XHAWab3mGNbr0="; }) + (fetchNuGet { pname = "System.Composition.Runtime"; version = "8.0.0"; hash = "sha256-AxwZ29+GY0E35Pa255q8AcMnJU52Txr5pBy86t6V1Go="; }) + (fetchNuGet { pname = "System.Composition.TypedParts"; version = "8.0.0"; hash = "sha256-+ZJawThmiYEUNJ+cB9uJK+u/sCAVZarGd5ShZoSifGo="; }) + (fetchNuGet { pname = "System.Configuration.ConfigurationManager"; version = "8.0.0"; hash = "sha256-xhljqSkNQk8DMkEOBSYnn9lzCSEDDq4yO910itptqiE="; }) + (fetchNuGet { pname = "System.Data.DataSetExtensions"; version = "4.5.0"; hash = "sha256-qppO0L8BpI7cgaStqBhn6YJYFjFdSwpXlRih0XFsaT4="; }) + (fetchNuGet { pname = "System.Diagnostics.EventLog"; version = "8.0.0"; hash = "sha256-rt8xc3kddpQY4HEdghlBeOK4gdw5yIj4mcZhAVtk2/Y="; }) + (fetchNuGet { pname = "System.IO.Pipelines"; version = "8.0.0"; hash = "sha256-LdpB1s4vQzsOODaxiKstLks57X9DTD5D6cPx8DE1wwE="; }) + (fetchNuGet { pname = "System.Memory"; version = "4.5.5"; hash = "sha256-EPQ9o1Kin7KzGI5O3U3PUQAZTItSbk9h/i4rViN3WiI="; }) + (fetchNuGet { pname = "System.Numerics.Vectors"; version = "4.5.0"; hash = "sha256-qdSTIFgf2htPS+YhLGjAGiLN8igCYJnCCo6r78+Q+c8="; }) + (fetchNuGet { pname = "System.Reflection.Metadata"; version = "7.0.0"; hash = "sha256-GwAKQhkhPBYTqmRdG9c9taqrKSKDwyUgOEhWLKxWNPI="; }) + (fetchNuGet { pname = "System.Reflection.Metadata"; version = "8.0.0"; hash = "sha256-dQGC30JauIDWNWXMrSNOJncVa1umR1sijazYwUDdSIE="; }) + (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "6.0.0"; hash = "sha256-bEG1PnDp7uKYz/OgLOWs3RWwQSVYm+AnPwVmAmcgp2I="; }) + (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "4.4.0"; hash = "sha256-Ri53QmFX8I8UH0x4PikQ1ZA07ZSnBUXStd5rBfGWFOE="; }) + (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "8.0.0"; hash = "sha256-fb0pa9sQxN+mr0vnXg1Igbx49CaOqS+GDkTfWNboUvs="; }) + (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "7.0.0"; hash = "sha256-eCKTVwumD051ZEcoJcDVRGnIGAsEvKpfH3ydKluHxmo="; }) + (fetchNuGet { pname = "System.Text.Encodings.Web"; version = "8.0.0"; hash = "sha256-IUQkQkV9po1LC0QsqrilqwNzPvnc+4eVvq+hCvq8fvE="; }) + (fetchNuGet { pname = "System.Text.Json"; version = "8.0.0"; hash = "sha256-XFcCHMW1u2/WujlWNHaIWkbW1wn8W4kI0QdrwPtWmow="; }) + (fetchNuGet { pname = "System.Threading.Channels"; version = "7.0.0"; hash = "sha256-Cu0gjQsLIR8Yvh0B4cOPJSYVq10a+3F9pVz/C43CNeM="; }) + (fetchNuGet { pname = "System.Threading.Tasks.Dataflow"; version = "7.0.0"; hash = "sha256-KTeMhCWcyYEwG7EkA0VkVvHwo0B2FBs5FpjW3BFNVUE="; }) + (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.5.4"; hash = "sha256-owSpY8wHlsUXn5xrfYAiu847L6fAKethlvYx97Ri1ng="; }) +] diff --git a/pkgs/by-name/dn/dnspy/package.nix b/pkgs/by-name/dn/dnspy/package.nix new file mode 100644 index 0000000000000..fe4ff3dde0694 --- /dev/null +++ b/pkgs/by-name/dn/dnspy/package.nix @@ -0,0 +1,89 @@ +{ + lib, + callPackage, + pkgsCross, + stdenvNoCC, + buildDotnetModule, + fetchFromGitHub, + fetchpatch, + dotnetCorePackages, + + is32Bit ? stdenvNoCC.hostPlatform.parsed.cpu.bits == 32, +}: +if (!stdenvNoCC.hostPlatform.isWindows) then + callPackage ./wrapper.nix { + inherit (if is32Bit then pkgsCross.mingw32 else pkgsCross.mingwW64) dnspy; + inherit is32Bit; + } +else + let + self = buildDotnetModule { + pname = "dnspy${lib.optionalString is32Bit "32"}"; + version = "6.5.1"; + + src = fetchFromGitHub { + owner = "dnSpyEx"; + repo = "dnSpy"; + rev = "v${self.version}"; + hash = "sha256-ttGQpwFLj7px1z+SZv1eelOkXA9bbG0F5nGUSNCsC6k="; + fetchSubmodules = true; + }; + + patches = [ + # Disable WPF hardware acceleration when running dnSpy under Wine + (fetchpatch { + url = "https://github.com/dnSpyEx/dnSpy/commit/f20c00583c15d91214dee7e97e4f680a48e891a5.patch"; + hash = "sha256-hpSXjm01ohePRmNopb0sm/KQM825gRm5kLznzauB81c="; + }) + + # Add Liberation Mono as monospace font fallback for Wine compatibility + (fetchpatch { + url = "https://github.com/dnSpyEx/dnSpy/commit/5ea1e361a457c7602832be2768655410294c930b.patch"; + hash = "sha256-FgDxqFlPPIWE91O4Ie6tIYIbD3O/U33i+3XtD1kB7is="; + }) + ]; + + projectFile = [ + "dnSpy/dnSpy/dnSpy.csproj" + "dnSpy/dnSpy.Console/dnSpy.Console.csproj" + + "Extensions/ILSpy.Decompiler/dnSpy.Decompiler.ILSpy/dnSpy.Decompiler.ILSpy.csproj" + "Extensions/dnSpy.Analyzer/dnSpy.Analyzer.csproj" + "Extensions/dnSpy.AsmEditor/dnSpy.AsmEditor.csproj" + "Extensions/dnSpy.BamlDecompiler/dnSpy.BamlDecompiler.csproj" + "Extensions/dnSpy.Debugger/dnSpy.Debugger/dnSpy.Debugger.csproj" + "Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/dnSpy.Debugger.DotNet.csproj" + "Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dnSpy.Debugger.DotNet.CorDebug.csproj" + "Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/dnSpy.Debugger.DotNet.Mono.csproj" + "Extensions/dnSpy.Scripting.Roslyn/dnSpy.Scripting.Roslyn.csproj" + ]; + nugetDeps = ./deps.nix; + + dotnet-sdk = dotnetCorePackages.sdk_8_0; + dotnet-runtime = + with dotnetCorePackages; + combinePackages [ + runtime_8_0 + windowsdesktop_8_0 + ]; + + dotnetFlags = [ "-p:TargetFramework=net8.0-windows" ]; + + meta = { + description = ".NET debugger and assembly editor"; + homepage = "https://github.com/dnSpyEx/dnSpy"; + sourceProvenance = with lib.sourceTypes; [ + fromSource + binaryBytecode + binaryNativeCode + ]; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ js6pak ]; + platforms = [ + "x86_64-windows" + "i686-windows" + ]; + }; + }; + in + self diff --git a/pkgs/by-name/dn/dnspy/wrapper.nix b/pkgs/by-name/dn/dnspy/wrapper.nix new file mode 100644 index 0000000000000..36b0a720d33ba --- /dev/null +++ b/pkgs/by-name/dn/dnspy/wrapper.nix @@ -0,0 +1,86 @@ +{ + lib, + buildPackages, + stdenvNoCC, + wineWow64Packages, + writeShellScript, + makeWrapper, + copyDesktopItems, + makeDesktopItem, + nix-update, + + dnspy, + is32Bit ? false, + overrideWine ? wineWow64Packages.staging, +}: +let + wine = overrideWine; + + wrapper = writeShellScript "dnspy-wrapper" '' + export WINE="${lib.getExe wine}" + export WINEPREFIX="''${DNSPY_HOME:-"''${XDG_DATA_HOME:-"''${HOME}/.local/share"}/dnSpy"}/wine" + export WINEDEBUG=-all + + if [ ! -d "$WINEPREFIX" ]; then + mkdir -p "$WINEPREFIX" + ${lib.getExe' wine "wineboot"} -u + fi + + exec "$WINE" "''${ENTRYPOINT:-${dnspy}/bin/dnSpy.exe}" "$@" + ''; + + self = stdenvNoCC.mkDerivation { + inherit (dnspy) pname version; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + installPhase = '' + runHook preInstall + + icon_name="dnSpy${lib.optionalString is32Bit "-x86"}" + ${lib.getExe' buildPackages.icoutils "icotool"} -x "${dnspy.src}/dnSpy/dnSpy/Images/$icon_name.ico" + for f in "$icon_name"_*.png; do + res=$(basename "$f" | cut -d "_" -f3 | cut -d "x" -f1-2) + install -vD "$f" "$out/share/icons/hicolor/$res/apps/$pname.png" + done + + install -vD "${wrapper}" "$out/bin/${self.meta.mainProgram}" + + runHook postInstall + ''; + + desktopItems = makeDesktopItem { + name = self.pname; + desktopName = "dnSpy" + (lib.optionalString is32Bit " (32-bit)"); + comment = self.meta.description; + icon = dnspy.pname; + exec = self.meta.mainProgram; + categories = [ "Development" ]; + }; + + passthru = { + unwrapped = dnspy; + + updateScript = writeShellScript "update-dnspy" '' + ${lib.getExe nix-update} "dnspy.unwrapped" + "$(nix-build -A "$UPDATE_NIX_ATTR_PATH.unwrapped.fetch-deps" --no-out-link)" + ''; + }; + + meta = dnspy.meta // { + platforms = [ + "x86_64-linux" + "x86_64-darwin" + ]; + mainProgram = self.pname; + }; + }; +in +self diff --git a/pkgs/by-name/dn/dnspy32/package.nix b/pkgs/by-name/dn/dnspy32/package.nix new file mode 100644 index 0000000000000..19469eb913c9f --- /dev/null +++ b/pkgs/by-name/dn/dnspy32/package.nix @@ -0,0 +1,9 @@ +{ + stdenv, + pkgsCross, + dnspy, +}: +if (stdenv.hostPlatform.isWindows) then + pkgsCross.mingw32.dnspy +else + dnspy.override { is32Bit = true; }