Anybody tried to build on macOS?

Started by steve64, August 08, 2021, 22:14:09

Previous topic - Next topic

steve64

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?

chrisws

The configure script uses xxd to generate icon.h from sb-desktop-128x128.png

There was probably an error when you ran the script.

steve64

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]

chrisws

Quote from: steve64 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]

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.)

steve64

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?


chrisws

Quote from: steve64 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?

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).