2021-11-07 20:29:51 +00:00
|
|
|
{ lib
|
2022-01-03 18:11:19 +00:00
|
|
|
, buildDotnetModule
|
|
|
|
, dotnetCorePackages
|
2021-11-07 20:29:51 +00:00
|
|
|
, fetchFromGitHub
|
2022-01-16 15:37:33 +00:00
|
|
|
, glibcLocales
|
2022-01-03 18:11:19 +00:00
|
|
|
, gtk3
|
2022-01-16 15:37:33 +00:00
|
|
|
, intltool
|
2022-01-03 18:11:19 +00:00
|
|
|
, wrapGAppsHook
|
2021-11-07 20:29:51 +00:00
|
|
|
}:
|
2010-06-15 23:25:38 +01:00
|
|
|
|
2022-01-03 18:11:19 +00:00
|
|
|
buildDotnetModule rec {
|
2021-11-08 16:12:26 +00:00
|
|
|
pname = "Pinta";
|
2022-01-16 14:36:01 +00:00
|
|
|
version = "2.0.2";
|
2021-11-07 20:29:51 +00:00
|
|
|
|
2022-01-03 18:11:19 +00:00
|
|
|
nativeBuildInputs = [
|
2022-01-16 15:37:33 +00:00
|
|
|
intltool
|
2022-01-03 18:11:19 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDeps = [ gtk3 ];
|
2022-01-11 23:04:18 +00:00
|
|
|
buildInputs = runtimeDeps;
|
2022-01-03 18:11:19 +00:00
|
|
|
|
|
|
|
# How-to update deps:
|
|
|
|
# $ nix-build -A pinta.fetch-deps
|
|
|
|
# $ ./result
|
2022-01-16 15:37:33 +00:00
|
|
|
# $ cp /tmp/Pinta-deps.nix ./pkgs/applications/graphics/pinta/deps.nix
|
2022-01-03 18:11:19 +00:00
|
|
|
# TODO: create update script
|
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
|
|
|
|
projectFile = "Pinta";
|
2015-10-29 02:59:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PintaProject";
|
|
|
|
repo = "Pinta";
|
|
|
|
rev = version;
|
2022-01-16 14:36:01 +00:00
|
|
|
sha256 = "sha256-Bvzs1beq7I1+10w9pmMePqGCz2TPDp5UK5Wa9hbKERU=";
|
2010-06-15 23:25:38 +01:00
|
|
|
};
|
|
|
|
|
2022-01-16 15:37:33 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/38991
|
|
|
|
# bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
|
|
|
|
LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive";
|
2015-10-29 02:59:32 +00:00
|
|
|
|
2022-01-16 15:37:33 +00:00
|
|
|
# Do the autoreconf/Makefile job manually
|
|
|
|
# TODO: use upstream build system
|
|
|
|
postBuild = ''
|
|
|
|
# Substitute translation placeholders
|
|
|
|
intltool-merge -x po/ xdg/pinta.appdata.xml.in xdg/pinta.appdata.xml
|
|
|
|
intltool-merge -d po/ xdg/pinta.desktop.in xdg/pinta.desktop
|
2015-10-29 02:59:32 +00:00
|
|
|
|
2022-01-16 15:37:33 +00:00
|
|
|
# Build translations
|
|
|
|
dotnet build Pinta \
|
|
|
|
-p:ContinuousIntegrationBuild=true \
|
|
|
|
-p:Deterministic=true \
|
|
|
|
-target:CompileTranslations,PublishTranslations \
|
|
|
|
-p:BuildTranslations=true \
|
|
|
|
-p:PublishDir="$NIX_BUILD_TOP/source/publish"
|
|
|
|
'';
|
2015-10-29 02:59:32 +00:00
|
|
|
|
2022-01-16 15:37:33 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Rename the binary
|
|
|
|
mv "$out/bin/Pinta" "$out/bin/pinta"
|
2010-06-15 23:25:38 +01:00
|
|
|
|
2022-02-22 14:13:02 +00:00
|
|
|
# Copy runtime icons
|
|
|
|
mkdir -p $out/share/icons/hicolor/16x16/
|
|
|
|
cp -r Pinta.Resources/icons/hicolor/16x16/* $out/share/icons/hicolor/16x16/
|
|
|
|
|
2022-01-16 15:37:33 +00:00
|
|
|
# Install
|
|
|
|
dotnet build installer/linux/install.proj \
|
|
|
|
-target:Install \
|
|
|
|
-p:ContinuousIntegrationBuild=true \
|
|
|
|
-p:Deterministic=true \
|
|
|
|
-p:SourceDir="$NIX_BUILD_TOP/source" \
|
|
|
|
-p:PublishDir="$NIX_BUILD_TOP/source/publish" \
|
|
|
|
-p:InstallPrefix="$out"
|
2015-10-30 03:35:05 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-11 23:04:18 +00:00
|
|
|
meta = with lib; {
|
2020-10-02 08:58:50 +01:00
|
|
|
homepage = "https://www.pinta-project.com/";
|
2010-06-22 22:07:09 +01:00
|
|
|
description = "Drawing/editing program modeled after Paint.NET";
|
2022-01-11 23:04:18 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ thiagokokada ];
|
|
|
|
platforms = with platforms; linux;
|
2022-01-04 18:18:56 +00:00
|
|
|
mainProgram = "pinta";
|
2010-06-22 22:07:09 +01:00
|
|
|
};
|
2010-06-15 23:25:38 +01:00
|
|
|
}
|