Patitotective / ImThemes

Dear ImGui style browser and editor written in Nim
MIT License
348 stars 74 forks source link

macOS support #20

Closed araid closed 8 months ago

araid commented 1 year ago

I love the idea of this app and would like to use it on macOS. How hard would it be to add support for it?

I'm happy to try compiling but I've never worked with nim. I'd appreciate any links to guides or resources.

Patitotective commented 1 year ago

Hi. I've never used MacOS so I'm unsure how you create a MacOS app but I think that since MacOS is based in Linux, you could compile the app in your computer and it should work.

To compile ImThemes on your computer follow these steps:

  1. Open your terminal and copy curl https://nim-lang.org/choosenim/init.sh -sSf | sh, it will download choosenim, which is a Nim installer/version manager. More info at https://nim-lang.org/install_unix.html
  2. Don't forget to add ~/.nimble/bin to your PATH variable (so you can use commands like nimble or nim) in your terminal.
  3. Clone this repository. With git clone https://github.com/Patitotective/ImThemes.
  4. Then go to the directory of the clone and type nimble install -y, this will install all the Nim dependencies.
  5. Compile the application with nimble buildBin, and try running that file.
Patitotective commented 1 year ago

This seems useful if we want to have a prebuilt MacOS app https://forum.nim-lang.org/t/2652

bradparks commented 10 months ago

fyi, I tried this, but I get this error with either brew installed nim, or nim installed via process above ^^^

also, where are the themes stored? Can I find them on a website somewhere and browse them? Thanks!

This was from running $ ~/.nimble/bin/nimble install -y --verbose

image
Patitotective commented 10 months ago

@bradparks

  1. Try running it with the --deepcopy:on flag, this is the explanation I found:

If you use system.deepCopy in your code, you need to enable it via --deepCopy:on on the command line. This is a band-aid and a better solution for this will arrive in the future. The reason for this opt-in switch is that ARC and ORC do not use the old runtime type information (RTTI) that system.deepCopy is built upon. We’ve built ARC and ORC with embedded devices in mind where the overhead of the old RTTI has been reported to be unacceptable.

https://forum.nim-lang.org/t/9868#65096

  1. The themes are stored in the GitHub repository itself at https://github.com/Patitotective/ImThemes/blob/main/themes.toml, to browse them you can use ImThemes itself. If you mean where are the themes stored in your computer, they are stored using the getCacheDir procedure which says:

    On Windows: getEnv("LOCALAPPDATA") On macOS: getEnv("XDG_CACHE_HOME", getEnv("HOME") / "Library/Caches") On other platforms: getEnv("XDG_CACHE_HOME", getEnv("HOME") / ".cache")

bradparks commented 10 months ago

cool - tnanks - I tried it and get another error now - I will review the themes in that folder too though - much appreciated, and no pressure, lol!

image
Patitotective commented 10 months ago

Hmm, that's a weird error. Seems like imgui isn't being imported correctly or something of the sort, did you do nimble install nimgl? You can check looking for nimgl in the output of nimble list -i (or directly do nimble list -i | grep nimgl).

bradparks commented 10 months ago

it is installed

image

but I tried to install afterwards to see, and it said it was already there (same version)

image

no biggie - I can use the themes as is! much appreciated!

kasperhbo commented 8 months ago

It this maybe akready solved?

Patitotective commented 8 months ago

I guess I'll close it since it seems you can compile ImThemes without problems on MacOS.