Danger from the deep (freeware submarine game)

https://sourceforge.net/projects/dangerdeep/ (32 bits, v0.4.0 last release in 2010).

I tried to make a snap, I’m stuck. Here is my stub:

name: dangerfromthedeep
base: core22
version: 0.4.0
summary:  German submarine 3d simulation, multilanguage support.
description: |
  SDL/OpenGL based WW2 german submarine 3d simulation, multilanguage support,
  multiplatform support with advanced sound and graphics.

grade: devel # 'devel' -> 'stable' to release into candidate/stable channels
confinement: devmode

parts:
  enable-i386:
    plugin: nil
    stage-packages:
      - libpython3.11-minimal:i386
# Core18:
#     prepare: |
# Core20:
    override-build: |
      dpkg --add-architecture i386
      apt-get update


  dangerfromthedeep:
    plugin: scons
# source: https://master.dl.sourceforge.net/project/dangerdeep/0.4.0_pre3327/dangerdeep-0.4.0_pre3327.tar.gz
    source: source/
    build-packages:
      - gcc
      - libncurses-dev
      - texinfo
      - scons
      - python3
      - python3-dev
      - libsdl1.2:i386

    stage-packages:
#      - libglu1-mesa
      - libglib2.0-0
      - libsdl1.2:i386

#    override-stage: |
#      snapcraftctl stage
#       cd source
#       scons install
#      chmod 777 dangerdeep    # If this line is removed, next line does crash Snapcraft 8.3.2.
#      chmod 777 -R .

apps:
  dangerfromthedeep:
    command: usr/bin/dangerdeep
    plugs:
      - audio-playback
      - desktop
      - desktop-legacy
      - opengl
      - pulseaudio
      - wayland
      - x11
#      - raw-usb
#      - hardware-observe

Hi ! @Dadu042.

Can you show the logs ?

Thanks ! :pray:

A second attempt under Ubuntu 18.04 64bits with core18, I think I made 80% of the snapcraft job, but the BINary does not build.

name: dangerfromthedeep
base: core18
version: 0.4.0
summary:  German submarine 3d simulation, multilanguage support.
description: |
  SDL/OpenGL based WW2 german submarine 3d simulation, multilanguage support,
  multiplatform support with advanced sound and graphics.

grade: devel # 'devel' -> 'stable' to release into candidate/stable channels
confinement: devmode

architectures:
  - build-on: [i386]
    run-on: [amd64, i386]

layout:
  /usr/share/X11/xkb:
    bind: $SNAP/usr/share/X11/xkb
  /etc/glvnd:
    bind: $SNAP/etc/glvnd
  /usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri:
    bind: $SNAP/graphics/dri
  /usr/share/glvnd:
    bind: $SNAP/graphics/glvnd
  /usr/share/libdrm:
    bind: $SNAP/graphics/libdrm
  /usr/share/drirc.d:
   bind: $SNAP/graphics/drirc.d


parts:
  dangerfromthedeep:
    plugin: scons
# source: https://master.dl.sourceforge.net/project/dangerdeep/0.4.0_pre3327/dangerdeep-0.4.0_pre3327.tar.gz
    source: source/
    build-packages:
      - gcc
      - libncurses5
      - texinfo
      - scons
      - python3
      - python3-dev
      - libsdl1.2-dev
      - libgl1
      - libgtk2.0-dev
      - freeglut3-dev
    override-build: |
#      snapcraftctl stage
#        sudo ln -s /lib/x86_64-linux-gnu/libpcre.so.3.13.3 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libpcre.so &&ln -s /lib/x86_64-linux-gnu/libslang.so.2.3.1 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libslang.so && ln -s /lib/x86_64-linux-gnu/libz.so.1.2.11 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libz.so

    stage-packages:
#      - libglu1-mesa
#      - libglib2.0-0
#      - libsdl1.2:i386
      - libsdl1.2-dev
      - freeglut3
      - libxi6

#    override-stage: |

apps:
  dangerfromthedeep:
    command: usr/bin/dangerdeep
    plugs:
      - audio-playback
      - desktop
      - desktop-legacy
      - opengl
      - pulseaudio
      - wayland
      - x11

Snapcraft log:

$ snapcraft --use-lxd --verbose
Starting Snapcraft 7.5.5                                                                                                                              
Logging execution to '/home/bobo/.local/state/snapcraft/log/snapcraft-20240818-153224.801646.log'                                                     
Launching a container.
Waiting for container to be ready
Waiting for network to be ready...
Skipping pull dangerfromthedeep (already ran)
Skipping build dangerfromthedeep (already ran)
Skipping stage dangerfromthedeep (already ran)
Skipping prime dangerfromthedeep (already ran)
Failed to generate snap metadata: The specified command 'usr/bin/dangerdeep' defined in the app 'dangerfromthedeep' does not exist.
Ensure that 'usr/bin/dangerdeep' is installed with the correct path.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

What if you used the organize clause at the part level ?

parts:
  dangerfromthedeep:
    plugin: scons
# source: https://master.dl.sourceforge.net/project/dangerdeep/0.4.0_pre3327/dangerdeep-0.4.0_pre3327.tar.gz
    source: source/
    build-packages:
      - gcc
      - libncurses5
      - texinfo
      - scons
      - python3
      - python3-dev
      - libsdl1.2-dev
      - libgl1
      - libgtk2.0-dev
      - freeglut3-dev

    organize:
        usr/bin/dangerdeep: usr/bin/dangerdeep # Make sure that the path(the first left executable) is correct

    override-build: |
#      snapcraftctl stage
#        sudo ln -s /lib/x86_64-linux-gnu/libpcre.so.3.13.3 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libpcre.so &&ln -s /lib/x86_64-linux-gnu/libslang.so.2.3.1 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libslang.so && ln -s /lib/x86_64-linux-gnu/libz.so.1.2.11 /root/parts/dangerfromthedeep/install/usr/lib/x86_64-linux-gnu/libz.so

    stage-packages:
#      - libglu1-mesa
#      - libglib2.0-0
#      - libsdl1.2:i386
      - libsdl1.2-dev
      - freeglut3
      - libxi6

#    override-stage: |

apps:
  dangerfromthedeep:
    command: usr/bin/dangerdeep
    plugs:
      - audio-playback
      - desktop
      - desktop-legacy
      - opengl
      - pulseaudio
      - wayland
      - x11

Baldeuniversel, I tried but it does not help.

@Dadu042, can I access to your code (share the link) to investigate ? :face_with_monocle:

Hi ! @Dadu042.

I received the link. Thanks.

I have a bug with this lib libsdl1.2:i386 (no longer available [Ubuntu 24.04]), so I replace it by libsdl2-2.0-0:i386.

@Dadu042 , I recommend you to use the url source instead of the local source.