taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.17k stars 59 forks source link

Make program installable and independent of user's working directory #66

Closed vrza closed 2 years ago

vrza commented 2 years ago

Currently program doesn't start if not invoked from the code repo directory:

$ pwd
/
$ /tmp/123elf/123 -f unix -w "/tmp/123/root/lotus/123.v10/smpfiles/income.wk3"
123: can't access directory </proc/self/cwd/root/lotus/123.v10>, errno = 13
123: impossible d'acceder au repertoire </proc/self/cwd/root/lotus/123.v10>, erreur = 13

We should have a make install script that will, roughly:

taviso commented 2 years ago

I think this works a little bit better now, but there might be an old ~/.l123set file? If you delete it should be able to work from other directories.

But your other point stands, there needs to be an install target (and ideally a deb and rpm). There is a proposal in #20.

(Note: you can now just run 123 foo.wk3 and it should figure out what you mean -- I just added this yesterday)

vrza commented 2 years ago

If I delete ~/.l123set then it works when invoked from the repo dir (presumably because it finds runtime files relative to the directory where executable invoked resides in).

However, if I run a copy from /usr/local/bin then it tells me that I need to run setup123 (presumably to generate ~/.l123set that will tell it where to find runtime files).

Perhaps finding runtime files could go through a list of candidates, e.g.

vrza commented 2 years ago

This approach would be cleaner than having to use a workaround shell script, such as run.sh that was proposed in #20, that basically changes the working directory before executing the program.

wanfuse123 commented 2 years ago

thanks for all the hard work, cant wait for it to be portable. I wanted to run it in a web browser...

wanfuse123 commented 2 years ago

any plans to port it to web assembly by chance?

taviso commented 2 years ago

It might be possible in future, but I'm mostly interested in using it in a terminal so making that work well is the priority right now!

wanfuse123 commented 2 years ago

I am pretty sure I can easily get it running in a web browser for you if this issue is fixed, not really al that interested in lotus123 but I thought it would be real cool to try, problem is the overhead of getting enough to actually compile and run it in the browser slows the whole thing way down

vrza commented 2 years ago

@wanfuse123 keep in mind that this project is using, as its core, original compiled SysV Unix 80386 machine code, and we don't have the original C sources, so porting options are limited to architectures that can execute 80386 instructions.

I'm not an expert on wasm but I'm not aware of any tools that can convert x86 machine code to wasm "machine" code -- apart from running an x86 emulator in the browser.

wanfuse123 commented 2 years ago

that's what I was going to do run a very tiny virtual machine on an emulator, but I did not realize that you did not have the source code for Lotus123 somewhere. that is unfortunate. Perhaps you might be able to get the original makes of it to provide that source code and make it open source. It would be nice, but that hardly ever happens. Of course then your job would have probably been a lot easier. Anyway, thank you very much for your time.