Aanok / jftui

Jellyfin Terminal User Interface
The Unlicense
149 stars 7 forks source link

macOS build notes #6

Open t56k opened 4 years ago

t56k commented 4 years ago

Anyone got a build working on macOS?

Aanok commented 4 years ago

I've never done development for macOS, so quite frankly I don't even know what it is you're supposed to do to make jftui compile and work there. I also don't own a mac and don't plan to, so I don't have anything to use for the purpose.

I understand it should work as a very special flavor of BSD and I've been avoiding to rely on specific Linux behavior so far and stuck to POSIX. So it should be possible, in theory.

You'll definitely need to patch the sources. I think everything about default folders and env variables needs touching, to start with. But there may be subtle things I don't know about, like some macro constants being undefined. The Makefile may need work too.

Mind that I would not be open to integrating a PR for it either, unless I got some guarantees that the onus of supporting a macOS build in the future would be taken up by somebody reliable. That's not something I'm doing myself.

LaurentFough commented 4 years ago

I've been using this on Arch for a bit. (great work @Aanok)

Decided to see if I could get it compiled on macOS.


@cd-rum I have a fork here: github::LaurentFough/jftui

  1. added: the libmpv files from https://github.com/mpv-player/mpv/tree/master/libmpv
  2. updated: Makefie
  3. updated: src/main.c - point to libmpv
  4. updated: src/shared.h - point to libmpv

The [only] build errors so far:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [build/jftui] Error 1
[1]    41395 exit 2     make

Need to spend some time tracking it down. I've only just cloned and started today, so let's see what we can get done.

LaurentFough commented 2 years ago

This branch (https://github.com/LaurentFough/jftui/tree/macOS-M1) compiles on an M1 Mac.

Aanok commented 2 years ago

@LaurentFough that's awesome! I'll have a close look during the holidays to see what it took. If it turns out to be simple enough, I might just integrate the changes here, though no promises about that. At the very least your repo's getting a link from the readme/front page :)

LaurentFough commented 2 years ago

@Aanok Thanks.

I'm also tracking down a small bug. Seems small from what I can deduce, maybe a macOS encoding issue or some small vagary between mpv edl on linux vs macOS.

If compile a debug version(jftui_debug): I get a loadfile url similar to:

Which does not play. No errors, mpv reports the correct media data, etc. —

If I then just execute, (in my default shell).

then playback starts as expected.