2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2022-01-07 04:07:37 +00:00
|
|
|
, buildDotnetModule
|
|
|
|
, dotnetCorePackages
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2022-01-07 04:07:37 +00:00
|
|
|
, gtk3
|
|
|
|
, installShellFiles
|
|
|
|
, librsvg
|
|
|
|
, makeDesktopItem
|
|
|
|
, wrapGAppsHook
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
buildDotnetModule rec {
|
2021-12-24 04:21:11 +00:00
|
|
|
pname = "Pinta";
|
2022-01-07 04:07:37 +00:00
|
|
|
version = "2.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PintaProject";
|
|
|
|
repo = "Pinta";
|
|
|
|
rev = version;
|
2022-01-07 04:07:37 +00:00
|
|
|
sha256 = "sha256-wqqNPyy5h/hTDm2u5MDZx1ds5qWAxy1/BY/fX4PeA88=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
# 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 = ''
|
|
|
|
# Rename the binary
|
|
|
|
mv $out/bin/Pinta $out/bin/pinta
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
# Copy desktop icons
|
|
|
|
for size in 16x16 22x22 24x24 32x32 96x96 scalable; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/$size/apps
|
|
|
|
cp xdg/$size/* $out/share/icons/hicolor/$size/apps/
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
# Copy runtime icons
|
|
|
|
cp -r Pinta.Resources/icons/hicolor/16x16/* $out/share/icons/hicolor/16x16/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
# Install manpage
|
|
|
|
installManPage xdg/pinta.1
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
# Fix and copy desktop file
|
|
|
|
# TODO: fix this propely by using the autoreconf+pkg-config build system
|
|
|
|
# from upstream
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
substitute xdg/pinta.desktop.in $out/share/applications/Pinta.desktop \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace _Name Name \
|
|
|
|
--replace _Comment Comment \
|
|
|
|
--replace _GenericName GenericName \
|
2022-01-07 04:07:37 +00:00
|
|
|
--replace _X-GNOME-FullName X-GNOME-FullName \
|
|
|
|
--replace _Keywords Keywords
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://www.pinta-project.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Drawing/editing program modeled after Paint.NET";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.mit;
|
2022-01-07 04:07:37 +00:00
|
|
|
maintainers = with lib.maintainers; [ thiagokokada ];
|
2021-01-17 00:15:33 +00:00
|
|
|
platforms = with lib.platforms; linux;
|
2022-01-07 04:07:37 +00:00
|
|
|
mainProgram = "pinta";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|