8 , stripJavaArchivesHook
10 , gsettings-desktop-schemas
17 sweetExec = m: "sweethome3d-" + lib.removeSuffix "libraryeditor" (lib.toLower m) + "-editor";
20 { pname, module, version, src, license, description, desktopName }:
22 stdenv.mkDerivation rec {
23 application = sweethome3dApp;
24 inherit pname module version src description;
25 exec = sweetExec module;
26 editorItem = makeDesktopItem {
27 inherit exec desktopName;
29 comment = description;
30 genericName = "Computer Aided (Interior) Design";
31 categories = [ "Graphics" "2DGraphics" "3DGraphics" ];
34 nativeBuildInputs = [ makeWrapper stripJavaArchivesHook ];
35 buildInputs = [ ant jdk gtk3 gsettings-desktop-schemas ];
37 # upstream targets Java 7 by default
38 env.ANT_ARGS = "-DappletClassSource=8 -DappletClassTarget=8 -DclassSource=8 -DclassTarget=8";
41 sed -i -e 's,../SweetHome3D,${sweethome3dApp.src},g' build.xml
42 sed -i -e 's,lib/macosx/java3d-1.6/jogl-all.jar,lib/java3d-1.6/jogl-all.jar,g' build.xml
48 ant -lib ${sweethome3dApp.src}/libtest -lib ${sweethome3dApp.src}/lib -lib ${jdk}/lib
55 mkdir -p $out/share/{java,applications}
56 cp ${module}-${version}.jar $out/share/java/.
57 cp "${editorItem}/share/applications/"* $out/share/applications
58 makeWrapper ${jdk}/bin/java $out/bin/$exec \
59 --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
60 --add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
66 homepage = "http://www.sweethome3d.com/index.jsp";
69 maintainers = [ lib.maintainers.edwtjo ];
70 platforms = lib.platforms.linux;
76 d2u = lib.replaceStrings ["."] ["_"];
80 textures-editor = mkEditorProject rec {
82 module = "TexturesLibraryEditor";
84 description = "Easily create SH3T files and edit the properties of the texture images it contain";
85 license = lib.licenses.gpl2Plus;
87 url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
88 hash = "sha256-v8hMEUujTgWvFnBTF8Dnd1iWgoIXBzGMUxBgmjdxx+g=";
90 desktopName = "Sweet Home 3D - Textures Library Editor";
93 furniture-editor = mkEditorProject rec {
95 module = "FurnitureLibraryEditor";
97 description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
98 license = lib.licenses.gpl2Plus;
100 url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
101 hash = "sha256-pqsSxQPzsyx4PS98fgU6UFhPWhpQoepGm0uJtkvV46c=";
103 desktopName = "Sweet Home 3D - Furniture Library Editor";