sweethome3d: 6.4.2 -> 6.5.2, also bump editors, use fetchurl and fix build

fixes build failures
https://hydra.nixos.org/build/142550788/nixlog/2
https://hydra.nixos.org/build/142549864/nixlog/2

Replaces fetchsvn/fetchcvs with fetchurl because fetchcvs wasn't able to fetch newer versions.

jre8 seems to be required due to InaccessibleObjectException/IllegalAccessException on app start on jdk9+

ZHF: #122042
This commit is contained in:
Dmitry Ivankov 2021-05-09 14:37:06 +02:00 committed by Jonathan Ringer
parent 61e1c0fe89
commit 9236fe835f
2 changed files with 36 additions and 35 deletions

View file

@ -1,19 +1,17 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, fetchsvn
, makeWrapper , makeWrapper
, makeDesktopItem , makeDesktopItem
# sweethome3d 6.4.2 does not yet build with jdk 9 and later. # sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
# this is fixed on trunk (7699?) but let's build with jdk8 until then.
, jdk8 , jdk8
# it can run on the latest stable jre fine though , jre8
, jre
, ant , ant
, gtk3 , gtk3
, gsettings-desktop-schemas , gsettings-desktop-schemas
, p7zip , p7zip
, libXxf86vm , libXxf86vm
, unzip
}: }:
let let
@ -49,7 +47,7 @@ let
patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/i586/libnativewindow_x11.so patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/i586/libnativewindow_x11.so
''; '';
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper unzip ];
buildInputs = [ ant jdk8 p7zip gtk3 gsettings-desktop-schemas ]; buildInputs = [ ant jdk8 p7zip gtk3 gsettings-desktop-schemas ];
buildPhase = '' buildPhase = ''
@ -77,7 +75,7 @@ let
# without it a "Profiles [GL4bc, GL3bc, GL2, GLES1] not available on device null" # without it a "Profiles [GL4bc, GL3bc, GL2, GLES1] not available on device null"
# exception is thrown on startup. # exception is thrown on startup.
# https://discourse.nixos.org/t/glx-not-recognised-after-mesa-update/6753 # https://discourse.nixos.org/t/glx-not-recognised-after-mesa-update/6753
makeWrapper ${jre}/bin/java $out/bin/$exec \ makeWrapper ${jre8}/bin/java $out/bin/$exec \
--set MESA_GL_VERSION_OVERRIDE 2.1 \ --set MESA_GL_VERSION_OVERRIDE 2.1 \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
--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}" --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}"
@ -102,14 +100,13 @@ in {
application = mkSweetHome3D rec { application = mkSweetHome3D rec {
pname = lib.toLower module + "-application"; pname = lib.toLower module + "-application";
version = "6.4.2"; version = "6.5.2";
module = "SweetHome3D"; module = "SweetHome3D";
description = "Design and visualize your future home"; description = "Design and visualize your future home";
license = lib.licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
src = fetchsvn { src = fetchurl {
url = "https://svn.code.sf.net/p/sweethome3d/code/tags/V_" + d2u version + "/SweetHome3D/"; url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "13rczayakwb5246hqnp8lnw61p0p7ywr2294bnlp4zwsrz1in9z4"; sha256 = "1j0xm2vmcxxjmf12k8rfnisq9hd7hqaiyxrfbrbjxis9iq3kycp3";
rev = "7504";
}; };
desktopName = "Sweet Home 3D"; desktopName = "Sweet Home 3D";
icons = { icons = {

View file

@ -1,17 +1,17 @@
{ lib { lib
, stdenv , stdenv
, fetchcvs , fetchurl
, makeWrapper , makeWrapper
, makeDesktopItem , makeDesktopItem
# sweethome3d 6.4.2 does not yet build with jdk 9 and later. # sweethome3d 6.5.2 does not yet fully build&run with jdk 9 and later?
# this is fixed on trunk (7699?) but let's build with jdk8 until then.
, jdk8 , jdk8
# it can run on the latest stable jre fine though , jre8
, jre
, ant , ant
, gtk3 , gtk3
, gsettings-desktop-schemas , gsettings-desktop-schemas
, sweethome3dApp }: , sweethome3dApp
, unzip
}:
let let
@ -20,6 +20,14 @@ let
+ removeSuffix "libraryeditor" (toLower m) + removeSuffix "libraryeditor" (toLower m)
+ "-editor"; + "-editor";
applicationSrc = stdenv.mkDerivation {
name = "application-src";
src = sweethome3dApp.src;
nativeBuildInputs = [ unzip ];
buildPhase = "";
installPhase = "cp -r . $out";
};
mkEditorProject = mkEditorProject =
{ pname, module, version, src, license, description, desktopName }: { pname, module, version, src, license, description, desktopName }:
@ -35,18 +43,18 @@ let
categories = "Graphics;2DGraphics;3DGraphics;"; categories = "Graphics;2DGraphics;3DGraphics;";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper unzip ];
buildInputs = [ ant jre jdk8 gtk3 gsettings-desktop-schemas ]; buildInputs = [ ant jre8 jdk8 gtk3 gsettings-desktop-schemas ];
postPatch = '' postPatch = ''
sed -i -e 's,../SweetHome3D,${application.src},g' build.xml sed -i -e 's,../SweetHome3D,${applicationSrc},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 sed -i -e 's,lib/macosx/java3d-1.6/jogl-all.jar,lib/java3d-1.6/jogl-all.jar,g' build.xml
''; '';
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
ant -lib ${application.src}/libtest -lib ${application.src}/lib -lib ${jdk8}/lib ant -lib ${applicationSrc}/libtest -lib ${applicationSrc}/lib -lib ${jdk8}/lib
runHook postBuild runHook postBuild
''; '';
@ -56,7 +64,7 @@ let
mkdir -p $out/share/{java,applications} mkdir -p $out/share/{java,applications}
cp ${module}-${version}.jar $out/share/java/. cp ${module}-${version}.jar $out/share/java/.
cp "${editorItem}/share/applications/"* $out/share/applications cp "${editorItem}/share/applications/"* $out/share/applications
makeWrapper ${jre}/bin/java $out/bin/$exec \ makeWrapper ${jre8}/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 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}" --add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
''; '';
@ -78,31 +86,27 @@ let
in { in {
textures-editor = mkEditorProject rec { textures-editor = mkEditorProject rec {
version = "1.5"; version = "1.7";
module = "TexturesLibraryEditor"; module = "TexturesLibraryEditor";
pname = module; pname = module;
description = "Easily create SH3T files and edit the properties of the texture images it contain"; description = "Easily create SH3T files and edit the properties of the texture images it contain";
license = lib.licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
src = fetchcvs { src = fetchurl {
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d"; url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "15wxdns3hc8yq362x0rj53bcxran2iynxznfcb9js85psd94zq7h"; sha256 = "03vb9y645qzffxxdhgbjb0d98k3lafxckg2vh2s86j62b6357d0h";
module = module;
tag = "V_" + d2u version;
}; };
desktopName = "Sweet Home 3D - Textures Library Editor"; desktopName = "Sweet Home 3D - Textures Library Editor";
}; };
furniture-editor = mkEditorProject rec { furniture-editor = mkEditorProject rec {
version = "1.19"; version = "1.27";
module = "FurnitureLibraryEditor"; module = "FurnitureLibraryEditor";
pname = module; pname = module;
description = "Quickly create SH3F files and edit the properties of the 3D models it contain"; description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
license = lib.licenses.gpl2; license = lib.licenses.gpl2;
src = fetchcvs { src = fetchurl {
cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d"; url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
sha256 = "0rr4nqil1mngak3ds5vz7f1whrgcgzpk6fb0qcr5ljms0jx0ylvs"; sha256 = "1zxbcn9awgax8lalzkc05f5yfwbgnrayc17fkyv5i19j4qb3r2a0";
module = module;
tag = "V_" + d2u version;
}; };
desktopName = "Sweet Home 3D - Furniture Library Editor"; desktopName = "Sweet Home 3D - Furniture Library Editor";
}; };