Tcrisis4: CMake Error: The source directory "..." does not appear to contain CMakeLists.txt

Hello, I’m making a snap for a new game, but I am stuck on this build issue. Any idea pls ?

$ snapcraft --verbose
Starting snapcraft, version 8.4.1                                                                                                                      
Logging execution to '/home/me/.local/state/snapcraft/log/snapcraft-20241008-102012.025321.log'                                                   
Running on amd64 for amd64                                                                                                                             
Launching instance...                                                                                                                                  
Starting instance                                                                                                                                      
Creating instance from base instance                                                                                                                   
Starting instance                                                                                                                                      
Starting snapcraft, version 8.4.1                                                                                                                      
Logging execution to '/tmp/snapcraft.log'                                                                                                              
Running on amd64 for amd64                                                                                                                             
Initializing parts lifecycle                                                                                                                           
Installing build-packages                                                                                                                              
Installing build-snaps                                                                                                                                 
Pulling gnome/sdk                                                                                                                                      
Pulling tcrisis4                                                                                                                                       
Fetching stage-packages                                                                                                                                
Downloading package: libxcb-present0                                                                                                                   
Downloading package: libgomp1                                                                                                                          
Downloading package: libpulse0
...
Extracting stage package: libxi6                                                                                                                       
Extracting stage package: libxcb-xfixes0                                                                                                               
Building gnome/sdk                                                                                                                                     
:: + make -j12                                                                                                                                         
:: make: 'Makefile' is up to date.                                                                                                                     
:: + make -j12 install DESTDIR=/root/parts/gnome/sdk/install                                                                                           
:: install -D -m755 "hooks-configure-fonts" "/root/parts/gnome/sdk/install/snap/command-chain"/"hooks-configure-fonts"                                 
:: install -D -m755 "desktop-launch" "/root/parts/gnome/sdk/install/snap/command-chain"/"desktop-launch"                                               
:: install -D -m755 "run" "/root/parts/gnome/sdk/install/snap/command-chain"/"run"                                                                     
Building tcrisis4                                                                                                                                      
:: + cmake /root/parts/tcrisis4/src -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/usr                                                                    
:: CMake Error: The source directory "/root/parts/tcrisis4/src" does not appear to contain CMakeLists.txt.                                             
:: Specify --help for usage, or press the help button on the CMake GUI.                                                                                
Failed to run the build script for part 'tcrisis4'.                                                                                                    
Check the build output and verify the project can work with the 'cmake' plugin.                                                                        
Failed to execute pack in instance.                                                                                                                    
Recommended resolution: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

The snapcraft file is:


# Snap by Dadu042 07/10/2024
# https://jesseleepalser.itch.io/t-crisis-4-linux-windows-retail-2
# https://forum.snapcraft.io/t/mit-open-source-t-crisis-4-110-a-i-turbo-remix-snap-request/41651

name: tcrisis4
base: core22
version: '1.0'
summary: Tetris inspired.
description: |
 Playable by four players on the same computer.

grade: stable # devel/stable
confinement: strict # devmode/strict

architectures:
  - build-on: amd64
    
parts:
  tcrisis4:
    plugin: cmake
    cmake-parameters:
      - -DCMAKE_INSTALL_PREFIX=/usr
    source: https://github.com/JesseLeePalser/T-Crisis_4-Linux.git
    build-packages:
      - g++
      - gcc
      - make
      - cmake
      - pkg-config
      - git
      - zip
      - curl
      - liblua5.1-0-dev
      - libsdl2-dev
      - libsdl2-image-dev
      - libsdl2-mixer-dev
      - libsdl2-gfx-dev
      - libsdl2-ttf-dev
      - libncurses-dev
      - libopenal-dev
      - libogg-dev
      - libvorbis-dev 
      - libalut-dev
      - libfreetype6-dev
      - libpulse-dev
#      - libglut-dev
      - libglu1-mesa-dev
      - libgl1-mesa-dev
      - libglew2.2
#      - libqt5core5a
#      - libqt5gui5
#      - libqt5widgets5
      - libalut0
      - libjpeg9
      - libopenal1
      - libflac-dev
      - libflac++-dev
      - libopengl-dev
      - libglvnd-dev
      - texinfo
      - unzip
    stage-packages:
      - libsdl2-2.0-0
      - libsdl2-image-2.0-0
      - libsdl2-mixer-2.0-0
      - libsdl2-gfx-1.0-0
      - libsdl2-ttf-2.0-0
      - libopenal1
      - libogg0
      - libvorbis0a
      - libvorbisfile3
      - libalut0
      - libfreetype6
      - libpulse0
      - libpulse-mainloop-glib0
      - libgl1
      - libgl1-mesa-dri
      - libglu1-mesa
      - libopengl0
      - libglvnd0
      - libcairo2
#      - libpulse0_15.99.1
#      - libflac++10
#      - libflac12t64
#     - libglut3.12

apps:
  tcrisis4:
    environment:
#      LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/
      ALWAYS_USE_PULSEAUDIO: '1'
    command: usr/local/tc4ai
#    command: usr/bin/astromenace
    extensions: [ gnome ]
    plugs:
      - pulseaudio
#      - alsa
#      - audio-playback
#      - audio-record
      - desktop
      - desktop-legacy
#      - network
#      - network-bind
      - opengl
      - process-control
      - wayland
      - x11
#      - screen-inhibit-control

That project doesn’t look like a CMake project and has a very simple makefile. There’s not an install target, so the make plugin won’t work.

I would recommend using the nil plugin and an override-build along the lines of:

make
cp $CRAFT_PART_BUILD/tc4ai $CRAFT_PART_INSTALL
craftctl default

(it may need some adjusting)

Hi,

We are working on an update to the game now, please stand by. We will inform you here when it it ready. Thanks!

Jesse

2024-10-13 before 11:59PM EST

Screenshots: https://jesseleepalser.itch.io/t-crisis-4-r2

Game ready, you can download below:

https://jesseleepalser.itch.io/t-crisis-4-r2

Let me know if there are any problems…

Jesse

JesseLee, I don’t know how to make it compile.