Hacker News new | ask | show | jobs
by mosselman 2232 days ago
Any instructions on how to run this on macos?
3 comments

Someone made a formula: https://github.com/lincerely/homebrew-tools

   brew install lincerely/tools/lite
Or

   brew tap lincerely/tools; brew install lite
on catalina os x; I just went

  git clone https://github.com/rxi/lite.git
  cd lite
  ./build.sh
  ./lite
and an app did start up, but the text gets cut off in the editor window, and I can't quit the app from the menu
The compiler might complain that it needs SDL.

Fixed this with:

  sudo apt install libsdl2-dev
on Ubuntu.

Else it works as tingletech described also using Mint/Ubuntu.

How do I install this on Mac? apt is not available in mac.

Update: I can install this using brew install sdl2 https://medium.com/@edkins.sarah/set-up-sdl2-on-your-mac-wit...

  brew install sdl2
it seems to compile/run fine for me on catalina but everything is absolutely huge (hidpi compatibility issues?)
Same here; font is huge on catalina. It seems like this is the culprit:

  static double get_scale(void) {
          float dpi;
        SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
  #if _WIN32
          return dpi / 96.0;
  #elif __APPLE__
          return dpi / 72.0;
  #else
          return 1.0;
  #endif
  }
I found changing it to dpi / 192.0 to be fairly comfortable. It wouldn't be too hard to add a scale option and change to `return (dpi * scale) / 192.0`. The "right way" is probably to do that but also get scale by checking the screen resolution; I'd go by height due to the increasing adoption of ultra-wide monitors:

  static double get_scale(void) {
          SDL_DisplayMode dm;
          SDL_GetDesktopDisplayMode(0, &dm);
          return dm.h * scale / 786.0;
  }
Edit: works on my win10 and arch boxes.
still, after changing the get_scale, fonts doesn't look like they are rendered in higher resolution.

There should be a separate feature to handle higher-resolution screens.

Anyway, it feels really easy to change anything in this editor.

Probably adding it to the dock works?
it creates a 348K "Mach-O 64-bit executable x86_64", but I'm not sure how I would add that to the dock. I tried to drag it there with finder, but it would not take it.
You need an App Bundle. This is normally handled by Xcode or your building script, but it's possible to do it manually.

To make App bundles you have to create the following directory structure:

    Lite.app
    \- Content
        \- MacOS
           \- Lite (that's the executable file)
Here's a script that automates all that: [1]

To add an icon you need a plist and a icns file [2].

I know it looks cumbersome, but it pays off when you need to bundle multiple files with your app.

-

[1] https://gist.github.com/mathiasbynens/674099

[2] https://stackoverflow.com/questions/1596945/building-osx-app...

same here, works on mac quite nice :) and it's super fast.

also fonts are a bit big on retina screen.

Nice project. Would be nice to change the key binding on mac to use the Command key instead of control. It is one of those habit and mental shift when using mac vs linux/windows.

Is there a config file where this can be changed?