diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-03-08 09:57:58 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-03-08 09:58:19 +0100 |
commit | 09af15654f0c8091f1b9e0bbb2e523cdee194442 (patch) | |
tree | e648edef1ce4c64c533f2593aa22b8015cf0e506 /pkgs/applications/misc/sweethome3d | |
parent | f306e67e15bdbe9a8358c9f81319fc4fcbadc2eb (diff) | |
parent | 0ee75214f336474e127c2e3546c0406a0c4d5fa7 (diff) |
Merge master into closure-size
The kde-5 stuff still didn't merge well. I hand-fixed what I saw, but there may be more problems.
Diffstat (limited to 'pkgs/applications/misc/sweethome3d')
-rw-r--r-- | pkgs/applications/misc/sweethome3d/default.nix | 46 | ||||
-rw-r--r-- | pkgs/applications/misc/sweethome3d/editors.nix | 20 |
2 files changed, 47 insertions, 19 deletions
diff --git a/pkgs/applications/misc/sweethome3d/default.nix b/pkgs/applications/misc/sweethome3d/default.nix index f55d8ed34eeb7..68dd69f385d9f 100644 --- a/pkgs/applications/misc/sweethome3d/default.nix +++ b/pkgs/applications/misc/sweethome3d/default.nix @@ -1,20 +1,33 @@ -{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant +{ lib, stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant , gtk3, gsettings_desktop_schemas, p7zip }: let + getDesktopFileName = drvName: (builtins.parseDrvName drvName).name; + + # TODO: Should we move this to `lib`? Seems like its would be useful in many cases. + extensionOf = filePath: + lib.concatStringsSep "." (lib.tail (lib.splitString "." + (builtins.baseNameOf filePath))); + + installIcons = iconName: icons: lib.concatStringsSep "\n" (lib.mapAttrsToList (size: iconFile: '' + mkdir -p "$out/share/icons/hicolor/${size}/apps" + ln -s -T "${iconFile}" "$out/share/icons/hicolor/${size}/apps/${iconName}.${extensionOf iconFile}" + '') icons); + mkSweetHome3D = - { name, module, version, src, license, description, icon }: + { name, module, version, src, license, description, desktopName, icons }: stdenv.mkDerivation rec { - inherit name version src description icon; + inherit name version src description; exec = stdenv.lib.toLower module; sweethome3dItem = makeDesktopItem { - inherit name exec icon; + inherit exec desktopName; + name = getDesktopFileName name; + icon = getDesktopFileName name; comment = description; - desktopName = name; genericName = "Computer Aided (Interior) Design"; - categories = "Application;CAD;"; + categories = "Application;Graphics;2DGraphics;3DGraphics;"; }; buildInputs = [ ant jdk jre makeWrapper p7zip gtk3 gsettings_desktop_schemas ]; @@ -29,7 +42,11 @@ let installPhase = '' mkdir -p $out/bin cp install/${module}-${version}.jar $out/share/java/. + + ${installIcons (getDesktopFileName name) icons} + cp "${sweethome3dItem}/share/applications/"* $out/share/applications + makeWrapper ${jre}/bin/java $out/bin/$exec \ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings_desktop_schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \ --add-flags "-jar $out/share/java/${module}-${version}.jar -cp $out/share/java/Furniture.jar:$out/share/java/Textures.jar:$out/share/java/Help.jar ${if stdenv.system == "x86_64-linux" then "-d64" else "-d32"}" @@ -51,20 +68,27 @@ let in rec { application = mkSweetHome3D rec { - version = "4.6.2"; + version = "5.2"; module = "SweetHome3D"; name = stdenv.lib.toLower module + "-application-" + version; description = "Design and visualize your future home"; license = stdenv.lib.licenses.gpl2Plus; src = fetchcvs { cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d"; - sha256 = "0pm0rl5y90cjwyjma7g6nnaz6dv4bqcy8vl3zzxfj0q02ww01gbz"; + sha256 = "0vws3lj5lgix5fz2hpqvz6p79py5gbfpkhmqpfb1knx1a12310bb"; module = module; tag = "V_" + d2u version; }; - icon = fetchurl { - url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/src/com/eteks/sweethome3d/viewcontroller/resources/help/images/sweethome3d.png"; - sha256 = "0lnv2sz2d3m8jx25hz92gzardf0iblykhy5q0q2cyb7mw2qb2p92"; + desktopName = "Sweet Home 3D"; + icons = { + "32x32" = fetchurl { + url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon32x32.png"; + sha256 = "1r2fhfg27mx00nfv0qj66rhf719s2g1vhdis7bdc9mqk9x0mb0ir"; + }; + "48x48" = fetchurl { + url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon48x48.png"; + sha256 = "1ap6d75dyqqvx21wddvn8vw2apq3v803vmbxdriwd0dw9rq3zn4g"; + }; }; }; diff --git a/pkgs/applications/misc/sweethome3d/editors.nix b/pkgs/applications/misc/sweethome3d/editors.nix index 204e5eeae5953..61b47dcdd2ad3 100644 --- a/pkgs/applications/misc/sweethome3d/editors.nix +++ b/pkgs/applications/misc/sweethome3d/editors.nix @@ -9,19 +9,21 @@ let + "-editor"; sweetName = m: v: sweetExec m + "-" + v; + getDesktopFileName = drvName: (builtins.parseDrvName drvName).name; + mkEditorProject = - { name, module, version, src, license, description }: + { name, module, version, src, license, description, desktopName }: stdenv.mkDerivation rec { application = sweethome3dApp; inherit name module version src description; exec = sweetExec module; editorItem = makeDesktopItem { - inherit name exec; + inherit exec desktopName; + name = getDesktopFileName name; comment = description; - desktopName = name; genericName = "Computer Aided (Interior) Design"; - categories = "Application;CAD;"; + categories = "Application;Graphics;2DGraphics;3DGraphics;"; }; buildInputs = [ ant jre jdk makeWrapper gtk3 gsettings_desktop_schemas ]; @@ -61,31 +63,33 @@ let in { textures-editor = mkEditorProject rec { - version = "1.4"; + version = "1.5"; module = "TexturesLibraryEditor"; name = sweetName module version; description = "Easily create SH3T files and edit the properties of the texture images it contain"; license = stdenv.lib.licenses.gpl2Plus; src = fetchcvs { cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d"; - sha256 = "1j1ygb32dca48hng5bsna9f84vyin5qc3ds44xi39057izmw8499"; + sha256 = "15wxdns3hc8yq362x0rj53bcxran2iynxznfcb9js85psd94zq7h"; module = module; tag = "V_" + d2u version; }; + desktopName = "Sweet Home 3D - Textures Library Editor"; }; furniture-editor = mkEditorProject rec { - version = "1.16"; + version = "1.19"; module = "FurnitureLibraryEditor"; name = sweetName module version; description = "Quickly create SH3F files and edit the properties of the 3D models it contain"; license = stdenv.lib.licenses.gpl2; src = fetchcvs { cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d"; - sha256 = "09dmb0835kncs1ngszhyp1pgvj7vqjjrp9q405gakm8ylrzym374"; + sha256 = "0rr4nqil1mngak3ds5vz7f1whrgcgzpk6fb0qcr5ljms0jx0ylvs"; module = module; tag = "V_" + d2u version; }; + desktopName = "Sweet Home 3D - Furniture Library Editor"; }; } |