2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildDotnetPackage
|
|
|
|
, dotnetPackages
|
|
|
|
, gtksharp
|
|
|
|
, gettext
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
mono-addins = dotnetPackages.MonoAddins;
|
|
|
|
in
|
|
|
|
buildDotnetPackage rec {
|
|
|
|
baseName = "Pinta";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.7.1";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputFiles = [ "bin/*" ];
|
|
|
|
buildInputs = [ gtksharp mono-addins gettext ];
|
|
|
|
xBuildFiles = [ "Pinta.sln" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PintaProject";
|
|
|
|
repo = "Pinta";
|
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-yRp/dpJ9T4DieqHTj3vhyuASPGe4vjHw0rSXFrTNZVc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Remove version information from nodes <Reference Include="... Version=... ">
|
2021-01-17 00:15:33 +00:00
|
|
|
postPatch = with lib; let
|
2020-04-24 23:36:52 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
stripVersion = name: file:
|
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
match = ''<Reference Include="${name}([ ,][^"]*)?"'';
|
|
|
|
replace = ''<Reference Include="${name}"'';
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
"sed -i -re 's/${match}/${replace}/g' ${file}\n";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Map all possible pairs of two lists
|
|
|
|
map2 = f: listA: listB: concatMap (a: map (f a) listB) listA;
|
|
|
|
concatMap2Strings = f: listA: listB: concatStrings (map2 f listA listB);
|
|
|
|
in
|
2021-12-06 16:07:01 +00:00
|
|
|
concatMap2Strings stripVersion versionedNames csprojFiles
|
|
|
|
+ ''
|
|
|
|
# For some reason there is no Microsoft.Common.tasks file
|
|
|
|
# in ''${mono}/lib/mono/3.5 .
|
|
|
|
substituteInPlace Pinta.Install.proj \
|
|
|
|
--replace 'ToolsVersion="3.5"' 'ToolsVersion="4.0"' \
|
|
|
|
--replace "/usr/local" "$out"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeWrapperArgs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"--prefix MONO_GAC_PREFIX : ${gtksharp}"
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${gtksharp}/lib"
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${gtksharp.gtk.out}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Do automake's job manually
|
|
|
|
substitute xdg/pinta.desktop.in xdg/pinta.desktop \
|
|
|
|
--replace _Name Name \
|
|
|
|
--replace _Comment Comment \
|
|
|
|
--replace _GenericName GenericName \
|
|
|
|
--replace _X-GNOME-FullName X-GNOME-FullName
|
2021-12-06 16:07:01 +00:00
|
|
|
substitute xdg/pinta.appdata.xml.in xdg/pinta.appdata.xml \
|
|
|
|
--replace _p p
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
xbuild /target:CompileTranslations Pinta.Install.proj
|
|
|
|
xbuild /target:Install Pinta.Install.proj
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
maintainers = with lib.maintainers; [ ];
|
|
|
|
platforms = with lib.platforms; linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|