MovingBlocks/DestinationSol

Unable to run the Physics Body Editor, due to missing libraries

jozefcifre opened this issue · 4 comments

What you were trying to do

Sorry if this is not the right place to ask about this issue, but I couldn't find the repository, I could just find an archived repo. https://github.com/selimanac/physics-body-editor

I've been trying to run the jar file of this source: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/box2d-editor/physics-body-editor-2.9.2.zip

What actually happened

error: undefined variable 'libgdx'
error: undefined variable 'lwjgl'

AFAIK, these packages aren't available in the NixOS Channels.

Do you have any suggestions or know of an alternative way to install them?

How to reproduce

No response

Game version

2.1.0 (develop)

Log details

No response

Operating System

Linux

Additional Info

I switched to the nixos-unstable channel (a rolling release) because it has more available packages, but it seems that it's missing those libraries.

I've tried to run the jar file in a nix-shell, didn't work either.

# shell.nix

let
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable";
  pkgs = import nixpkgs { config = {}; overlays = []; };
in

pkgs.mkShell {
  packages = with pkgs; [
    temurin-bin-11
    glibc
    libgdx
    lwjgl
  ];

  LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.libglvnd}/lib:${pkgs.libpulseaudio}/lib";
}

This project does have a forked version of the Box2D editor but it is actually https://github.com/MovingBlocks/box2d-editor.

The binary jars have just worked for a long time, so the gradle build on that repository got a bit outdated. I've brought it up-to-date in the gradlew-libgdx-upgrade branch.

A new shell.nix that appears to work:

let
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.05";
  pkgs = import nixpkgs { config = {}; overlays = []; };
in

pkgs.mkShell {
  packages = with pkgs; [
    git
    temurin-bin-11
    libglvnd
    libpulseaudio
    xorg.libXcursor
    xorg.libXrandr
    xorg.libXxf86vm
  ];

  LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.libglvnd}/lib:${pkgs.libpulseaudio}/lib:${pkgs.xorg.libXcursor}/lib:${pkgs.xorg.libXrandr}/lib:${pkgs.xorg.libXxf86vm}/lib";
}

When in the nix shell environment, you should be able to run the editor like this:

  • git clone https://github.com/MovingBlocks/box2d-editor -b gradle-libgdx-upgrade
  • cd box2d-editor
  • ./gradlew :editor:run

As an advance warning, the editor is unable to edit existing ship json files (they use a modified JSON layout). Other than that, https://github.com/MovingBlocks/DestinationSol/wiki/Creating-Collision-Meshes is still relevant.

If you've found issues with the game (crashes, bugs, etc.) then raising an issue here is the right place. If you need more general help with troubleshooting then we share a Discord server with the Terasology project (join link) that can sometimes get a more realtime response (in the #destination-sol channel), if you find that easier.

Thank you for your help.

Btw, I've just found an issue with the box2d-editor: MovingBlocks/box2d-editor#48 (comment)