2014-04-15 13:12:44 +01:00
|
|
|
{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
|
2015-03-18 11:52:32 +00:00
|
|
|
, gtk3, gsettings_desktop_schemas, p7zip, sweethome3dApp }:
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
sweetExec = with stdenv.lib;
|
|
|
|
m: "sweethome3d-"
|
|
|
|
+ removeSuffix "libraryeditor" (toLower m)
|
|
|
|
+ "-editor";
|
|
|
|
sweetName = m: v: sweetExec m + "-" + v;
|
|
|
|
|
2016-03-03 05:22:46 +00:00
|
|
|
getDesktopFileName = drvName: (builtins.parseDrvName drvName).name;
|
|
|
|
|
2014-04-15 13:12:44 +01:00
|
|
|
mkEditorProject =
|
2016-03-03 05:22:46 +00:00
|
|
|
{ name, module, version, src, license, description, desktopName }:
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
application = sweethome3dApp;
|
|
|
|
inherit name module version src description;
|
|
|
|
exec = sweetExec module;
|
|
|
|
editorItem = makeDesktopItem {
|
2016-03-03 05:22:46 +00:00
|
|
|
inherit exec desktopName;
|
|
|
|
name = getDesktopFileName name;
|
2014-04-15 13:12:44 +01:00
|
|
|
comment = description;
|
|
|
|
genericName = "Computer Aided (Interior) Design";
|
2016-03-03 05:22:46 +00:00
|
|
|
categories = "Application;Graphics;2DGraphics;3DGraphics;";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
2015-03-18 11:52:32 +00:00
|
|
|
buildInputs = [ ant jre jdk makeWrapper gtk3 gsettings_desktop_schemas ];
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e 's,../SweetHome3D,${application.src},g' build.xml
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
ant -lib ${application.src}/libtest -lib ${application.src}/lib -lib ${jdk}/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/{java,applications}
|
|
|
|
cp ${module}-${version}.jar $out/share/java/.
|
2015-03-18 11:52:32 +00:00
|
|
|
cp "${editorItem}/share/applications/"* $out/share/applications
|
2014-04-15 13:12:44 +01:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/$exec \
|
2015-10-05 21:56:47 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings_desktop_schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2014-04-15 13:12:44 +01:00
|
|
|
--add-flags "-jar $out/share/java/${module}-${version}.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 ["."] ["_"];
|
|
|
|
|
2015-03-18 11:52:32 +00:00
|
|
|
in {
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
textures-editor = mkEditorProject rec {
|
2016-03-02 20:32:39 +00:00
|
|
|
version = "1.5";
|
2014-04-15 13:12:44 +01:00
|
|
|
module = "TexturesLibraryEditor";
|
|
|
|
name = sweetName module version;
|
2014-06-15 12:49:18 +01:00
|
|
|
description = "Easily create SH3T files and edit the properties of the texture images it contain";
|
2014-04-15 13:12:44 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
src = fetchcvs {
|
|
|
|
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
|
2016-03-02 20:32:39 +00:00
|
|
|
sha256 = "15wxdns3hc8yq362x0rj53bcxran2iynxznfcb9js85psd94zq7h";
|
2014-04-15 13:12:44 +01:00
|
|
|
module = module;
|
|
|
|
tag = "V_" + d2u version;
|
|
|
|
};
|
2016-03-03 05:22:46 +00:00
|
|
|
desktopName = "Sweet Home 3D - Textures Library Editor";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
furniture-editor = mkEditorProject rec {
|
2016-03-02 20:32:39 +00:00
|
|
|
version = "1.19";
|
2014-04-15 13:12:44 +01:00
|
|
|
module = "FurnitureLibraryEditor";
|
|
|
|
name = sweetName module version;
|
2014-06-15 12:49:18 +01:00
|
|
|
description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
|
2014-04-15 13:12:44 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
src = fetchcvs {
|
|
|
|
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
|
2016-03-02 20:32:39 +00:00
|
|
|
sha256 = "0rr4nqil1mngak3ds5vz7f1whrgcgzpk6fb0qcr5ljms0jx0ylvs";
|
2014-04-15 13:12:44 +01:00
|
|
|
module = module;
|
|
|
|
tag = "V_" + d2u version;
|
|
|
|
};
|
2016-03-03 05:22:46 +00:00
|
|
|
desktopName = "Sweet Home 3D - Furniture Library Editor";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|