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