2021-02-21 14:57:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-05-09 13:37:06 +01:00
|
|
|
, fetchurl
|
2021-02-21 14:57:19 +00:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
2021-05-09 13:37:06 +01:00
|
|
|
# sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
|
2021-02-21 14:57:19 +00:00
|
|
|
, jdk8
|
2021-05-09 13:37:06 +01:00
|
|
|
, jre8
|
2021-02-21 14:57:19 +00:00
|
|
|
, ant
|
|
|
|
, gtk3
|
|
|
|
, gsettings-desktop-schemas
|
2021-05-09 13:37:06 +01:00
|
|
|
, sweethome3dApp
|
|
|
|
, unzip
|
|
|
|
}:
|
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
|
|
|
|
2021-05-09 13:37:06 +01:00
|
|
|
applicationSrc = stdenv.mkDerivation {
|
|
|
|
name = "application-src";
|
|
|
|
src = sweethome3dApp.src;
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildPhase = "";
|
|
|
|
installPhase = "cp -r . $out";
|
|
|
|
};
|
|
|
|
|
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-05-09 13:37:06 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
|
|
|
buildInputs = [ ant jre8 jdk8 gtk3 gsettings-desktop-schemas ];
|
2014-04-15 13:12:44 +01:00
|
|
|
|
2021-02-21 14:57:19 +00:00
|
|
|
postPatch = ''
|
2021-05-09 13:37:06 +01:00
|
|
|
sed -i -e 's,../SweetHome3D,${applicationSrc},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
|
|
|
|
|
2021-05-09 13:37:06 +01:00
|
|
|
ant -lib ${applicationSrc}/libtest -lib ${applicationSrc}/lib -lib ${jdk8}/lib
|
2021-02-21 14:57:19 +00:00
|
|
|
|
|
|
|
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
|
2021-05-09 13:37:06 +01:00
|
|
|
makeWrapper ${jre8}/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 {
|
2021-05-09 13:37:06 +01:00
|
|
|
version = "1.7";
|
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;
|
2021-05-09 13:37:06 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
|
|
|
|
sha256 = "03vb9y645qzffxxdhgbjb0d98k3lafxckg2vh2s86j62b6357d0h";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
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 {
|
2021-08-01 14:03:35 +01:00
|
|
|
version = "1.28";
|
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;
|
2021-05-09 13:37:06 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
|
2021-08-01 14:03:35 +01:00
|
|
|
sha256 = "sha256-r5xJlUctUdcknJfm8rbz+bdzFhqgHsHpHwxEC4mItws=";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
2016-03-03 05:22:46 +00:00
|
|
|
desktopName = "Sweet Home 3D - Furniture Library Editor";
|
2014-04-15 13:12:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|