2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
|
|
|
|
, gtk3, gsettings-desktop-schemas, sweethome3dApp }:
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
sweetExec = with stdenv.lib;
|
|
|
|
m: "sweethome3d-"
|
|
|
|
+ removeSuffix "libraryeditor" (toLower m)
|
|
|
|
+ "-editor";
|
2016-03-03 05:22:46 +00:00
|
|
|
|
2014-04-15 13:12:44 +01:00
|
|
|
mkEditorProject =
|
2019-11-24 17:22:28 +00:00
|
|
|
{ pname, module, version, src, license, description, desktopName }:
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
application = sweethome3dApp;
|
2019-11-24 17:22:28 +00:00
|
|
|
inherit pname module version src description;
|
2014-04-15 13:12:44 +01:00
|
|
|
exec = sweetExec module;
|
|
|
|
editorItem = makeDesktopItem {
|
2016-03-03 05:22:46 +00:00
|
|
|
inherit exec desktopName;
|
2019-11-24 17:22:28 +00:00
|
|
|
name = pname;
|
2014-04-15 13:12:44 +01:00
|
|
|
comment = description;
|
|
|
|
genericName = "Computer Aided (Interior) Design";
|
2020-06-25 03:18:37 +01:00
|
|
|
categories = "Graphics;2DGraphics;3DGraphics;";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
2018-02-25 02:23:58 +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
|
2017-02-12 19:22:35 +00: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 13:12:44 +01: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 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 \
|
2018-02-25 02:23:58 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2018-08-20 20:11:29 +01:00
|
|
|
--add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
|
2014-04-15 13:12:44 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.sweethome3d.com/index.jsp";
|
2014-04-15 13:12:44 +01:00
|
|
|
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";
|
2019-11-24 17:22:28 +00:00
|
|
|
pname = module;
|
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";
|
2019-11-24 17:22:28 +00:00
|
|
|
pname = module;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|