From f67184e9a9b2b65c6ad9452a2dc0ac28bc9a3667 Mon Sep 17 00:00:00 2001 From: Demin Dmitriy Date: Thu, 29 Oct 2015 05:48:08 +0300 Subject: [PATCH 1/4] dotnet Mono.Addins: init at 1.2 --- pkgs/top-level/dotnet-packages.nix | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pkgs/top-level/dotnet-packages.nix b/pkgs/top-level/dotnet-packages.nix index bef3f9c0a01b..1f22ea09288d 100644 --- a/pkgs/top-level/dotnet-packages.nix +++ b/pkgs/top-level/dotnet-packages.nix @@ -420,6 +420,38 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { }; }; + MonoAddins = buildDotnetPackage rec { + baseName = "Mono.Addins"; + version = "1.2"; + + xBuildFiles = [ + "Mono.Addins/Mono.Addins.csproj" + "Mono.Addins.Setup/Mono.Addins.Setup.csproj" + "Mono.Addins.Gui/Mono.Addins.Gui.csproj" + "Mono.Addins.CecilReflector/Mono.Addins.CecilReflector.csproj" + ]; + outputFiles = [ "bin/*" ]; + + src = fetchFromGitHub { + owner = "mono"; + repo = "mono-addins"; + rev = "mono-addins-${version}"; + sha256 = "1hnn0a2qsjcjprsxas424bzvhsdwy0yc2jj5xbp698c0m9kfk24y"; + }; + + buildInputs = [ pkgs.gtk-sharp ]; + + meta = { + description = "A generic framework for creating extensible applications"; + homepage = http://www.mono-project.com/Mono.Addins; + longDescription = '' + A generic framework for creating extensible applications, + and for creating libraries which extend those applications. + ''; + license = stdenv.lib.licenses.mit; + }; + }; + MonoDevelopFSharpBinding = buildDotnetPackage rec { baseName = "MonoDevelop.FSharpBinding"; version = "git-a09c8185eb"; From dc70fcd94b2839f3ad2976613733eef3862d029a Mon Sep 17 00:00:00 2001 From: Demin Dmitriy Date: Thu, 29 Oct 2015 05:54:31 +0300 Subject: [PATCH 2/4] build-dotnet-package: add optional makeWrapperArgs argument 3 lines of code are shamelessly stolen from buildPythonPackage --- pkgs/build-support/build-dotnet-package/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/build-dotnet-package/default.nix b/pkgs/build-support/build-dotnet-package/default.nix index 00be987af752..3d24f6fb4340 100644 --- a/pkgs/build-support/build-dotnet-package/default.nix +++ b/pkgs/build-support/build-dotnet-package/default.nix @@ -9,6 +9,9 @@ attrsOrig @ , outputFiles ? [ "bin/Release/*" ] , dllFiles ? [ "*.dll" ] , exeFiles ? [ "*.exe" ] +# Additional arguments to pass to the makeWrapper function, which wraps +# generated binaries. +, makeWrapperArgs ? [ ] , ... }: let arrayToShell = (a: toString (map (lib.escape (lib.stringToCharacters "\\ ';$`()|<>\t") ) a)); @@ -98,7 +101,10 @@ attrsOrig @ [ -f "$exe" ] || continue mkdir -p "$out"/bin commandName="$(basename -s .exe "$(echo "$exe" | tr "[A-Z]" "[a-z]")")" - makeWrapper "${mono}/bin/mono \"$exe\"" "$out"/bin/"$commandName" + makeWrapper \ + "${mono}/bin/mono \"$exe\"" \ + "$out"/bin/"$commandName" \ + ''${makeWrapperArgs} done done From 0ec62e075949fb0e71b9ae3eb4f01e16bfe6a7b1 Mon Sep 17 00:00:00 2001 From: Demin Dmitriy Date: Thu, 29 Oct 2015 05:59:32 +0300 Subject: [PATCH 3/4] pinta: 1.4 -> 1.6 --- pkgs/applications/graphics/pinta/default.nix | 77 ++++++++++++-------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix index 6958c94f7e18..0084ddffb1d7 100644 --- a/pkgs/applications/graphics/pinta/default.nix +++ b/pkgs/applications/graphics/pinta/default.nix @@ -1,44 +1,63 @@ -{stdenv, fetchurl, mono, gtksharp, pkgconfig}: +{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp }: -stdenv.mkDerivation { - name = "pinta-1.4"; +let + mono-addins = dotnetPackages.MonoAddins; +in +buildDotnetPackage rec { + name = "pinta-1.6"; - src = fetchurl { - url = "https://github.com/PintaProject/Pinta/tarball/3f7ccfa93d"; - name = "pinta-1.4.tar.gz"; - sha256 = "1kgb4gy5l6bd0akniwhiqqkvqayr5jgdsvn2pgg1038q9raafnpn"; + baseName = "Pinta"; + version = "1.6"; + outputFiles = [ "bin/*" ]; + buildInputs = [ gtksharp mono-addins ]; + xBuildFiles = [ "Pinta.sln" ]; + + src = fetchFromGitHub { + owner = "PintaProject"; + repo = "Pinta"; + rev = version; + sha256 = "0vgswy981c7ys4q7js5k85sky7bz8v32wsfq3br4j41vg92pw97d"; }; - buildInputs = [mono gtksharp pkgconfig]; + # Remove version information from nodes + 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" + ]; - buildPhase = '' - # xbuild understands pkgconfig, but gtksharp does not give .pc for gdk-sharp - # So we have to go the GAC-way - export MONO_GAC_PREFIX=${gtksharp} - xbuild Pinta.sln - ''; + stripVersion = name: file: let + match = '' $out/bin/pinta << EOF - #!/bin/sh - export MONO_GAC_PREFIX=${gtksharp}:\$MONO_GAC_PREFIX - export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${gtksharp}/lib:${gtksharp.gtk}/lib:${mono}/lib - exec ${mono}/bin/mono $out/lib/pinta/Pinta.exe - EOF - chmod +x $out/bin/pinta - ''; + # 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; - # Always needed on Mono, otherwise nothing runs - dontStrip = true; + makeWrapperArgs = [ + ''--prefix MONO_GAC_PREFIX ':' "${gtksharp}"'' + ''--prefix LD_LIBRARY_PATH ':' "${gtksharp}/lib"'' + ''--prefix LD_LIBRARY_PATH ':' "${gtksharp.gtk}/lib"'' + ]; meta = { homepage = http://www.pinta-project.com/; description = "Drawing/editing program modeled after Paint.NET"; license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [viric]; + maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = with stdenv.lib.platforms; linux; }; } From 0d12bbe5743c62e0865c4a79e7ce2a0f1972621e Mon Sep 17 00:00:00 2001 From: Demin Dmitriy Date: Fri, 30 Oct 2015 06:35:05 +0300 Subject: [PATCH 4/4] pinta: Add installation of manpages and .desktop, locale and icon files --- pkgs/applications/graphics/pinta/default.nix | 26 +++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix index 0084ddffb1d7..2fd98b5033e9 100644 --- a/pkgs/applications/graphics/pinta/default.nix +++ b/pkgs/applications/graphics/pinta/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp }: +{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp, + gettext }: let mono-addins = dotnetPackages.MonoAddins; @@ -9,7 +10,7 @@ buildDotnetPackage rec { baseName = "Pinta"; version = "1.6"; outputFiles = [ "bin/*" ]; - buildInputs = [ gtksharp mono-addins ]; + buildInputs = [ gtksharp mono-addins gettext ]; xBuildFiles = [ "Pinta.sln" ]; src = fetchFromGitHub { @@ -45,7 +46,14 @@ buildDotnetPackage rec { 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; + 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}"'' @@ -53,6 +61,18 @@ buildDotnetPackage rec { ''--prefix LD_LIBRARY_PATH ':' "${gtksharp.gtk}/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 = http://www.pinta-project.com/; description = "Drawing/editing program modeled after Paint.NET";