aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta/default.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta/default.nix
new file mode 100644
index 000000000000..b534763b2456
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/graphics/pinta/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
+ gettext }:
+
+let
+ mono-addins = dotnetPackages.MonoAddins;
+in
+buildDotnetPackage rec {
+ name = "pinta-1.6";
+
+ baseName = "Pinta";
+ version = "1.6";
+ outputFiles = [ "bin/*" ];
+ buildInputs = [ gtksharp mono-addins gettext ];
+ xBuildFiles = [ "Pinta.sln" ];
+
+ src = fetchFromGitHub {
+ owner = "PintaProject";
+ repo = "Pinta";
+ rev = version;
+ sha256 = "0vgswy981c7ys4q7js5k85sky7bz8v32wsfq3br4j41vg92pw97d";
+ };
+
+ # 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
+ 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"
+ '';
+
+ makeWrapperArgs = [
+ ''--prefix MONO_GAC_PREFIX : ${gtksharp}''
+ ''--prefix LD_LIBRARY_PATH : ${gtksharp}/lib''
+ ''--prefix LD_LIBRARY_PATH : ${gtksharp.gtk.out}/lib''
+ ];
+
+ 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
+ '';
+
+ meta = {
+ homepage = "https://www.pinta-project.com/";
+ description = "Drawing/editing program modeled after Paint.NET";
+ license = stdenv.lib.licenses.mit;
+ maintainers = with stdenv.lib.maintainers; [ ];
+ platforms = with stdenv.lib.platforms; linux;
+ };
+}