2021-02-21 17:57:19 +03:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-05-09 15:37:06 +03:00
|
|
|
, fetchurl
|
2021-02-21 17:57:19 +03:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
2021-05-09 15:37:06 +03:00
|
|
|
# sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
|
2021-02-21 17:57:19 +03:00
|
|
|
, jdk8
|
2021-05-09 15:37:06 +03:00
|
|
|
, jre8
|
2021-02-21 17:57:19 +03:00
|
|
|
, ant
|
|
|
|
, gtk3
|
|
|
|
, gsettings-desktop-schemas
|
2021-05-09 15:37:06 +03:00
|
|
|
, sweethome3dApp
|
|
|
|
, unzip
|
|
|
|
}:
|
2014-04-15 16:12:44 +04:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-01-15 08:42:41 +03:00
|
|
|
sweetExec = with lib;
|
2014-04-15 16:12:44 +04:00
|
|
|
m: "sweethome3d-"
|
|
|
|
+ removeSuffix "libraryeditor" (toLower m)
|
|
|
|
+ "-editor";
|
2016-03-03 08:22:46 +03:00
|
|
|
|
2021-05-09 15:37:06 +03:00
|
|
|
applicationSrc = stdenv.mkDerivation {
|
|
|
|
name = "application-src";
|
|
|
|
src = sweethome3dApp.src;
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildPhase = "";
|
|
|
|
installPhase = "cp -r . $out";
|
|
|
|
};
|
|
|
|
|
2014-04-15 16:12:44 +04:00
|
|
|
mkEditorProject =
|
2019-11-24 20:22:28 +03:00
|
|
|
{ pname, module, version, src, license, description, desktopName }:
|
2014-04-15 16:12:44 +04:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
application = sweethome3dApp;
|
2019-11-24 20:22:28 +03:00
|
|
|
inherit pname module version src description;
|
2014-04-15 16:12:44 +04:00
|
|
|
exec = sweetExec module;
|
|
|
|
editorItem = makeDesktopItem {
|
2016-03-03 08:22:46 +03:00
|
|
|
inherit exec desktopName;
|
2019-11-24 20:22:28 +03:00
|
|
|
name = pname;
|
2014-04-15 16:12:44 +04:00
|
|
|
comment = description;
|
|
|
|
genericName = "Computer Aided (Interior) Design";
|
2020-06-25 05:18:37 +03:00
|
|
|
categories = "Graphics;2DGraphics;3DGraphics;";
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
|
|
|
|
2021-05-09 15:37:06 +03:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
|
|
|
buildInputs = [ ant jre8 jdk8 gtk3 gsettings-desktop-schemas ];
|
2014-04-15 16:12:44 +04:00
|
|
|
|
2021-02-21 17:57:19 +03:00
|
|
|
postPatch = ''
|
2021-05-09 15:37:06 +03:00
|
|
|
sed -i -e 's,../SweetHome3D,${applicationSrc},g' build.xml
|
2017-02-12 22:22:35 +03: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 16:12:44 +04:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2021-02-21 17:57:19 +03:00
|
|
|
runHook preBuild
|
|
|
|
|
2021-05-09 15:37:06 +03:00
|
|
|
ant -lib ${applicationSrc}/libtest -lib ${applicationSrc}/lib -lib ${jdk8}/lib
|
2021-02-21 17:57:19 +03:00
|
|
|
|
|
|
|
runHook postBuild
|
2014-04-15 16:12:44 +04:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/{java,applications}
|
|
|
|
cp ${module}-${version}.jar $out/share/java/.
|
2015-03-18 14:52:32 +03:00
|
|
|
cp "${editorItem}/share/applications/"* $out/share/applications
|
2021-05-09 15:37:06 +03:00
|
|
|
makeWrapper ${jre8}/bin/java $out/bin/$exec \
|
2018-02-25 05:23:58 +03:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2018-08-20 22:11:29 +03:00
|
|
|
--add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
|
2014-04-15 16:12:44 +04:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "http://www.sweethome3d.com/index.jsp";
|
2014-04-15 16:12:44 +04:00
|
|
|
inherit description;
|
|
|
|
inherit license;
|
2021-01-15 08:42:41 +03:00
|
|
|
maintainers = [ lib.maintainers.edwtjo ];
|
|
|
|
platforms = lib.platforms.linux;
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-01-15 08:42:41 +03:00
|
|
|
d2u = lib.replaceChars ["."] ["_"];
|
2014-04-15 16:12:44 +04:00
|
|
|
|
2015-03-18 14:52:32 +03:00
|
|
|
in {
|
2014-04-15 16:12:44 +04:00
|
|
|
|
|
|
|
textures-editor = mkEditorProject rec {
|
2021-05-09 15:37:06 +03:00
|
|
|
version = "1.7";
|
2014-04-15 16:12:44 +04:00
|
|
|
module = "TexturesLibraryEditor";
|
2019-11-24 20:22:28 +03:00
|
|
|
pname = module;
|
2014-06-15 15:49:18 +04:00
|
|
|
description = "Easily create SH3T files and edit the properties of the texture images it contain";
|
2021-01-15 08:42:41 +03:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-05-09 15:37:06 +03:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
|
|
|
|
sha256 = "03vb9y645qzffxxdhgbjb0d98k3lafxckg2vh2s86j62b6357d0h";
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
2016-03-03 08:22:46 +03:00
|
|
|
desktopName = "Sweet Home 3D - Textures Library Editor";
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
furniture-editor = mkEditorProject rec {
|
2021-08-01 16:03:35 +03:00
|
|
|
version = "1.28";
|
2014-04-15 16:12:44 +04:00
|
|
|
module = "FurnitureLibraryEditor";
|
2019-11-24 20:22:28 +03:00
|
|
|
pname = module;
|
2014-06-15 15:49:18 +04:00
|
|
|
description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
|
2021-01-15 08:42:41 +03:00
|
|
|
license = lib.licenses.gpl2;
|
2021-05-09 15:37:06 +03:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
|
2021-08-01 16:03:35 +03:00
|
|
|
sha256 = "sha256-r5xJlUctUdcknJfm8rbz+bdzFhqgHsHpHwxEC4mItws=";
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
2016-03-03 08:22:46 +03:00
|
|
|
desktopName = "Sweet Home 3D - Furniture Library Editor";
|
2014-04-15 16:12:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|