push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
--- /build.xml
+++ /build.xml
@@ -1134,6 +1134,12 @@
<arg value="${javaHome_macosx_arm64}/legal"/>
<arg value="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/runtime/Contents/Home"/>
</exec>
+ <!-- Fix permissions -->
+ <exec executable="chmod" failonerror="yes">
+ <arg value="-R"/>
+ <arg value="u+w"/>
+ <arg value="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/runtime/Contents/Home/legal"/>
+ </exec>
<!-- Remove legal files not exported by jpackage -->
<delete dir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/runtime/Contents/Home/legal/jdk.jcmd"/>
<delete dir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/runtime/Contents/Home/legal/jdk.internal.vm.compiler"/>

View File

@@ -0,0 +1,13 @@
--- "a/install/macosx/Sweet Home 3D/Contents/app/SweetHome3D.cfg"
+++ "b/install/macosx/Sweet Home 3D/Contents/app/SweetHome3D.cfg"
@@ -6,6 +6,10 @@
[JavaOptions]
java-options=-Xmx2000m
+java-options=--add-opens=java.desktop/java.awt=ALL-UNNAMED
+java-options=--add-opens=java.desktop/sun.awt=ALL-UNNAMED
+java-options=--add-opens=java.desktop/com.apple.eio=ALL-UNNAMED
+java-options=--add-opens=java.desktop/com.apple.eawt=ALL-UNNAMED
java-options=-Djava.library.path=$APPDIR
java-options=-Djogamp.gluegen.UseTempJarCache=false
java-options=-Djava.locale.providers=COMPAT,SPI

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
makeBinaryWrapper,
zulu,
ant,
darwin,
pname,
version,
src,
meta,
patches,
}:
stdenv.mkDerivation (finalAttrs: {
inherit
pname
version
src
meta
patches
;
nativeBuildInputs = [
darwin.autoSignDarwinBinariesHook
makeBinaryWrapper
ant
];
buildInputs = [
zulu
];
buildPhase = ''
runHook preBuild
ant macosxBundle -DjavaHome_macosx_arm64=${zulu.home}/zulu-${lib.versions.major zulu.version}.jdk/Contents/Home
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
mv "install/macosx/SweetHome3D-${finalAttrs.version}/Sweet Home 3D.app" $out/Applications
makeWrapper "$out/Applications/Sweet Home 3D.app/Contents/MacOS/SweetHome3D" $out/bin/sweethome3d
runHook postInstall
'';
dontStrip = true;
})

View File

@@ -0,0 +1,61 @@
{
lib,
fetchzip,
stdenv,
callPackage,
}:
let
pname = "sweethome3d";
version = "7.5";
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/SweetHome3D-${version}-src.zip";
hash = "sha256-+rAhq5sFXC34AMYCcdAYZzrUa3LDy4S5Zid4DlEVvTQ=";
};
patches = [
./build-xml.patch
./config.patch
];
meta = {
homepage = "https://www.sweethome3d.com/index.jsp";
description = "Design and visualize your future home";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
edwtjo
DimitarNestorov
];
platforms = [
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
"aarch64-darwin"
];
mainProgram = "sweethome3d";
};
in
{
application =
if stdenv.hostPlatform.isDarwin then
callPackage ./darwin.nix {
inherit
pname
version
src
meta
patches
;
}
else
callPackage ./linux.nix {
inherit
pname
version
src
meta
patches
;
};
}

View File

