2015-10-30 03:35:05 +00:00
|
|
|
{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
|
|
|
|
gettext }:
|
2010-06-15 23:25:38 +01:00
|
|
|
|
2015-10-29 02:59:32 +00:00
|
|
|
let
|
|
|
|
mono-addins = dotnetPackages.MonoAddins;
|
|
|
|
in
|
|
|
|
buildDotnetPackage rec {
|
|
|
|
name = "pinta-1.6";
|
2010-06-18 09:16:21 +01:00
|
|
|
|
2015-10-29 02:59:32 +00:00
|
|
|
baseName = "Pinta";
|
|
|
|
version = "1.6";
|
|
|
|
outputFiles = [ "bin/*" ];
|
2015-10-30 03:35:05 +00:00
|
|
|
buildInputs = [ gtksharp mono-addins gettext ];
|
2015-10-29 02:59:32 +00:00
|
|
|
xBuildFiles = [ "Pinta.sln" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PintaProject";
|
|
|
|
repo = "Pinta";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0vgswy981c7ys4q7js5k85sky7bz8v32wsfq3br4j41vg92pw97d";
|
2010-06-15 23:25:38 +01:00
|
|
|
};
|
|
|
|
|
2015-10-29 02:59:32 +00:00
|
|
|
# Remove version information from nodes <Reference Include="... Version=... ">
|
|
|
|
postPatch = with stdenv.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 = ''<Reference Include="${name}([ ,][^"]*)?"'';
|
|
|
|
replace = ''<Reference Include="${name}"'';
|
|
|
|
in "sed -i -re 's/${match}/${replace}/g' ${file}\n";
|
|
|
|
|
|
|
|
# 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
|
2015-10-30 03:35:05 +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"
|
|
|
|
'';
|
2015-10-29 02:59:32 +00:00
|
|
|
|
|
|
|
makeWrapperArgs = [
|
pinta: FIX unhandled glib-sharp load exception
running pinta after https://github.com/NixOS/nixpkgs/pull/31497
results in:
```
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies.
File name: 'glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies.
File name: 'glib-sharp, Version=2.12.0.0, Culture=neutral,
PublicKeyToken=35e10195dab3c99f'
```
2017-12-08 10:40:45 +00:00
|
|
|
''--prefix MONO_GAC_PREFIX : ${gtksharp}''
|
|
|
|
''--prefix LD_LIBRARY_PATH : ${gtksharp}/lib''
|
|
|
|
''--prefix LD_LIBRARY_PATH : ${gtksharp.gtk.out}/lib''
|
2015-10-29 02:59:32 +00:00
|
|
|
];
|
2010-06-15 23:25:38 +01:00
|
|
|
|
2015-10-30 03:35:05 +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
|
|
|
|
|
|
|
|
xbuild /target:CompileTranslations Pinta.Install.proj
|
|
|
|
xbuild /target:Install Pinta.Install.proj
|
|
|
|
'';
|
|
|
|
|
2010-06-22 22:07:09 +01:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.pinta-project.com/";
|
2010-06-22 22:07:09 +01:00
|
|
|
description = "Drawing/editing program modeled after Paint.NET";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2018-07-22 20:50:19 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ ];
|
2010-06-22 22:07:09 +01:00
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
2010-06-15 23:25:38 +01:00
|
|
|
}
|