2021-02-21 14:57:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchcvs
|
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
# sweethome3d 6.4.2 does not yet build with jdk 9 and later.
|
|
|
|
# this is fixed on trunk (7699?) but let's build with jdk8 until then.
|
|
|
|
, jdk8
|
|
|
|
# it can run on the latest stable jre fine though
|
|
|
|
, jre
|
|
|
|
, ant
|
|
|
|
, gtk3
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, sweethome3dApp }:
|
2014-04-15 13:12:44 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
sweetExec = with lib;
|
2014-04-15 13:12:44 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-02-26 09:25:13 +00:00
|
|
|
buildInputs = [ ant jre jdk8 gtk3 gsettings-desktop-schemas ];
|
2014-04-15 13:12:44 +01:00
|
|
|
|
2021-02-21 14:57:19 +00:00
|
|
|
postPatch = ''
|
2014-04-15 13:12:44 +01:00
|
|
|
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 = ''
|
2021-02-21 14:57:19 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
ant -lib ${application.src}/libtest -lib ${application.src}/lib -lib ${jdk8}/lib
|
|
|
|
|
|
|
|
runHook postBuild
|
2014-04-15 13:12:44 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
2021-01-15 05:42:41 +00:00
|
|
|
maintainers = [ lib.maintainers.edwtjo ];
|
|
|
|
platforms = lib.platforms.linux;
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
d2u = lib.replaceChars ["."] ["_"];
|
2014-04-15 13:12:44 +01:00
|
|
|
|
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";
|
2021-01-15 05:42:41 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2014-04-15 13:12:44 +01:00
|
|
|
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";
|
2021-01-15 05:42:41 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2014-04-15 13:12:44 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|