@@ -0,0 +1,134 @@
{
lib,
stdenv,
fetchzip,
makeWrapper,
makeDesktopItem,
jdk,
ant,
stripJavaArchivesHook,
gtk3,
gsettings-desktop-schemas,
sweethome3dApp,
unzip,
}:
let
sweetExec = m: "sweethome3d-" + lib.removeSuffix "libraryeditor" (lib.toLower m) + "-editor";
mkEditorProject =
{
pname,
module,
version,
src,
license,
description,
desktopName,
}:
stdenv.mkDerivation rec {
application = sweethome3dApp;
inherit
pname
module
version
src
description
;
exec = sweetExec module;
editorItem = makeDesktopItem {
inherit exec desktopName;
name = pname;
comment = description;
genericName = "Computer Aided (Interior) Design";
categories = [
"Graphics"
"2DGraphics"
"3DGraphics"
];
};
nativeBuildInputs = [
makeWrapper
stripJavaArchivesHook
];
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,${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 ${sweethome3dApp.src}/libtest -lib ${sweethome3dApp.src}/lib -lib ${jdk}/lib
runHook postBuild
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/{java,applications}
cp ${module}-${version}.jar $out/share/java/.
cp "${editorItem}/share/applications/"* $out/share/applications
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}"
'';
dontStrip = true;
meta = {
homepage = "http://www.sweethome3d.com/index.jsp";
inherit description;
inherit license;
maintainers = [ lib.maintainers.edwtjo ];
platforms = lib.platforms.linux;
mainProgram = exec;
};
};
d2u = lib.replaceStrings [ "." ] [ "_" ];
in
{
textures-editor = mkEditorProject rec {
version = "1.7";
module = "TexturesLibraryEditor";
pname = module;
description = "Easily create SH3T files and edit the properties of the texture images it contain";
license = lib.licenses.gpl2Plus;
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
hash = "sha256-v8hMEUujTgWvFnBTF8Dnd1iWgoIXBzGMUxBgmjdxx+g=";
};
desktopName = "Sweet Home 3D - Textures Library Editor";
};
furniture-editor = mkEditorProject rec {
version = "1.28";
module = "FurnitureLibraryEditor";
pname = module;
description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
license = lib.licenses.gpl2Plus;
src = fetchzip {
url = "mirror://sourceforge/sweethome3d/${module}-${version}-src.zip";
hash = "sha256-pqsSxQPzsyx4PS98fgU6UFhPWhpQoepGm0uJtkvV46c=";
};
desktopName = "Sweet Home 3D - Furniture Library Editor";
};
}

View File

@@ -0,0 +1,140 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
makeDesktopItem,
jdk,
ant,
stripJavaArchivesHook,
gtk3,
gsettings-desktop-schemas,
p7zip,
autoPatchelfHook,
libXxf86vm,
libGL,
copyDesktopItems,
pname,
version,
src,
meta,
patches,
}:
let
# TODO: Should we move this to `lib`? Seems like its would be useful in many cases.
extensionOf =
filePath: lib.concatStringsSep "." (lib.tail (lib.splitString "." (baseNameOf filePath)));
installIcons =
iconName: icons:
lib.concatStringsSep "\n" (
lib.mapAttrsToList (size: iconFile: ''
mkdir -p "$out/share/icons/hicolor/${size}/apps"
ln -s -T "${iconFile}" "$out/share/icons/hicolor/${size}/apps/${iconName}.${extensionOf iconFile}"
'') icons
);
icons = {
"32x32" = fetchurl {
url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon32x32.png";
sha256 = "1r2fhfg27mx00nfv0qj66rhf719s2g1vhdis7bdc9mqk9x0mb0ir";
};
"48x48" = fetchurl {
url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon48x48.png";
sha256 = "1ap6d75dyqqvx21wddvn8vw2apq3v803vmbxdriwd0dw9rq3zn4g";
};
};
in
stdenv.mkDerivation {
inherit
pname
version
src
meta
patches
;
desktopItems = [
(makeDesktopItem {
name = "sweethome3d";
desktopName = "Sweet Home 3D";
icon = "sweethome3d";
comment = meta.description;
exec = meta.mainProgram;
genericName = "Computer Aided (Interior) Design";
categories = [
"Graphics"
"2DGraphics"
"3DGraphics"
];
})
];
postPatch = ''
addAutoPatchelfSearchPath ${jdk}/lib/openjdk/lib/
autoPatchelf lib
# Nix cannot see the runtime references to the paths we just patched in
# once they've been compressed into the .jar. Scan for and remember them
# as plain text so they don't get overlooked.
find . -name '*.so' | xargs strings | { grep '/nix/store' || :; } >> ./.jar-paths
'';
nativeBuildInputs = [
makeWrapper
autoPatchelfHook
stripJavaArchivesHook
copyDesktopItems
];
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
ant furniture textures help
mkdir -p $out/share/{java,applications}
mv "build/"*.jar $out/share/java/.
ant
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp install/SweetHome3D-${version}.jar $out/share/java/.
${installIcons "sweethome3d" icons}
makeWrapper ${jdk}/bin/java $out/bin/${meta.mainProgram} \
--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/SweetHome3D-${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}"
# remember the store paths found inside the .jar libraries. note that
# which file they are in does not matter in particular, just that some
# file somewhere lists them in plain-text
mkdir -p $out/nix-support
cp .jar-paths $out/nix-support/depends
runHook postInstall
'';
dontStrip = true;
}