Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-23.11] sweethome3d.application: 7.2 -> 7.3 #304031

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions pkgs/applications/misc/sweethome3d/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{ lib
, stdenv
, fetchzip
, fetchurl
, makeWrapper
, makeDesktopItem
# sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
, jdk8
, jre8
, jdk
, ant
, gtk3
, gsettings-desktop-schemas
, p7zip
, autoPatchelfHook
, libXxf86vm
, unzip
, libGL
}:

let
Expand Down Expand Up @@ -42,7 +42,7 @@ let
};

postPatch = ''
addAutoPatchelfSearchPath ${jre8}/lib/openjdk/jre/lib/
addAutoPatchelfSearchPath ${jdk}/lib/openjdk/lib/
autoPatchelf lib

# Nix cannot see the runtime references to the paths we just patched in
Expand All @@ -51,8 +51,11 @@ let
find . -name '*.so' | xargs strings | { grep '/nix/store' || :; } >> ./.jar-paths
'';

nativeBuildInputs = [ makeWrapper unzip autoPatchelfHook ];
buildInputs = [ ant jdk8 p7zip gtk3 gsettings-desktop-schemas libXxf86vm ];
nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
buildInputs = [ ant jdk p7zip gtk3 gsettings-desktop-schemas libXxf86vm ];

# upstream targets Java 7 by default
env.ANT_ARGS = "-DappletClassSource=8 -DappletClassTarget=8 -DclassSource=8 -DclassTarget=8";

buildPhase = ''
runHook preBuild
Expand All @@ -75,13 +78,9 @@ let

cp "${sweethome3dItem}/share/applications/"* $out/share/applications

# MESA_GL_VERSION_OVERRIDE is needed since the update from MESA 19.3.3 to 20.0.2:
# without it a "Profiles [GL4bc, GL3bc, GL2, GLES1] not available on device null"
# exception is thrown on startup.
# https://discourse.nixos.org/t/glx-not-recognised-after-mesa-update/6753
makeWrapper ${jre8}/bin/java $out/bin/$exec \
--set MESA_GL_VERSION_OVERRIDE 2.1 \
makeWrapper ${jdk}/bin/java $out/bin/$exec \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
--add-flags "-Dsun.java2d.opengl=true -jar $out/share/java/${module}-${version}.jar -cp $out/share/java/Furniture.jar:$out/share/java/Textures.jar:$out/share/java/Help.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"


Expand All @@ -102,22 +101,20 @@ let
inherit license;
maintainers = [ lib.maintainers.edwtjo ];
platforms = lib.platforms.linux;
mainProgram = exec;
};
};

d2u = lib.replaceStrings ["."] ["_"];

in {

application = mkSweetHome3D rec {
pname = lib.toLower module + "-application";
version = "7.2";
version = "7.3";
module = "SweetHome3D";
description = "Design and visualize your future home";
license = lib.licenses.gpl2Plus;
src = fetchurl {
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "sha256-Io3HfussfSy6CLHE0JCAk0gjBAla/u+pS1Gan8BxozY=";
hash = "sha256-adMQzQE+xAZpMJyQFm01A+AfvcB5YHsJvk+533BUf1Q=";
};
desktopName = "Sweet Home 3D";
icons = {
Expand Down
38 changes: 16 additions & 22 deletions pkgs/applications/misc/sweethome3d/editors.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{ lib
, stdenv
, fetchurl
, fetchzip
, makeWrapper
, makeDesktopItem
# sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
, jdk8
, jre8
, jdk
, ant
, gtk3
, gsettings-desktop-schemas
Expand All @@ -20,14 +18,6 @@ let
+ removeSuffix "libraryeditor" (toLower m)
+ "-editor";

applicationSrc = stdenv.mkDerivation {
name = "application-src";
src = sweethome3dApp.src;
nativeBuildInputs = [ unzip ];
buildPhase = "";
installPhase = "cp -r . $out";
};

mkEditorProject =
{ pname, module, version, src, license, description, desktopName }:

Expand All @@ -43,18 +33,21 @@ let
categories = [ "Graphics" "2DGraphics" "3DGraphics" ];
};

nativeBuildInputs = [ makeWrapper unzip ];
buildInputs = [ ant jre8 jdk8 gtk3 gsettings-desktop-schemas ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ ant jdk gtk3 gsettings-desktop-schemas ];

# upstream targets Java 7 by default
env.ANT_ARGS = "-DappletClassSource=8 -DappletClassTarget=8 -DclassSource=8 -DclassTarget=8";

postPatch = ''
sed -i -e 's,../SweetHome3D,${applicationSrc},g' build.xml
sed -i -e 's,../SweetHome3D,${sweethome3dApp.src},g' build.xml
sed -i -e 's,lib/macosx/java3d-1.6/jogl-all.jar,lib/java3d-1.6/jogl-all.jar,g' build.xml
'';

buildPhase = ''
runHook preBuild

ant -lib ${applicationSrc}/libtest -lib ${applicationSrc}/lib -lib ${jdk8}/lib
ant -lib ${sweethome3dApp.src}/libtest -lib ${sweethome3dApp.src}/lib -lib ${jdk}/lib

runHook postBuild
'';
Expand All @@ -64,7 +57,7 @@ let
mkdir -p $out/share/{java,applications}
cp ${module}-${version}.jar $out/share/java/.
cp "${editorItem}/share/applications/"* $out/share/applications
makeWrapper ${jre8}/bin/java $out/bin/$exec \
makeWrapper ${jdk}/bin/java $out/bin/$exec \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
--add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
'';
Expand All @@ -77,6 +70,7 @@ let
inherit license;
maintainers = [ lib.maintainers.edwtjo ];
platforms = lib.platforms.linux;
mainProgram = exec;
};

};
Expand All @@ -91,9 +85,9 @@ in {
pname = module;
description = "Easily create SH3T files and edit the properties of the texture images it contain";
license = lib.licenses.gpl2Plus;
src = fetchurl {
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "03vb9y645qzffxxdhgbjb0d98k3lafxckg2vh2s86j62b6357d0h";
hash = "sha256-v8hMEUujTgWvFnBTF8Dnd1iWgoIXBzGMUxBgmjdxx+g=";
};
desktopName = "Sweet Home 3D - Textures Library Editor";
};
Expand All @@ -103,10 +97,10 @@ in {
module = "FurnitureLibraryEditor";
pname = module;
description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
license = lib.licenses.gpl2;
src = fetchurl {
license = lib.licenses.gpl2Plus;
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "sha256-r5xJlUctUdcknJfm8rbz+bdzFhqgHsHpHwxEC4mItws=";
hash = "sha256-pqsSxQPzsyx4PS98fgU6UFhPWhpQoepGm0uJtkvV46c=";
};
desktopName = "Sweet Home 3D - Furniture Library Editor";
};
Expand Down
Loading