I am trying to make a snap of citterding-beta14 from source code. When I patch and compile the program from the command line I can run it fine.
But when I create, install and run the snap, it runs fine as well, except that textures that are loaded from jpeg files are not rendered in the program. Strangely textures that are loaded from png files render fine. I have tried including just about everything I could think of in the LD_LIBRARY_PATH, and I have included everything I thought relevant in the stage-packages. But to no avail. If I convert the textures in the source tree from jpg to png files, and change the names accordingly in the .mtl files, all textures are rendered correctly. But there should be a way to create a working snap without having to script all this converting and patching from within the snapcraft.yaml
What am I missing?
name: critterding14-hans
base: core18
confinement: strict
grade: devel
version: beta14.0
summary: Evolving Artificial Life
description: Critterding is a "Petri dish" universe in 3D that demonstrates evolving artificial life. Critters start out with completely random brains and bodies, but will automatically start evolving into something with much better survival skills.
apps:
critterding:
command: usr/bin/critterding
environment:
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa-gl:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/xorg:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio/:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/caca:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/engines-1.1:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gio:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/glib-2.0:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/krb5:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt4:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt-default
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
DISABLE_WAYLAND: 1
plugs:
- home
- network
- opengl
- removable-media
- unity7
- x11
- wayland
- desktop
- desktop-legacy
parts:
patches:
source: patches/
plugin: dump
prime: [-*]
stage: [patchfile.patch]
desktop:
plugin: cmake
source: https://sourceforge.net/projects/critterding/files/critterding/sources/critterding-beta14.tar.bz2
configflags: [-DCMAKE_BUILD_TYPE=Debug, -DCMAKE_INSTALL_PREFIX=/usr]
build-environment:
- CFLAGS: "$CFLAGS -march=native -Ofast"
after: [patches]
override-build: |
cd $SNAPCRAFT_PART_SRC
patch -p1 < $SNAPCRAFT_STAGE/patchfile.patch
snapcraftctl build
build-packages:
- gcc
- bzip2
- libsdl1.2-dev
- libqt4-dev
- libqt4-opengl-dev
- libfreetype6-dev
- libboost-dev
- libboost-iostreams-dev
- libboost-filesystem-dev
- libboost-thread-dev
- libsdl-image1.2-dev
- freeglut3-dev
- libpng-dev
- libjpeg-dev
- zlib1g-dev
stage-packages:
- qt4-default
- libfreetype6
- bzip2
- libsdl1.2debian
- libsdl-image1.2
- libboost-atomic1.65.1
- libboost-chrono1.65.1
- libboost-date-time1.65.1
- libboost-filesystem1.65.1
- libboost-iostreams1.65.1
- libboost-locale1.65.1
- libboost-regex1.65.1
- libboost-serialization1.65.1
- libboost-system1.65.1
- libboost-thread1.65.1
- libgl1
- libglu1-mesa
- libglvnd0
- libglx0
- libgomp1
- libqt4-opengl
- libslang2
- freeglut3
- mesa-utils
- libgl1-mesa-dri
- mesa-va-drivers
- libpng16-16
- libpng-tools
- libcupsimage2
- libsdl2-2.0-0
- libjpeg8
- libgl1-mesa-glx
- libqt5opengl5
- libglapi-mesa
- libbullet2.87
- libbullet-extras2.87
- libglewmx1.13
- libglu1
- libtinyxml2-6
The patch file used in the snapcraft.yaml file (otherwise the program will not compile):
diff -ruN critterding-beta14/src/common/be_command_system.cpp critterding-beta14_P/src/common/be_command_system.cpp
--- critterding-beta14/src/common/be_command_system.cpp 2011-09-11 00:01:23.000000000 +0200
+++ critterding-beta14_P/src/common/be_command_system.cpp 2021-02-01 20:38:01.769455137 +0100
@@ -10,9 +10,9 @@
BeCommandSystem::BeCommandSystem()
{
Settings* const settings = Settings::Instance();
- registerStringCommand("settings_saveprofile", boost::bind(&Settings::saveProfile, settings, _1));
- registerStringCommand("settings_increase", boost::bind(&Settings::increaseCVar, settings, _1, 1));
- registerStringCommand("settings_decrease", boost::bind(&Settings::decreaseCVar, settings, _1, 1));
+ registerStringCommand("settings_saveprofile", boost::bind(&Settings::saveProfile, settings, boost::placeholders::_1));
+ registerStringCommand("settings_increase", boost::bind(&Settings::increaseCVar, settings, boost::placeholders::_1, 1));
+ registerStringCommand("settings_decrease", boost::bind(&Settings::decreaseCVar, settings, boost::placeholders::_1, 1));
}
void BeCommandSystem::registerVoidCommand(const std::string& name, FunctionVoid function)
diff -ruN critterding-beta14/src/scenes/critterding/evolution.cpp critterding-beta14_P/src/scenes/critterding/evolution.cpp
--- critterding-beta14/src/scenes/critterding/evolution.cpp 2013-09-28 00:33:54.000000000 +0200
+++ critterding-beta14_P/src/scenes/critterding/evolution.cpp 2021-02-01 20:42:22.558181137 +0100
@@ -148,7 +148,7 @@
// }
BeCommandSystem::Instance()->registerVoidCommand("quit", boost::bind(&Evolution::quit, this));
- BeCommandSystem::Instance()->registerIntCommand("cs_unregister", boost::bind(&Evolution::unregisterCritterVID, this, _1));
+ BeCommandSystem::Instance()->registerIntCommand("cs_unregister", boost::bind(&Evolution::unregisterCritterVID, this, boost::placeholders::_1));
BeCommandSystem::Instance()->registerVoidCommand("cs_clear", boost::bind(&Evolution::clear, this));
BeCommandSystem::Instance()->registerVoidCommand("decreaseenergy", boost::bind(&Evolution::decreaseenergy, this));
@@ -172,8 +172,8 @@
BeCommandSystem::Instance()->registerVoidCommand("camera_lookleft", boost::bind(&Evolution::camera_lookleft, this));
BeCommandSystem::Instance()->registerVoidCommand("camera_lookright", boost::bind(&Evolution::camera_lookright, this));
- BeCommandSystem::Instance()->registerFloatCommand("camera_lookleftright_mouse", boost::bind(&Evolution::camera_lookleftright_mouse, this, _1));
- BeCommandSystem::Instance()->registerFloatCommand("camera_lookupdown_mouse", boost::bind(&Evolution::camera_lookupdown_mouse, this, _1));
+ BeCommandSystem::Instance()->registerFloatCommand("camera_lookleftright_mouse", boost::bind(&Evolution::camera_lookleftright_mouse, this, boost::placeholders::_1));
+ BeCommandSystem::Instance()->registerFloatCommand("camera_lookupdown_mouse", boost::bind(&Evolution::camera_lookupdown_mouse, this, boost::placeholders::_1));
BeCommandSystem::Instance()->registerVoidCommand("camera_rollleft", boost::bind(&Evolution::camera_rollleft, this));
@@ -212,13 +212,13 @@
BeCommandSystem::Instance()->registerVoidCommand("cs_resetage", boost::bind(&WorldB::resetageSelectedCritter, world));
BeCommandSystem::Instance()->registerVoidCommand("cs_follow", boost::bind(&WorldB::followCritter, world));
- BeCommandSystem::Instance()->registerIntCommand("cs_select", boost::bind(&Evolution::gui_selectCritter, this, _1));
- BeCommandSystem::Instance()->registerIntCommand("cs_select_species", boost::bind(&Evolution::gui_selectSpecies, this, _1));
- BeCommandSystem::Instance()->registerStringCommand("gui_togglepanel", boost::bind(&Evolution::canvas_swapchild, this, _1));
+ BeCommandSystem::Instance()->registerIntCommand("cs_select", boost::bind(&Evolution::gui_selectCritter, this, boost::placeholders::_1));
+ BeCommandSystem::Instance()->registerIntCommand("cs_select_species", boost::bind(&Evolution::gui_selectSpecies, this, boost::placeholders::_1));
+ BeCommandSystem::Instance()->registerStringCommand("gui_togglepanel", boost::bind(&Evolution::canvas_swapchild, this, boost::placeholders::_1));
BeCommandSystem::Instance()->registerVoidCommand("gui_toggle", boost::bind(&Evolution::gui_swap, this));
- BeCommandSystem::Instance()->registerFloatCommand("movepickedbodyX", boost::bind(&Evolution::movePickedBodyX, this, _1));
- BeCommandSystem::Instance()->registerFloatCommand("movepickedbodyY", boost::bind(&Evolution::movePickedBodyY, this, _1));
+ BeCommandSystem::Instance()->registerFloatCommand("movepickedbodyX", boost::bind(&Evolution::movePickedBodyX, this, boost::placeholders::_1));
+ BeCommandSystem::Instance()->registerFloatCommand("movepickedbodyY", boost::bind(&Evolution::movePickedBodyY, this, boost::placeholders::_1));
/* BeCommandSystem::Instance()->registerVoidCommand("canvas_press", boost::bind(&Evolution::canvas_press, this));
BeCommandSystem::Instance()->registerVoidCommand("canvas_release", boost::bind(&Evolution::canvas_release, this));
BeCommandSystem::Instance()->registerVoidCommand("canvas_pressAlt", boost::bind(&Evolution::canvas_pressAlt, this));