Ooops
October 18, 2021, 23:54:33

Author Topic: Anybody tried to build on macOS?  (Read 852 times)

Offline steve64

  • Jr. Member
  • **
  • Posts: 17
Anybody tried to build on macOS?
« on: August 08, 2021, 22:14:09 »
I tried to build SmallBasic on macOS following the indications:

$ brew install sdl2
$ brew install freetype
$ brew link --overwrite freetype
$ brew install fontconfig
$ brew install autotools
$ brew install automake
$ brew install autoconf
$ git clone https://github.com/smallbasic/SmallBASIC.git
$ cd SmallBASIC
$ sh autogen.sh
$ ./configure --enable-sdl
$ make

Everything seemed to go well but at the last "make" step I got the following error:

syswm.cpp:83:10: fatal error: 'icon.h' file not found
#include "icon.h"
         ^~~~~~~~
1 error generated.

Any help?

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Anybody tried to build on macOS?
« Reply #1 on: August 10, 2021, 21:48:23 »
The configure script uses xxd to generate icon.h from sb-desktop-128x128.png

There was probably an error when you ran the script.

Offline steve64

  • Jr. Member
  • **
  • Posts: 17
Re: Anybody tried to build on macOS?
« Reply #2 on: August 11, 2021, 14:13:19 »
Now I have rebuilt the interpreter on macOS by manually executing:

xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h

However, at startup, I got an error:

% sbasicg
Unexpected window surface format 372645892
failed to load: [/Library/Fonts/Courier New.ttf] [/Library/Fonts/Courier New Bold.ttf]

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Anybody tried to build on macOS?
« Reply #3 on: August 12, 2021, 12:06:14 »
Now I have rebuilt the interpreter on macOS by manually executing:

xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h

However, at startup, I got an error:

% sbasicg
Unexpected window surface format 372645892
failed to load: [/Library/Fonts/Courier New.ttf] [/Library/Fonts/Courier New Bold.ttf]

You could try copying either of the following font file pairs in the startup directory:

- Envy Code R.ttf + Envy Code R Bold.ttf
- SourceCodePro-Regular.ttf + SourceCodePro-Bold.ttf

(or edit main.cpp with whatever fonts you have available.)

Offline steve64

  • Jr. Member
  • **
  • Posts: 17
Re: Anybody tried to build on macOS?
« Reply #4 on: August 15, 2021, 08:50:46 »
I have copied "Courier New.ttf" and related bold/italic files to the /Library/Fonts folder on my Mac.
Now basicg starts from a fresh terminal window:

% sbasicg
Unexpected window surface format 372645892
Opened: __main_bas__ 18920 bytes

I still see the "Unexpected window surface format" message, but maybe it is not critical.
After that, I tried to run some samples from the GUI list.
In the sbasicg UI I'm able to change theme, change font size, disable audio and enable the builtin editor.

For each sample script I load I always got a log like:

 * BREAK AT LINE 712 *
Opened: /Users/stefanoantoniazzi/SmallBASIC/samples/distro-examples/games/tetris.bas 6846 bytes

but usually the sample starts and run in graphic mode.

One main issue is that audio is not working, anybody knows how to configure SDL audio for MacOS?


Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Anybody tried to build on macOS?
« Reply #5 on: August 17, 2021, 08:21:11 »
I have copied "Courier New.ttf" and related bold/italic files to the /Library/Fonts folder on my Mac.
Now basicg starts from a fresh terminal window:

% sbasicg
Unexpected window surface format 372645892
Opened: __main_bas__ 18920 bytes

I still see the "Unexpected window surface format" message, but maybe it is not critical.
After that, I tried to run some samples from the GUI list.
In the sbasicg UI I'm able to change theme, change font size, disable audio and enable the builtin editor.

For each sample script I load I always got a log like:

 * BREAK AT LINE 712 *
Opened: /Users/stefanoantoniazzi/SmallBASIC/samples/distro-examples/games/tetris.bas 6846 bytes

but usually the sample starts and run in graphic mode.

One main issue is that audio is not working, anybody knows how to configure SDL audio for MacOS?

I didn't have any luck with SDL audio so I switched over to the miniaudio single header library

https://github.com/mackron/miniaudio

This allows the same code to be used in the FLTK version. Apparently OSX is supported, but I haven't tried it yet (I have an old imac).


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal