-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
freej2me: init at 0-unstable-2024-02-16 #326677
base: master
Are you sure you want to change the base?
Conversation
# https://phoneky.com/games/?id=j3j89646
$ sha256sum ~/Downloads/splinter_cell_double_240x320_147976.jar
7454b5481f01ea470835e686df78ea142853ddf963d9444822cfac93c31cdfbf /home/kreyren/Downloads/splinter_cell_double_240x320_147976.jar
$ export file="~/Download/splinter_cell_double_240x320_147976.jar"
$ NIXPKGS_ALLOW_INSECURE=1 nix shell 'github:Sigmanificient/nixpkgs/J2ME#j2me' 'github:nixos/nixpkgs#pkgs.jdk' --impure --command java $(NIXPKGS_ALLOW_INSECURE=1 nix eval 'github:Sigmanificient/nixpkgs/J2ME#j2me.outPath' --impure --raw)/share/java/freej2me-sdl.jar "file://$file" 240 320
Error: Could not find or load main class .nix.store.65zhxs2zaix6jrcjm8x0dpv5wgs645sm-j2me-0-unstable-2024-02-16.share.java.freej2me-sdl.jar
Caused by: java.lang.ClassNotFoundException: /nix/store/65zhxs2zaix6jrcjm8x0dpv5wgs645sm-j2me-0-unstable-2024-02-16/share/java/freej2me-sdl/jar
$ ls /nix/store/65zhxs2zaix6jrcjm8x0dpv5wgs645sm-j2me-0-unstable-2024-02-16/share/java/
freej2me.jar freej2me-lr.jar freej2me-sdl.jar Doesn't seem to work on my end :( NixOS Config Reference: https://github.com/NiXium-org/NiXium/tree/db7f7af8a4c278f1e9f7d77c56c66e6b18419e6e/src/nixos/machines/sinnenfreude |
Could this be made to build on armv7l-linux? I would like to use it on Nokia N900 (NiXium-org/NiXium#119) @ofborg build pkgsCross.armv7l-hf-multiplatform.j2me NIXPKGS_ALLOW_INSECURE=1 nix build 'github:Sigmanificient/nixpkgs/J2ME#pkgsCross.armv7l-hf-multiplatform.j2me' --impure -v |
Try using file=$(realpath ~/Downloads/splinter_cell_double_240x320_147976.jar)
java -jar result/share/java/freej2me-sdl.jar "file://$file" 240 320 (added |
Same problem: $ export file="$(realpath ~/Downloads/splinter_cell_double_240x320_147976.jar)
$ NIXPKGS_ALLOW_INSECURE=1 nix shell 'github:Sigmanificient/nixpkgs/J2ME#freej2me' 'github:nixos/nixpkgs#pkgs.jdk' --impure --command java $(NIXPKGS_ALLOW_INSECURE=1 nix eval 'github:Sigmanificient/nixpkgs/J2ME#freej2me.outPath' --impure --raw)/share/java/freej2me-sdl.jar "file://$file" 240 320
Error: Could not find or load main class .nix.store.3qyg23lzkmc6j2509wz8ll4nqqflygf7-freej2me-0-unstable-2024-02-16.share.java.freej2me-sdl.jar
Caused by: java.lang.ClassNotFoundException: /nix/store/3qyg23lzkmc6j2509wz8ll4nqqflygf7-freej2me-0-unstable-2024-02-16/share/java/freej2me-sdl/jar
Unsure if that's the NixOS-way to handle this scenario, but it would be preferable if i could just do |
I added a small runner using |
The Game now works with the script tested using: $ NIXPKGS_ALLOW_INSECURE=1 nix shell 'github:Sigmanificient/nixpkgs/eccc7656d245800cb0b75bf95780549a30e62f13#freej2me' --impure --command $(NIXPKGS_ALLOW_INSECURE=1 nix eval 'github:Sigmanificient/nixpkgs/J2ME#freej2me.outPath' --impure --raw)/bin/freej2me freej2me-sdl "$file" 240 320 but it originally loaded in like 1x5 px window that i nearly misses and though that it's broken.. seems that the height and width is not parsed correctly |
The darwin build started 2 days ago and still didn't finish -> Probably adjust |
No need, it's just slow. And it'll get skipped anyway due to the insecure dep (freeimage). On that note, I don't think we should introduce this into nixpkgs. We're trying to get rid of dependency on freeimage, not add more. |
Would agree, but it seems to be the only option for J2ME gaming which i would like to use on my Nokia N900 so like ideally if we could give it the steam treatment or alike? |
Everything is now resolved 😅 |
Splitted the script into individuals script, using a generic function. |
@Sigmanificient How does this affect things in practice on NixOS? |
Dropped the SDL front-end, which was optional anyway. java and libretro implementation are remaining so it is still interesting to have it around, has it still has the core part of the project. |
Tested using: $ nix shell 'github:Sigmanificient/nixpkgs/d0a31fee2e0831fc243a2cfa09f1c73e351ac9ee#freej2me' --command $(nix eval 'github:Sigmanificient/nixpkgs/d0a31fee2e0831fc243a2cfa09f1c73e351ac9ee#freej2me.outPath' --raw)/bin/freej2me "$file" 240 320 Seems that all issues that i've highlighted were fixes as tested on Sinnenfreude (Presently a NixOS x86_64 system with configuration at https://github.com/NiXium-org/NiXium/tree/ec5a7e8b4f113de4cbd295221d6265e52454d629/src/nixos/machines/sinnenfreude) I know that the architecture of Nokia N900 is not officially supported, but ideally i would like to use this package there which still doesn't seem to work: $ nix shell --system armv7l-linux 'github:Sigmanificient/nixpkgs/d0a31fee2e0831fc243a2cfa09f1c73e351ac9ee#freej2me' --command $(nix eval 'github:Sigmanificient/nixpkgs/d0a31fee2e0831fc243a2cfa09f1c73e351ac9ee#freej2me.outPath' --raw)/bin/freej2me "$file" 240 320
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'freej2me-0-unstable-2024-02-16'
whose name attribute is located at /nix/store/v120g049zi5j2vmhrp90clwjz8khjnjl-source/pkgs/stdenv/generic/make-derivation.nix:334:7
… while evaluating attribute 'installPhase' of derivation 'freej2me-0-unstable-2024-02-16'
at /nix/store/v120g049zi5j2vmhrp90clwjz8khjnjl-source/pkgs/by-name/fr/freej2me/package.nix:47:3:
46|
47| installPhase = let
| ^
48| mk-script-bin = frondend: writeShellScriptBin frondend ''
(stack trace truncated; use '--show-trace' to show the full trace)
error: unsupported CPU armv7l As tested on mentioned x86_64 with binfmt set for @Sigmanificient is that something that you would like to address as well? Additional note: I can't currently test it on the bare hardware as i am still working on NiXium-org/NiXium#119 (waiting for a new battery to arrive which should be there soon and then deploying NixOS unsure about any roadblocks there) Alternatively i will be working on a new PCB for this device taking over some of the work of neo900 while forking probably OLIMEX or BeagleDev's design in case there is more suitable SoC for this usecase (riscv64?). EDIT: Also depends on #328952, but the device can also work on xfce which should enable testing |
I would love to help, but honestly not even sure how to get started, on making it work on such platform |
Looking on the NixOS Packages it seems that it might already have everything needed with the exception of #328952 to at least run on the device using xfce or i3wm like postmarketOS is currently doing and in a way that would build on the platform, but there seems to be an issue with Nix doesn't allowing to even evaluate the package for this platform atm with the Maybe we just need to adjust the CC @K900 @samueldr @ryan4yin (The NixOS On Arm Team), issue mentioned in their matrix room as well Sidenote: The SoC is Texas Instruments OMAP 3 an armv7 SoC with linux mainline support. |
Oh wow, that a lot of changes 😅 |
Small nitpicks + wrong error output, sorry if it's overwhelming 🙏 |
Doing $ nix shell --system armv7l-linux 'github:Sigmanificient/nixpkgs/3e24fd58c3931c5a9d673ce08f68dbb21c412056#freej2me' --command $(nix eval 'github:Sigmanificient/nixpkgs/3e24fd58c3931c5a9d673ce08f68dbb21c412056#freej2me.outPath' --raw)/bin/freej2me "$file" 240 320 |
4fa3847
to
b95b780
Compare
Otherwise the merge request is LGTM with the exception of it not building for the Nokia N900, maybe make that a separate merge request to not make this one too complicated? @alyssais @eclairevoyant opinion? |
As understood it seems that the issue is with openjdk21 not having the platform defined upstream, might work with openjdk19 or lower -> Check if it works with that and probably make a new merge request so that we can see what needs to be done and to request upstream to support that platform? |
freej2me: drop SDL frontend free2jme: refactor test set meta.platforms = all
Currently building: $ NIXPKGS_ALLOW_INSECURE=1 nix shell --impure --system armv7l-linux 'github:Sigmanificient/nixpkgs/fa05a68ae0e8bfffb84e16023c7a3827fc56fd41#freej2me' --command $(NIXPKGS_ALLOW_INSECURE=1 nix eval 'github:Sigmanificient/nixpkgs/fa05a68ae0e8bfffb84e16023c7a3827fc56fd41#freej2me.outPath' --impure --raw)/bin/freej2me "$file" 240 320 So far that openjdk19 seems to be building fine for armv7l-linux, i guess we can keep this for now and then handle the openjdk21 upstream to then bump this if it works? EDIT: That doesn't seem like a good idea considering that it's openjdk19 is EOL. I guess the modern version should be used until the upstream is adjusted. UPDATE(23rd Jul 24): Still building.. |
As calculated it seems like it would take at least 8 days to builds rn as i am reworking NiXium's compute server and other systems lack the system resources for binfmt, cross-compilation would probably take much less time i try to put together a quick system out of parts tomorrow to verify the build, but i think we can assume that it will build and rather request the openjdk21 upstream to support this platform or patch the support in? |
Referencing a discussion on the subject of caching armv7l platform in nix devel channel Apparently the strategy is that since a powerful enough armv7 system does not exist atm and the best we can get is something like banana pi m3 which is octa-core Cortex-A7 (i was given this system to get on my 3D printer, but it has lot of architecture induced issues that makes me not wanting to use it, but it might address this problem) the expected strategy is to adjust the packages to be cross-compiling and declare them into https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/release-cross.nix to cache them as cross-compiled cache with the included impurities from cross-compiling Alternative to use arm's compatibility mode was proposed unsure if it's able to provide us with a native armv7 platform for hydra to process, if so it would solve the issue in a way that doesn't obstruct hydra's current runtime abilities for the currently supported platforms. |
Description of changes
Fix:
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.