2014-04-15 14:12:44 +02:00
|
|
|
{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
|
2015-03-18 12:52:32 +01:00
|
|
|
, gtk3, gsettings_desktop_schemas, p7zip, sweethome3dApp }:
|
2014-04-15 14:12:44 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
sweetExec = with stdenv.lib;
|
|
|
|
m: "sweethome3d-"
|
|
|
|
+ removeSuffix "libraryeditor" (toLower m)
|
|
|
|
+ "-editor";
|
|
|
|
sweetName = m: v: sweetExec m + "-" + v;
|
|
|
|
|
|
|
|
mkEditorProject =
|
|
|
|
{ name, module, version, src, license, description }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
application = sweethome3dApp;
|
|
|
|
inherit name module version src description;
|
|
|
|
exec = sweetExec module;
|
|
|
|
editorItem = makeDesktopItem {
|
|
|
|
inherit name exec;
|
|
|
|
comment = description;
|
|
|
|
desktopName = name;
|
|
|
|
genericName = "Computer Aided (Interior) Design";
|
|
|
|
categories = "Application;CAD;";
|
|
|
|
};
|
|
|
|
|
2015-03-18 12:52:32 +01:00
|
|
|
buildInputs = [ ant jre jdk makeWrapper gtk3 gsettings_desktop_schemas ];
|
2014-04-15 14:12:44 +02:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e 's,../SweetHome3D,${application.src},g' build.xml
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 12:52:32 +01:00
|
|
|
cp "${editorItem}/share/applications/"* $out/share/applications
|
2014-04-15 14:12:44 +02:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/$exec \
|
2015-10-05 22:56:47 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings_desktop_schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2014-04-15 14:12:44 +02:00
|
|
|
--add-flags "-jar $out/share/java/${module}-${version}.jar ${if stdenv.system == "x86_64-linux" then "-d64" else "-d32"}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.sweethome3d.com/index.jsp";
|
|
|
|
inherit description;
|
|
|
|
inherit license;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.edwtjo ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
d2u = stdenv.lib.replaceChars ["."] ["_"];
|
|
|
|
|
2015-03-18 12:52:32 +01:00
|
|
|
in {
|
2014-04-15 14:12:44 +02:00
|
|
|
|
|
|
|
textures-editor = mkEditorProject rec {
|
2014-10-05 15:01:12 +02:00
|
|
|
version = "1.4";
|
2014-04-15 14:12:44 +02:00
|
|
|
module = "TexturesLibraryEditor";
|
|
|
|
name = sweetName module version;
|
2014-06-15 13:49:18 +02:00
|
|
|
description = "Easily create SH3T files and edit the properties of the texture images it contain";
|
2014-04-15 14:12:44 +02:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
src = fetchcvs {
|
|
|
|
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
|
2014-10-05 15:01:12 +02:00
|
|
|
sha256 = "1j1ygb32dca48hng5bsna9f84vyin5qc3ds44xi39057izmw8499";
|
2014-04-15 14:12:44 +02:00
|
|
|
module = module;
|
|
|
|
tag = "V_" + d2u version;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
furniture-editor = mkEditorProject rec {
|
2015-03-18 12:52:32 +01:00
|
|
|
version = "1.16";
|
2014-04-15 14:12:44 +02:00
|
|
|
module = "FurnitureLibraryEditor";
|
|
|
|
name = sweetName module version;
|
2014-06-15 13:49:18 +02:00
|
|
|
description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
|
2014-04-15 14:12:44 +02:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
src = fetchcvs {
|
|
|
|
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
|
2015-03-18 12:52:32 +01:00
|
|
|
sha256 = "09dmb0835kncs1ngszhyp1pgvj7vqjjrp9q405gakm8ylrzym374";
|
2014-04-15 14:12:44 +02:00
|
|
|
module = module;
|
|
|
|
tag = "V_" + d2u version;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|