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

sweethome3d: fix list of platforms and darwin build #359837

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lpzimmermann
Copy link
Contributor

@lpzimmermann lpzimmermann commented Nov 28, 2024

Added darwin support to this java package

#ZurichZHF

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@lpzimmermann lpzimmermann force-pushed the fix/sweethome3d-darwin branch from 221f9b5 to 433e320 Compare November 28, 2024 12:34
@lpzimmermann lpzimmermann force-pushed the fix/sweethome3d-darwin branch from 433e320 to 4801848 Compare November 28, 2024 12:36
@lpzimmermann lpzimmermann changed the title sweethome3d: package works on darwin sweethome3d: support all java platforms Nov 28, 2024
@katexochen katexochen removed their request for review November 28, 2024 12:41
@ofborg ofborg bot requested a review from edwtjo November 29, 2024 03:49
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Nov 29, 2024
Copy link
Member

@Scrumplex Scrumplex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream doesn't seem to include binaries for all architectures supported by jdk.

See ${src}/lib

Edit:

Seems like only the following systems should be supported by this:

i686-linux
i686-windows
x86_64-darwin
x86_64-linux
x86_64-windows

Obviously, the Windows ones aren't really relevant for Nixpkgs.

Edit 2:

When trying to start the application on aarch64-linux:

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.eteks.sweethome3d.SweetHome3DBootstrap.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load library 'gluegen_rt' generically including [/nix/store/1kpzmzzbr72ppjml5jdvc1dk4n23dvfj-libglvnd-1.7.0/lib, /nix/store/3zbirj0yiss34apibqs3gscfxnxwc9rb-pipewire-1.2.6-jack/lib], nor as [/nix/store/1kpzmzzbr72ppjml5jdvc1dk4n23dvfj-libglvnd-1.7.0/lib/libgluegen_rt.so, /nix/store/3zbirj0yiss34apibqs3gscfxnxwc9rb-pipewire-1.2.6-jack/lib/libgluegen_rt.so, /usr/java/packages/lib/libgluegen_rt.so, /usr/lib64/libgluegen_rt.so, /lib64/libgluegen_rt.so, /lib/libgluegen_rt.so, /usr/lib/libgluegen_rt.so, /home/scrumplex/Projects/nixpkgs/libgluegen_rt.so, /home/scrumplex/Projects/nixpkgs/natives/linux-aarch64/libgluegen_rt.so]
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:634)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:107)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:488)
	at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
	at com.jogamp.common.os.Platform$1.run(Platform.java:321)
	at com.jogamp.common.util.SecurityUtil.doPrivileged(SecurityUtil.java:80)
	at com.jogamp.common.os.Platform.<clinit>(Platform.java:290)
	at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:151)
	at jogamp.opengl.ThreadingImpl$1.run(ThreadingImpl.java:83)
	at jogamp.opengl.ThreadingImpl$1.run(ThreadingImpl.java:66)
	at com.jogamp.common.util.SecurityUtil.doPrivileged(SecurityUtil.java:80)
	at jogamp.opengl.ThreadingImpl.<clinit>(ThreadingImpl.java:66)
	at com.jogamp.opengl.Threading.disableSingleThreading(Threading.java:164)
	at javax.media.j3d.JoglPipeline.initialize(JoglPipeline.java:129)
	at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:92)
	at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:858)
	at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:267)
	at javax.media.j3d.GraphicsConfigTemplate3D.isGraphicsConfigSupported(GraphicsConfigTemplate3D.java:348)
	at com.eteks.sweethome3d.j3d.Component3DManager.createGraphicsConfigurationTemplate3D(Unknown Source)
	at com.eteks.sweethome3d.j3d.Component3DManager.<init>(Unknown Source)
	at com.eteks.sweethome3d.j3d.Component3DManager.getInstance(Unknown Source)
	at com.eteks.sweethome3d.SweetHome3D.addComponent3DRenderingErrorObserver(Unknown Source)
	at com.eteks.sweethome3d.SweetHome3D.init(Unknown Source)
	at com.eteks.sweethome3d.SweetHome3D.main(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 2 more

pkgs/applications/misc/sweethome3d/default.nix Outdated Show resolved Hide resolved
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 1, 2024
@lpzimmermann lpzimmermann deleted the fix/sweethome3d-darwin branch December 4, 2024 14:30
@lpzimmermann lpzimmermann restored the fix/sweethome3d-darwin branch December 4, 2024 14:31
@lpzimmermann lpzimmermann reopened this Dec 4, 2024
@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Dec 4, 2024
@lpzimmermann lpzimmermann force-pushed the fix/sweethome3d-darwin branch from 03b50c1 to 024a3d6 Compare December 4, 2024 14:34
@lpzimmermann lpzimmermann force-pushed the fix/sweethome3d-darwin branch from 024a3d6 to ea674d1 Compare December 4, 2024 14:39
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 4, 2024
@lpzimmermann lpzimmermann changed the title sweethome3d: support all java platforms sweethome3d: fix list of platforms and darwin build Dec 4, 2024
@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 8.has: clean-up 8.has: package (new) This PR adds a new package labels Dec 5, 2024
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Dec 5, 2024
@Scrumplex
Copy link
Member

Technically this package does not run on aarch64-darwin though. Obviously many people enable Rosetta on their systems, but this package is technically x86_64-darwin only.

You would still be able to use this package on aarch64-darwin by using pkgsCross.x86_64-darwin.sweethome3d.application.

@DimitarNestorov
Copy link
Member

@Scrumplex which package doesn't run on aarch64-darwin? I just tried it and it seems fine (no Rosetta installed, see terminal to the right)
image

@Scrumplex
Copy link
Member

That's interesting. I wonder what's up with the missing macOS aarch64 natives. Are they not needed at all?

@DimitarNestorov
Copy link
Member

DimitarNestorov commented Jan 21, 2025

All of the files in lib/macosx do not support aarch64 indeed. But I added a rm -rf lib/macosx in the post patch and the app built and ran just fine so I guess it is safe to assume they're not needed.

image

The binary they ship on their website does support aarch64:
image

But it also ships libgluegen and libjogl with aarch64 support in Contents/app

image

The upstream version definitely loads the libraries in runtime:
image

EDIT: to produce the binary similar to upstream we actually need to use ant macosxBundle. Will open a PR tomorrow.

@DimitarNestorov
Copy link
Member

Opened #375760 where I use ant macosxBundle in the darwin generation. This produces an app bundle containing libs supporting aarch64.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 8.has: clean-up 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants