sweethome3d.*: use fetchzip instead of fetchurl with unzip

Other small fixes:
 - Fix hashes to use hash instead of sha256
 - Change license from gpl2 to gpl2Plus for the last remaining unchanged license.
 - Remove unused d2u function.
This commit is contained in:
TomaSajt 2024-02-08 18:39:19 +01:00 committed by Bjørn Forsman
parent 8f6b396c49
commit 2eb6898ebc
2 changed files with 13 additions and 23 deletions

View file

@ -1,5 +1,6 @@
{ lib
, stdenv
, fetchzip
, fetchurl
, makeWrapper
, makeDesktopItem
@ -50,7 +51,7 @@ let
find . -name '*.so' | xargs strings | { grep '/nix/store' || :; } >> ./.jar-paths
'';
nativeBuildInputs = [ makeWrapper unzip autoPatchelfHook ];
nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
buildInputs = [ ant jdk p7zip gtk3 gsettings-desktop-schemas libXxf86vm ];
# upstream targets Java 7 by default
@ -103,9 +104,6 @@ let
mainProgram = exec;
};
};
d2u = lib.replaceStrings ["."] ["_"];
in {
application = mkSweetHome3D rec {
@ -114,9 +112,9 @@ in {
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-RVuwxL/YATqHoQuc25ZaYgZ+o2rMOqnzU8/LLxb5Ra4=";
};
desktopName = "Sweet Home 3D";
icons = {

View file

@ -1,6 +1,6 @@
{ lib
, stdenv
, fetchurl
, fetchzip
, makeWrapper
, makeDesktopItem
, jdk
@ -18,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 }:
@ -41,21 +33,21 @@ let
categories = [ "Graphics" "2DGraphics" "3DGraphics" ];
};
nativeBuildInputs = [ makeWrapper unzip ];
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 ${jdk}/lib
ant -lib ${sweethome3dApp.src}/libtest -lib ${sweethome3dApp.src}/lib -lib ${jdk}/lib
runHook postBuild
'';
@ -93,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";
};
@ -105,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";
};