afwbkbc / glsmac

Unofficial open-source OpenGL/SDL2 reimplementation of Sid Meier's Alpha Centauri ( + Alien Crossfire )
GNU Affero General Public License v3.0
425 stars 12 forks source link

Cannot find GLSMAC_data folder #34

Closed hartmark closed 4 months ago

hartmark commented 4 months ago

I'm trying to make an aur package for glsmac.

Where should I place GLSMAC_data folder so it can find it? As it seems now I need to stand in the folder having that directory.

One way would to have them in the folder used by --prefix

Another neat thing would be to have a setting stored in a file in --prefix for misc settings like fullscreen, fps, and the smacfolder so I could just start the application by issuing "glsmac" without any arguments.

[New Thread 0x7fffeb3ff6c0 (LWP 59378)]
[New Thread 0x7fffc6e006c0 (LWP 59379)]
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unhandled exception (GSELoaderError): Could not find script for include 'GLSMAC_data/default/main'
    at :0: 

Thread 2 "glsmac" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffed0006c0 (LWP 59340)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /usr/src/debug/glibc/glibc/nptl/pthread_kill.c
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;                                                                                                                                                                                     
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff75bdeb3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007ffff7565a30 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff754d4c3 in __GI_abort () at abort.c:79
#4  0x00007ffff7897b0c in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#5  0x00007ffff78adf1a in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x00007ffff789750a in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#7  0x00007ffff78ae1d6 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x55555595ab40 <typeinfo for std::runtime_error>, dest=0x7ffff78c4c10 <std::runtime_error::~runtime_error()>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#8  0x00005555555c1cf9 in ?? ()
#9  0x000055555582e29a in ?? ()
#10 0x000055555584b135 in ?? ()
#11 0x00005555557d90d5 in ?? ()
#12 0x000055555580b037 in ?? ()
#13 0x00005555556131ba in ?? ()
#14 0x00007ffff78e0c84 in std::execute_native_thread_routine (__p=0x555555996940) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#15 0x00007ffff75bbded in start_thread (arg=<optimized out>) at pthread_create.c:447
#16 0x00007ffff763f0dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
hartmark commented 4 months ago

Nevermind, I solved it by installing the binary and GLSMAC_data under /usr/share/glsmac and add a bootstrap shell script that cd to that directory.

The AUR-package can be found now under: https://aur.archlinux.org/packages/glsmac-git

afwbkbc commented 4 months ago

Thanks, I'll add --prefix too just for convenience

afwbkbc commented 4 months ago

--prefix already exists and means something else (place to store user data such as account)

Added --datapath which points to GLSMAC_data, for example: ~/dev/glsmac/bin/GLSMAC --smacpath ~/games/smac --datapath ~/dev/glsmac/GLSMAC_data (defaults to [working_dir]/GLSMAC_data)

hartmark commented 4 months ago

Cool, thanks for quick fix. Could we please have a default also for --smacpath preferably /home/markus/.local/share/glsmac/smac-data or something. That way I can make a symlink from that folder to the real destination so I just cann start by running "glsmac"

afwbkbc commented 4 months ago

I don't see how, --smacpath must point to installation of SMAC on user's computer, and there can be different SMAC distributions (Loki, GOG, Planetary Pack) and different ways to install (for example somebody can unpack loki version tar.gz somewhere and that's it). Also, different OS (Linux, Windows, ...). We don't want to force user to install or move their SMAC installation to specific place. What I can do in future is maybe add UI prompt that will ask for SMAC location on first launch, and then save it somewhere inside --prefix

hartmark commented 4 months ago

Yeah, that would be a better solution, we should have a settings file if fullscreen is used and other tweakables.