From f3369c69773ffc34adcc79e6e3bfb654cc7598c7 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 3 Jan 2022 15:11:19 -0300 Subject: [PATCH] pinta: 1.7.1 -> 2.0 Pinta now uses dotnet 6.0 + GTK3 instead of old mono + gtk-sharp (GTK2) library. So build it with the new buildDotnetModule introduced sometime ago. This does causes some small issues. For example, there is no translations since this is build using autoreconf + intltool + pkg-config. There is no way to build just translations using this build system AFAIK. Shouldn't be too much of an issue considering that we also didn't had translations before (or it was incomplete). --- pkgs/applications/graphics/pinta/default.nix | 121 +++++++++---------- pkgs/applications/graphics/pinta/deps.nix | 12 ++ pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 71 insertions(+), 66 deletions(-) create mode 100644 pkgs/applications/graphics/pinta/deps.nix diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix index 6859a07b48a6..9aa2b7e108a9 100644 --- a/pkgs/applications/graphics/pinta/default.nix +++ b/pkgs/applications/graphics/pinta/default.nix @@ -1,91 +1,86 @@ { lib +, buildDotnetModule +, dotnetCorePackages , fetchFromGitHub -, buildDotnetPackage -, dotnetPackages -, gtksharp -, gettext +, gtk3 +, installShellFiles +, librsvg +, makeDesktopItem +, wrapGAppsHook }: -let - mono-addins = dotnetPackages.MonoAddins; -in -buildDotnetPackage rec { +buildDotnetModule rec { pname = "Pinta"; - version = "1.7.1"; + version = "2.0"; - outputFiles = [ "bin/*" ]; - buildInputs = [ gtksharp mono-addins gettext ]; - xBuildFiles = [ "Pinta.sln" ]; + nativeBuildInputs = [ + installShellFiles + wrapGAppsHook + ]; + + runtimeDeps = [ gtk3 ]; + + dotnet-sdk = dotnetCorePackages.sdk_6_0; + dotnet-runtime = dotnetCorePackages.runtime_6_0; + + # How-to update deps: + # $ nix-build -A pinta.fetch-deps + # $ ./result + # $ cp /tmp/Pinta-deps.nix ./pkgs/applications/graphics/pinta/default.nix + # TODO: create update script + nugetDeps = ./deps.nix; + + projectFile = "Pinta"; src = fetchFromGitHub { owner = "PintaProject"; repo = "Pinta"; rev = version; - sha256 = "sha256-yRp/dpJ9T4DieqHTj3vhyuASPGe4vjHw0rSXFrTNZVc="; + sha256 = "sha256-wqqNPyy5h/hTDm2u5MDZx1ds5qWAxy1/BY/fX4PeA88="; }; - # Remove version information from nodes - postPatch = with lib; let - csprojFiles = [ - "Pinta/Pinta.csproj" - "Pinta.Core/Pinta.Core.csproj" - "Pinta.Effects/Pinta.Effects.csproj" - "Pinta.Gui.Widgets/Pinta.Gui.Widgets.csproj" - "Pinta.Resources/Pinta.Resources.csproj" - "Pinta.Tools/Pinta.Tools.csproj" - ]; - versionedNames = [ - "Mono\\.Addins" - "Mono\\.Posix" - "Mono\\.Addins\\.Gui" - "Mono\\.Addins\\.Setup" - ]; - - stripVersion = name: file: - let - match = ''