2014-04-15 12:12:44 +00:00
|
|
|
{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
|
2015-03-18 11:52:32 +00:00
|
|
|
, gtk3, gsettings_desktop_schemas, p7zip }:
|
2014-04-15 12:12:44 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
mkSweetHome3D =
|
2014-10-07 06:45:26 +00:00
|
|
|
{ name, module, version, src, license, description, icon }:
|
2014-04-15 12:12:44 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-10-07 06:45:26 +00:00
|
|
|
inherit name version src description icon;
|
2014-04-15 12:12:44 +00:00
|
|
|
exec = stdenv.lib.toLower module;
|
|
|
|
sweethome3dItem = makeDesktopItem {
|
2014-10-07 06:45:26 +00:00
|
|
|
inherit name exec icon;
|
2014-04-15 12:12:44 +00:00
|
|
|
comment = description;
|
|
|
|
desktopName = name;
|
|
|
|
genericName = "Computer Aided (Interior) Design";
|
|
|
|
categories = "Application;CAD;";
|
|
|
|
};
|
|
|
|
|
2015-03-18 11:52:32 +00:00
|
|
|
buildInputs = [ ant jdk jre makeWrapper p7zip gtk3 gsettings_desktop_schemas ];
|
2014-04-15 12:12:44 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
ant furniture textures help
|
|
|
|
mkdir -p $out/share/{java,applications}
|
2015-03-18 11:52:32 +00:00
|
|
|
mv "build/"*.jar $out/share/java/.
|
2014-04-15 12:12:44 +00:00
|
|
|
ant
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp install/${module}-${version}.jar $out/share/java/.
|
2015-03-18 11:52:32 +00:00
|
|
|
cp "${sweethome3dItem}/share/applications/"* $out/share/applications
|
2014-04-15 12:12:44 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/$exec \
|
2015-03-18 11:52:32 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3}/share:${gsettings_desktop_schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2014-04-15 12:12:44 +00:00
|
|
|
--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"}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.sweethome3d.com/index.jsp";
|
|
|
|
inherit description;
|
|
|
|
inherit license;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.edwtjo ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
d2u = stdenv.lib.replaceChars ["."] ["_"];
|
|
|
|
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
application = mkSweetHome3D rec {
|
2015-03-18 11:52:32 +00:00
|
|
|
version = "4.6.2";
|
2014-04-15 12:12:44 +00:00
|
|
|
module = "SweetHome3D";
|
|
|
|
name = stdenv.lib.toLower module + "-application-" + version;
|
2014-06-15 11:49:18 +00:00
|
|
|
description = "Design and visualize your future home";
|
2014-04-15 12:12:44 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
src = fetchcvs {
|
|
|
|
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
|
2015-03-18 11:52:32 +00:00
|
|
|
sha256 = "0pm0rl5y90cjwyjma7g6nnaz6dv4bqcy8vl3zzxfj0q02ww01gbz";
|
2014-04-15 12:12:44 +00:00
|
|
|
module = module;
|
|
|
|
tag = "V_" + d2u version;
|
|
|
|
};
|
2014-10-07 06:45:26 +00:00
|
|
|
icon = fetchurl {
|
|
|
|
url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/src/com/eteks/sweethome3d/viewcontroller/resources/help/images/sweethome3d.png";
|
|
|
|
sha256 = "0lnv2sz2d3m8jx25hz92gzardf0iblykhy5q0q2cyb7mw2qb2p92";
|
|
|
|
};
|
2014-04-15 12:12:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|