ibnishak / Timimi

Webextension to save Tiddlywiki
https://ibnishak.github.io/Timimi/
GNU Affero General Public License v3.0
206 stars 23 forks source link

how to build on arm linux? #83

Closed monomycelium closed 1 year ago

monomycelium commented 2 years ago

i'm running arch linux on an m1 macbook air using the asahi kernel. when i execute the installer script for linux, i get this:

╭─mycelium@asahi:~ 
╰─🌘 $ ~/Downloads/timimi-2-1-1-Linux         
Verifying archive integrity...  100%   MD5 checksums are OK. All good.
Uncompressing   100%  
/home/mycelium/Downloads/timimi-2-1-1-Linux: line 653: ./installer: cannot execute binary file: Exec format error

i read that i can compile the installer for different architectures. but i have no clue how i can do that. i would appreciate it if there were some documentation on how i can do that easily. i've seen issues like #19 and #62, which were left on cliffhangers.

monomycelium commented 2 years ago

when i try running installer.go at /installer/unix in my fruitless attempt to recompile, i get this:

╭─mycelium@asahi:~/Documents/Timimi/installer/unix ‹master› 
╰─🌘 $ go run installer.go
Hello There
Starting Timimi Installation

✔ firefox
Created host directory
Created host manifest: /home/mycelium/.mozilla/native-messaging-hosts/timimi.json
Error in copying timimi executable to destination open timimi: no such file or directory

trying to save also gives an error:

error

monomycelium commented 2 years ago

i've tried compiling the installer.go at /installer/unix.

╭─mycelium@asahi:~/Documents/Timimi/installer/unix ‹master●› 
╰─🌘 $ go build installer.go 

this binary file is created:

binary

same error when executing:

╭─mycelium@asahi:~/Documents/Timimi/installer/unix ‹master●› 
╰─🌘 $ ./installer 
Hello There
Starting Timimi Installation

✔ firefox
Created host directory
Created host manifest: /home/mycelium/.mozilla/native-messaging-hosts/timimi.json
Error in copying timimi executable to destination open timimi: no such file or directory

do i like paste the binary contents to the shell script, timimi-2-1-1-Linux? i want answers!

monomycelium commented 1 year ago

Has there been any progress on setting Timimi up on aarch64 and other architectures? I'd really like this amazing software to work on my amazing (but not) hardware.

monomycelium commented 1 year ago

Solved in #25.


I think I've managed to build the Timimi host (not the add-on for Firefox)!

building

On an aarch64 Linux beast, I cloned this repository, built everything in the host directory, symlinked the timimi binary to the installer/unix directory, and build everything in that directory.

installing

Running ./timimiinstaller from the installer/unix, the program installed Timimi for me and now it seems to be working on Firefox.

commands

git clone https://github.com/ibnishak/Timimi # clone Timimi
cd Timimi/host
go build # build Timimi executable
cd ../installer/unix
go build # build installer
ln -sf ../../host/timimi ./
./timimiinstaller # install Timimi

conclusion

Timimi is amazing, and it can be built on any Unix machine as long as it can build Go. This is why I love open-source. Anyway, I'm sure there are many Timimi users out there who are forced to find an alternative because their computer's architecture does not support the Timimi binaries released. What if… we could ship this in AUR (the epic Arch User Repository) and GURU (like AUR, but for Gentoo)? I'm working on it right now, and I'd really appreciate your help.

Originally posted by @monomycelium in https://github.com/ibnishak/Timimi/issues/25#issuecomment-1278368435