diff --git a/doc/languages-frameworks/dotnet.section.md b/doc/languages-frameworks/dotnet.section.md
index 88e1a0b29596..f7af28a16775 100644
--- a/doc/languages-frameworks/dotnet.section.md
+++ b/doc/languages-frameworks/dotnet.section.md
@@ -84,7 +84,7 @@ To package Dotnet applications, you can use `buildDotnetModule`. This has simila
```
-* `executables` is used to specify which executables get wrapped to `$out/bin`, relative to `$out/lib/$pname`. If this is unset, all executables generated will get installed. If you do not want to install any, set this to `[]`.
+* `executables` is used to specify which executables get wrapped to `$out/bin`, relative to `$out/lib/$pname`. If this is unset, all executables generated will get installed. If you do not want to install any, set this to `[]`. This gets done in the `preFixup` phase.
* `runtimeDeps` is used to wrap libraries into `LD_LIBRARY_PATH`. This is how dotnet usually handles runtime dependencies.
* `buildType` is used to change the type of build. Possible values are `Release`, `Debug`, etc. By default, this is set to `Release`.
* `dotnet-sdk` is useful in cases where you need to change what dotnet SDK is being used.
diff --git a/pkgs/applications/blockchains/btcpayserver/default.nix b/pkgs/applications/blockchains/btcpayserver/default.nix
index 691979c4de5d..6cc83ffbf607 100644
--- a/pkgs/applications/blockchains/btcpayserver/default.nix
+++ b/pkgs/applications/blockchains/btcpayserver/default.nix
@@ -26,7 +26,7 @@ buildDotnetModule rec {
makeWrapperArgs+=(--run "cd $out/lib/btcpayserver")
'';
- postInstall = ''
+ postFixup = ''
mv $out/bin/{BTCPayServer,btcpayserver}
'';
diff --git a/pkgs/applications/blockchains/nbxplorer/default.nix b/pkgs/applications/blockchains/nbxplorer/default.nix
index c4add5b67f55..be3d610d8f78 100644
--- a/pkgs/applications/blockchains/nbxplorer/default.nix
+++ b/pkgs/applications/blockchains/nbxplorer/default.nix
@@ -17,7 +17,7 @@ buildDotnetModule rec {
dotnet-sdk = dotnetCorePackages.sdk_3_1;
dotnet-runtime = dotnetCorePackages.aspnetcore_3_1;
- postInstall = ''
+ postFixup = ''
mv $out/bin/{NBXplorer,nbxplorer}
'';
diff --git a/pkgs/applications/blockchains/wasabibackend/default.nix b/pkgs/applications/blockchains/wasabibackend/default.nix
index 1239ceaafd84..c7f594e31b49 100644
--- a/pkgs/applications/blockchains/wasabibackend/default.nix
+++ b/pkgs/applications/blockchains/wasabibackend/default.nix
@@ -36,7 +36,7 @@ buildDotnetModule rec {
)
'';
- postInstall = ''
+ postFixup = ''
mv $out/bin/WalletWasabi.Backend $out/bin/WasabiBackend
'';
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index ff112d7ce67c..cc50b3557c6a 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -19,6 +19,7 @@ buildDotnetModule rec {
];
runtimeDeps = [ gtk3 ];
+ buildInputs = runtimeDeps;
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.runtime_6_0;
@@ -39,16 +40,7 @@ buildDotnetModule rec {
sha256 = "sha256-iOKJPB2bI/GjeDxzG7r6ew7SGIzgrJTcRXhEYzOpC9k=";
};
- # FIXME: this should be propagated by wrapGAppsHook already, however for some
- # reason it is not working. Maybe a bug in buildDotnetModule?
- preInstall = ''
- gappsWrapperArgs+=(
- --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
- --set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
- )
- '';
-
- postInstall = ''
+ postFixup = ''
# Rename the binary
mv $out/bin/Pinta $out/bin/pinta
@@ -76,12 +68,12 @@ buildDotnetModule rec {
--replace _Keywords Keywords
'';
- meta = {
+ meta = with lib; {
homepage = "https://www.pinta-project.com/";
description = "Drawing/editing program modeled after Paint.NET";
- license = lib.licenses.mit;
- maintainers = with lib.maintainers; [ thiagokokada ];
- platforms = with lib.platforms; linux;
+ license = licenses.mit;
+ maintainers = with maintainers; [ thiagokokada ];
+ platforms = with platforms; linux;
mainProgram = "pinta";
};
}
diff --git a/pkgs/build-support/build-dotnet-module/default.nix b/pkgs/build-support/build-dotnet-module/default.nix
index 0a5b17a4a363..49a61f4e5d6d 100644
--- a/pkgs/build-support/build-dotnet-module/default.nix
+++ b/pkgs/build-support/build-dotnet-module/default.nix
@@ -224,7 +224,7 @@ let
"''${dotnetInstallFlags[@]}" \
"''${dotnetFlags[@]}"
done
- '' + (lib.optionalString packNupkg ''
+ '' + lib.optionalString packNupkg ''
for project in ''${projectFile[@]}; do
dotnet pack "$project" \
-p:ContinuousIntegrationBuild=true \
@@ -235,16 +235,24 @@ let
"''${dotnetPackFlags[@]}" \
"''${dotnetFlags[@]}"
done
- '') + (if executables != null then ''
- for executable in $executables; do
+ '' + ''
+ runHook postInstall
+ '';
+
+ preFixup = ''
+ _wrapDotnetProgram() {
+ makeWrapper "$1" "$out/bin/$(basename "$executable")" \
+ --set DOTNET_ROOT "${dotnet-runtime}" \
+ --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" \
+ "''${gappsWrapperArgs[@]}" \
+ "''${makeWrapperArgs[@]}"
+ }
+ '' + (if executables != null then ''
+ for executable in ''${executables[@]}; do
execPath="$out/lib/${args.pname}/$executable"
if [[ -f "$execPath" && -x "$execPath" ]]; then
- makeWrapper "$execPath" "$out/bin/$(basename "$executable")" \
- --set DOTNET_ROOT "${dotnet-runtime}" \
- --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" \
- "''${gappsWrapperArgs[@]}" \
- "''${makeWrapperArgs[@]}"
+ _wrapDotnetProgram $execPath
else
echo "Specified binary \"$executable\" is either not an executable, or does not exist!"
exit 1
@@ -253,16 +261,10 @@ let
'' else ''
for executable in $out/lib/${args.pname}/*; do
if [[ -f "$executable" && -x "$executable" && "$executable" != *"dll"* ]]; then
- makeWrapper "$executable" "$out/bin/$(basename "$executable")" \
- --set DOTNET_ROOT "${dotnet-runtime}" \
- --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" \
- "''${gappsWrapperArgs[@]}" \
- "''${makeWrapperArgs[@]}"
+ _wrapDotnetProgram $executable
fi
done
- '') + ''
- runHook postInstall
- '';
+ '');
});
in
package
diff --git a/pkgs/misc/emulators/ryujinx/default.nix b/pkgs/misc/emulators/ryujinx/default.nix
index 86716ed5d535..49a1c190b54a 100644
--- a/pkgs/misc/emulators/ryujinx/default.nix
+++ b/pkgs/misc/emulators/ryujinx/default.nix
@@ -1,7 +1,7 @@
{ lib, buildDotnetModule, fetchFromGitHub, makeDesktopItem, copyDesktopItems
, libX11, libgdiplus, ffmpeg
, SDL2_mixer, openal, libsoundio, sndio, pulseaudio
-, gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook
+, gtk3, gdk-pixbuf, wrapGAppsHook
}:
buildDotnetModule rec {
@@ -27,7 +27,10 @@ buildDotnetModule rec {
nativeBuildInputs = [
copyDesktopItems
wrapGAppsHook
- gobject-introspection
+ ];
+
+ buildInputs = [
+ gtk3
gdk-pixbuf
];
@@ -78,6 +81,7 @@ buildDotnetModule rec {
changelog = "https://github.com/Ryujinx/Ryujinx/wiki/Changelog";
maintainers = [ maintainers.ivar ];
platforms = [ "x86_64-linux" ];
+ mainProgram = "Ryujinx";
};
passthru.updateScript = ./updater.sh;
}
diff --git a/pkgs/tools/X11/opentabletdriver/default.nix b/pkgs/tools/X11/opentabletdriver/default.nix
index 3d7183c786bd..a1099a4f2652 100644
--- a/pkgs/tools/X11/opentabletdriver/default.nix
+++ b/pkgs/tools/X11/opentabletdriver/default.nix
@@ -68,7 +68,7 @@ buildDotnetModule rec {
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarball"
];
- postInstall = ''
+ postFixup = ''
# Give a more "*nix" name to the binaries
mv $out/bin/OpenTabletDriver.Console $out/bin/otd
mv $out/bin/OpenTabletDriver.Daemon $out/bin/otd-daemon
diff --git a/pkgs/tools/games/opentracker/default.nix b/pkgs/tools/games/opentracker/default.nix
index a66d6f4aef53..e68f9a958b4c 100644
--- a/pkgs/tools/games/opentracker/default.nix
+++ b/pkgs/tools/games/opentracker/default.nix
@@ -41,6 +41,7 @@ buildDotnetModule rec {
buildInputs = [
stdenv.cc.cc.lib
fontconfig
+ gtk3
];
runtimeDeps = [
@@ -58,5 +59,6 @@ buildDotnetModule rec {
homepage = "https://github.com/trippsc2/OpenTracker";
license = licenses.mit;
maintainers = [ maintainers.ivar ];
+ mainProgram = "OpenTracker";
};
}