Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SDL Ada package fails to compile on Mac, gnat 13.1, missing "SDL2_ttf/SDL_ttf.h"

201 views
Skip to first unread message

Kenneth Wolcott

unread,
Jun 28, 2023, 2:39:00 PM6/28/23
to
Hi;

Trying to build SDL Ada on a Mac Mini with M1 chip, running Ventura 13.4.1...

sudo make DESTDIR=/opt/ext_ada_lib/sdlada SDL_PLATFORM=macosx SDL_MODE=release
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macosx \
-Psdlada.gpr
Compile
[C] version_ttf.c
[redacted]/Ada/from_GitHub/sdlada-master/src/ttf/version_ttf.c:27:18: fatal error: SDL2_ttf/SDL_ttf.h: No such file or directory
27 | #include <SDL2_ttf/SDL_ttf.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
gprbuild: *** compilation phase failed
make: *** [lib/libadasdl.a] Error 4

Thanks,
Ken Wolcott

Luke A. Guest

unread,
Jun 28, 2023, 5:14:00 PM6/28/23
to
Have you installed sdl ttf with brew? I cannot confirm this all works
without brew.

Kenneth Wolcott

unread,
Jun 28, 2023, 5:18:36 PM6/28/23
to
Hi Luke;

I heavily use MacPorts. I keep hearing that it is a very bad idea to have MacPorts and HomeBrew concurrently installed on the same machine. Is it at all possible to do this without HomeBrew? Apparently I did not read your documentation carefully enough...I thought that having SDL installed via HomeBrew was optional, not required.

Thanks,
Ken

Kenneth Wolcott

unread,
Jun 28, 2023, 5:53:12 PM6/28/23
to
Since I'm not using ALIRE (ALR), but using gnatmake (I'm on a Mac mini with an M1 chip, ALR refuses to get most packages because I don't have a native Ada compiler), I thought that the HomeBrew mention was in regards to using the SDLAda package via ALIRE.

So that's a different problem requiring a different post :-)

Thanks,
Ken

Luke A. Guest

unread,
Jun 28, 2023, 6:45:41 PM6/28/23
to
On 28/06/2023 22:53, Kenneth Wolcott wrote:

>> I heavily use MacPorts. I keep hearing that it is a very bad idea to have MacPorts and HomeBrew concurrently installed on the same machine. Is it at all possible to do this without HomeBrew? Apparently I did not read your documentation carefully enough...I thought that having SDL installed via HomeBrew was optional, not required.

I didn't get it working on Mac myself, I originally started to get it
going using the downloadable binaries you can just drag n drop.

Others got it working with brew, afaik.


> Since I'm not using ALIRE (ALR), but using gnatmake (I'm on a Mac mini with an M1 chip, ALR refuses to get most packages because I don't have a native Ada compiler), I thought that the HomeBrew mention was in regards to using the SDLAda package via ALIRE.
>
> So that's a different problem requiring a different post :-)

You're probably better off using git to grab it, then modify the
makefile and gpr's for a specific macos macports port, add a new
Platform_Type, macosx_macports and add what you need inside the sdlada.gpr.

Then you can call make SDL_PLATFORM=macosx_macports SDL_MODE=release to
build it.

Check whatever sdl2-config --cflags produces on that port.

If the headers are in different directories, you'll need to modify the
version*.c files with extra #ifdef's for macports.

Kenneth Wolcott

unread,
Jun 28, 2023, 8:17:43 PM6/28/23
to
Hi Luke;

Thank you for more information.

This looks a little bit deeper than I feel comfortable :-(

I'll think about this a bit more and experiment further, but this is definitely in uncharted territory for me.

Thanks,
Ken

Luke A. Guest

unread,
Jun 29, 2023, 5:50:19 AM6/29/23
to
On 29/06/2023 01:17, Kenneth Wolcott wrote:
> Hi Luke;
>
> Thank you for more information.
>
> This looks a little bit deeper than I feel comfortable :-(
>
> I'll think about this a bit more and experiment further, but this is definitely in uncharted territory for me.
>

It';s really not, you need to run sdl2-config --cflags and --libs to get
the set of flags, do that and report back here with the results.


Simon Wright

unread,
Jun 29, 2023, 7:33:49 AM6/29/23
to
Kenneth Wolcott <kenneth...@gmail.com> writes:

> I heavily use MacPorts. I keep hearing that it is a very bad idea to
> have MacPorts and HomeBrew concurrently installed on the same machine.
> Is it at all possible to do this without HomeBrew? Apparently I did
> not read your documentation carefully enough...I thought that having
> SDL installed via HomeBrew was optional, not required.

It's quite tricky to get the C includes and library directories working;
using Homebrew doesn't make it any easier, and the fact that the Mac
compilers (both the ones I've provided and the ones you get via Alire)
don't look in /usr/local by default doesn't help.

Having the external SDL2/SDL2_images/SDL22_ttf installed via Homebrew
isn't mandatory, but they do have to be installed! I expect that
MacPorts can do this.

With HomeBrew, installed packages are(almost always) under
$HOMEBREW_PREFIX, and I've defined these environment variables globally:

export C_INCLUDE_PATH=$HOMEBREW_PREFIX/include
export LIBRARY_PATH=$HOMEBREW_PREFIX/lib

I'd be surprised if MacPorts doesn't do similar
(e.g. MACPORTS_PREFIX=/opt/local ??).

Simon Wright

unread,
Jun 29, 2023, 9:12:54 AM6/29/23
to
Kenneth Wolcott <kenneth...@gmail.com> writes:

> Since I'm [...] using gnatmake

I don't understand why you'd want to use gnatmake? Most people who
provide packaged libraries (e.g. sdlada) include a GPR file which saves
you a raft of pain if you use it. OK, you have to learn something about
gprbuild, but then you have to learn how to drive gnatmake (e.g. the
previous discussion about -I). Also, sdlada includes 3 C source files,
and so far as I know gnatmake doesn't know how to build C files, whereas
gprbuild does and build/gnat/sdlada.gpr drives the needed compilations.

> I'm on a Mac mini
> with an M1 chip, ALR refuses to get most packages because I don't have
> a native Ada compiler

Can you give us an example of a package that alr refuses to get?

Luke A. Guest

unread,
Jun 29, 2023, 9:39:40 AM6/29/23
to
On 29/06/2023 14:12, Simon Wright wrote:
> Kenneth Wolcott <kenneth...@gmail.com> writes:
>
>> Since I'm [...] using gnatmake
>
> I don't understand why you'd want to use gnatmake? Most people who
> provide packaged libraries (e.g. sdlada) include a GPR file which saves
> you a raft of pain if you use it. OK, you have to learn something about
> gprbuild, but then you have to learn how to drive gnatmake (e.g. the
> previous discussion about -I). Also, sdlada includes 3 C source files,
> and so far as I know gnatmake doesn't know how to build C files, whereas
> gprbuild does and build/gnat/sdlada.gpr drives the needed compilations.

Yeah, unfortunately I cannot remove the C files as they turn C macros
into variables and are useful at runtime, see the sdlada repo for
someone who wants to get rid of them.

Simon Wright

unread,
Jun 29, 2023, 12:06:56 PM6/29/23
to
"Luke A. Guest" <lag...@archeia.com> writes:

> Yeah, unfortunately I cannot remove the C files as they turn C macros
> into variables and are useful at runtime, see the sdlada repo for
> someone who wants to get rid of them.

I had exactly this in tcladashell; even better, a Tcl script to generate
a C source, compiled against the Tcl/Tk libraries and run to generate
Ada source specifying record sizes/alignments.

Kenneth Wolcott

unread,
Jun 29, 2023, 1:34:05 PM6/29/23
to
On Thursday, June 29, 2023 at 9:06:56 AM UTC-7, Simon Wright wrote:
Hi Luke & Simon;

Let's see if I can properly address all of the wonderful responses in a summarized fashion.

1. I'm using gnatmake versus gprbuild because I just haven't gotten used to it yet, not avoiding it specifically. Of course it looks like it makes things easier...

2. I stopped using Alire because I wanted a native gnat compiler and Alire didn't provide one and now that I installed and am using Simon's (again, thank you) build, Alire refuses to "get" some interesting packages. I'll respond later with some specific examples. Perhaps I have Alire improperly installed or configured...

3. I have installed libsdl2 via MacPorts:
port list | grep sdl2
libsdl2_mixer @2.6.3 audio/libsdl2_mixer
libsdl2 @2.28.0 devel/libsdl2
libsdl2-snowleopard @2.0.22 devel/libsdl2-snowleopard
libsdl2_gfx @1.0.4 devel/libsdl2_gfx
libsdl2_image @2.6.3 devel/libsdl2_image
libsdl2_net @2.2.0 devel/libsdl2_net
libsdl2_ttf @2.20.2 devel/libsdl2_ttf

4. Examples of Alire's "get" failure:
alr --no-color search --crates sdl
labs_solar_system A set of SDL-based exercises to learn Ada
libsdl2 Simple DirectMedia Layer development files
libsdl2_image Simple DirectMedia Layer development files - Image
libsdl2_ttf Simple DirectMedia Layer development files - TTF
pygamer_simulator SDL simulator of the AdaFruit PyGamer console
sdlada Ada 2012 SDL 2.x bindings.

alr --no-color get sdlada
Warning:
Warning: New solution is incomplete.
Warning: +~ libsdl2 ^2.0.0 (new,external)
Warning: +~ libsdl2_image ^2.0.0 (new,external)
Warning: +~ libsdl2_ttf ^2.0.0 (new,external)
Warning: + make 3.81.0 (new)
Warning:
Warning: Could not find a complete solution for sdlada=2.5.5
Build will fail unless externals are made available, do you want to continue?
[Y] Yes [N] No (default is No) n
ERROR: Crate retrieval abandoned.

alr --no-color get libsdl2_ttf
ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution

alr --no-color get libsdl2
ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution

Thanks,
Ken

Luke A. Guest

unread,
Jun 29, 2023, 3:29:10 PM6/29/23
to
I bet you never had someone try to remove the C file though.

Luke A. Guest

unread,
Jun 29, 2023, 3:35:08 PM6/29/23
to
On 29/06/2023 18:34, Kenneth Wolcott wrote:

> 1. I'm using gnatmake versus gprbuild because I just haven't gotten used to it yet, not avoiding it specifically. Of course it looks like it makes things easier...

gnatmake cannot handle project files anymore, it is for building single
applications, e.g. gnatmake my_app.adb, nothing more. You need to use
gprbuild with sdlada.

> 3. I have installed libsdl2 via MacPorts:
> port list | grep sdl2
> libsdl2_mixer @2.6.3 audio/libsdl2_mixer
> libsdl2 @2.28.0 devel/libsdl2
> libsdl2-snowleopard @2.0.22 devel/libsdl2-snowleopard
> libsdl2_gfx @1.0.4 devel/libsdl2_gfx
> libsdl2_image @2.6.3 devel/libsdl2_image
> libsdl2_net @2.2.0 devel/libsdl2_net
> libsdl2_ttf @2.20.2 devel/libsdl2_ttf

Right, so the other SDL libs usually install to the same place SDL is,
so what are the locations? Run these commands and tell me the results:

$ sdl2-config --cflags
$ sdl2-config --libs


> 4. Examples of Alire's "get" failure:

Forget about alire for now, I can update the main repo and you can grab
the source from there and use GPR_PROJECT_PATH=<path to
sdlada>/build/gnat:$GPR_PROJECT_PATH to build.

> alr --no-color get libsdl2_ttf
> ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution
>
> alr --no-color get libsdl2
> ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution

They're probably missing from the mac m1 specific index.


Simon Wright

unread,
Jun 29, 2023, 5:22:30 PM6/29/23
to
Kenneth Wolcott <kenneth...@gmail.com> writes:

> 2. I stopped using Alire because I wanted a native gnat compiler and
> Alire didn't provide one and now that I installed and am using Simon's
> (again, thank you) build, Alire refuses to "get" some interesting
> packages. I'll respond later with some specific examples. Perhaps I
> have Alire improperly installed or configured...

I wrote up something about this[1].

Alire will download and install external packages (e.g. SDL2) if it
knows how to use the host system's package manager. The "nightly"
builds[2] for macOS know how to install via Homebrew, provided that the
external manifest has been updated[3].

If someone wants to upgrade Alire to use MacPorts, I'm sure that would
be welcomed.

Adding aarch64 compilers to the mix makes things somewhat more
complicated.

Does MacPorts provide aarch64 (aka arm64) binary libraries? the object
code and libraries that are linked to produce an executable must be
consistent, all x86_64 or all aarch64.

[1]
https://forward-in-code.blogspot.com/2023/06/alire-on-macos-revisited.html
[2] https://github.com/alire-project/alire/releases
[3] https://github.com/alire-project/alire-index/pull/832

Kenneth Wolcott

unread,
Jun 29, 2023, 6:04:20 PM6/29/23
to
On Thursday, June 29, 2023 at 12:35:08 PM UTC-7, Luke A. Guest wrote:
> On 29/06/2023 18:34, Kenneth Wolcott wrote:
>
> > 1. I'm using gnatmake versus gprbuild because I just haven't gotten used to it yet, not avoiding it specifically. Of course it looks like it makes things easier...
> gnatmake cannot handle project files anymore, it is for building single
> applications, e.g. gnatmake my_app.adb, nothing more. You need to use
> gprbuild with sdlada.
> > 3. I have installed libsdl2 via MacPorts:
> > port list | grep sdl2
> > libsdl2_mixer @2.6.3 audio/libsdl2_mixer
> > libsdl2 @2.28.0 devel/libsdl2
> > libsdl2-snowleopard @2.0.22 devel/libsdl2-snowleopard
> > libsdl2_gfx @1.0.4 devel/libsdl2_gfx
> > libsdl2_image @2.6.3 devel/libsdl2_image
> > libsdl2_net @2.2.0 devel/libsdl2_net
> > libsdl2_ttf @2.20.2 devel/libsdl2_ttf
> Right, so the other SDL libs usually install to the same place SDL is,
> so what are the locations? Run these commands and tell me the results:

Actually, me the dummy, provided for you all what MacPorts has, not what I have :-)

This is what I have installed via MacPorts:
port installed | grep sdl
libsdl2 @2.24.2_0
libsdl2 @2.26.1_0
libsdl2 @2.26.2_0
libsdl2 @2.26.3_0
libsdl2 @2.26.4_0
libsdl2 @2.26.5_0
libsdl2 @2.28.0_0 (active)

> $ sdl2-config --cflags
> $ sdl2-config --libs

sdl2-config --cflags
-I/opt/local/include/SDL2 -D_THREAD_SAFE

sdl2-config --libs
-L/opt/local/lib -lSDL2

> > 4. Examples of Alire's "get" failure:
> Forget about alire for now, I can update the main repo and you can grab
> the source from there and use GPR_PROJECT_PATH=<path to
> sdlada>/build/gnat:$GPR_PROJECT_PATH to build.

Ok, cool.

> > alr --no-color get libsdl2_ttf
> > ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution
> >
> > alr --no-color get libsdl2
> > ERROR: No source release indexed for the requested crate, and cannot use system packages in unknown distribution
> They're probably missing from the mac m1 specific index.

Well, that would probably explain the problem :-)

Thanks,
Ken

Kenneth Wolcott

unread,
Jun 29, 2023, 6:12:59 PM6/29/23
to
On Thursday, June 29, 2023 at 2:22:30 PM UTC-7, Simon Wright wrote:
> Kenneth Wolcott writes:
>
> > 2. I stopped using Alire because I wanted a native gnat compiler and
> > Alire didn't provide one and now that I installed and am using Simon's
> > (again, thank you) build, Alire refuses to "get" some interesting
> > packages. I'll respond later with some specific examples. Perhaps I
> > have Alire improperly installed or configured...
> I wrote up something about this[1].
>
> Alire will download and install external packages (e.g. SDL2) if it
> knows how to use the host system's package manager. The "nightly"
> builds[2] for macOS know how to install via Homebrew, provided that the
> external manifest has been updated[3].
>
> If someone wants to upgrade Alire to use MacPorts, I'm sure that would
> be welcomed.
>
> Adding aarch64 compilers to the mix makes things somewhat more
> complicated.
>
> Does MacPorts provide aarch64 (aka arm64) binary libraries? the object
> code and libraries that are linked to produce an executable must be
> consistent, all x86_64 or all aarch64.

I have no configured MacPorts to not accept any binaries that aren't aarch64
and I do almost all of my upgrade+updates using the source flag so that I build from source. There's only one issue that I've experienced after making that change:

port outdated
sbcl-bootstrap 2.1.2_0 < 2.2.9_0

The following are two lines from the failed upgrade to MacPorts, but they don't really adversely affect me because I have a prior version (I don't recall what I have that requires this package :-) )

Error: Cannot install qt4-mac for the arch 'x86_64' because
Error: its dependency dbus does not build for the required arch by default

port installed | grep sbcl-bootstrap
sbcl-bootstrap @2.1.2_0 (active)
I'll take a look at those references...

Thanks,
Ken

Luke A. Guest

unread,
Jun 30, 2023, 4:04:34 AM6/30/23
to
On 29/06/2023 23:04, Kenneth Wolcott wrote:

>> $ sdl2-config --cflags
>> $ sdl2-config --libs
>
> sdl2-config --cflags
> -I/opt/local/include/SDL2 -D_THREAD_SAFE

That's odd. Can you show me the output of this?

$ ls /opt/local/include/SDL2

>
> sdl2-config --libs
> -L/opt/local/lib -lSDL2

Kenneth Wolcott

unread,
Jun 30, 2023, 11:41:03 AM6/30/23
to
On Friday, June 30, 2023 at 1:04:34 AM UTC-7, Luke A. Guest wrote:
> On 29/06/2023 23:04, Kenneth Wolcott wrote:
>
> >> $ sdl2-config --cflags
> >> $ sdl2-config --libs
> >
> > sdl2-config --cflags
> > -I/opt/local/include/SDL2 -D_THREAD_SAFE
> That's odd. Can you show me the output of this?
>
> $ ls /opt/local/include/SDL2

ls /opt/local/include/SDL2

SDL.h SDL_joystick.h SDL_opengles2_khrplatform.h SDL_test_crc32.h
SDL_assert.h SDL_keyboard.h SDL_pixels.h SDL_test_font.h
SDL_atomic.h SDL_keycode.h SDL_platform.h SDL_test_fuzzer.h
SDL_audio.h SDL_loadso.h SDL_power.h SDL_test_harness.h
SDL_bits.h SDL_locale.h SDL_quit.h SDL_test_images.h
SDL_blendmode.h SDL_log.h SDL_rect.h SDL_test_log.h
SDL_clipboard.h SDL_main.h SDL_render.h SDL_test_md5.h
SDL_config.h SDL_messagebox.h SDL_revision.h SDL_test_memory.h
SDL_cpuinfo.h SDL_metal.h SDL_rwops.h SDL_test_random.h
SDL_egl.h SDL_misc.h SDL_scancode.h SDL_thread.h
SDL_endian.h SDL_mouse.h SDL_sensor.h SDL_timer.h
SDL_error.h SDL_mutex.h SDL_shape.h SDL_touch.h
SDL_events.h SDL_name.h SDL_stdinc.h SDL_types.h
SDL_filesystem.h SDL_opengl.h SDL_surface.h SDL_version.h
SDL_gamecontroller.h SDL_opengl_glext.h SDL_system.h SDL_video.h
SDL_gesture.h SDL_opengles.h SDL_syswm.h SDL_vulkan.h
SDL_guid.h SDL_opengles2.h SDL_test.h begin_code.h
SDL_haptic.h SDL_opengles2_gl2.h SDL_test_assert.h close_code.h
SDL_hidapi.h SDL_opengles2_gl2ext.h SDL_test_common.h
SDL_hints.h SDL_opengles2_gl2platform.h SDL_test_compare.h

> > sdl2-config --libs
> > -L/opt/local/lib -lSDL2

Luke A. Guest

unread,
Jun 30, 2023, 11:43:17 AM6/30/23
to
On 30/06/2023 16:41, Kenneth Wolcott wrote:
> On Friday, June 30, 2023 at 1:04:34 AM UTC-7, Luke A. Guest wrote:
>> On 29/06/2023 23:04, Kenneth Wolcott wrote:
>>
>>>> $ sdl2-config --cflags
>>>> $ sdl2-config --libs
>>>
>>> sdl2-config --cflags
>>> -I/opt/local/include/SDL2 -D_THREAD_SAFE
>> That's odd. Can you show me the output of this?
>>
>> $ ls /opt/local/include/SDL2
>
> ls /opt/local/include/SDL2
>
> SDL.h SDL_joystick.h SDL_opengles2_khrplatform.h SDL_test_crc32.h
...


As I thought, means, these things can be normalised a bit in my source.

Luke A. Guest

unread,
Jul 2, 2023, 3:01:44 AM7/2/23
to
On 30/06/2023 14:26, Luke A. Guest wrote:
> On 30/06/2023 12:30, Luke A. Guest wrote:
>> The /build/gnat gpr's have got a bit confused by the looks of things.
>>
>> Can you try this patch, it's made from a stash from a diff branch, if
>> it works I'll apply it and push it.
>
> Ignore that, I forgot something, try this one instead.
>

Hello? Did this work for you?

Kenneth Wolcott

unread,
Jul 2, 2023, 1:05:54 PM7/2/23
to
Hi Luke;

I'm not sure what you want me to try.

I don't see an attachment. I don't see a URL. I don't see a specific mention of a "patch"? on GitHub. Obviously I'm missing something. Sorry I appear quite daft :-(

Thanks,
Ken

Simon Wright

unread,
Jul 2, 2023, 3:23:12 PM7/2/23
to
Google Groups has suppressed Luke's two posts with attached patches.

Kenneth Wolcott

unread,
Jul 2, 2023, 3:26:16 PM7/2/23
to
On Sunday, July 2, 2023 at 12:23:12 PM UTC-7, Simon Wright wrote:
Well, that's a very logical explanation for me not seeing anything to respond to :-)

Thanks,
Ken

Luke A. Guest

unread,
Jul 2, 2023, 3:52:55 PM7/2/23
to
On 02/07/2023 20:26, Kenneth Wolcott wrote:

>> Google Groups has suppressed Luke's two posts with attached patches.
>
> Well, that's a very logical explanation for me not seeing anything to respond to :-)

Friggin' goggle. It's this (within the source dir - patch --dry-run -p1
< test.patch):

diff --git a/build/gnat/makefile b/build/gnat/makefile
index b13930f..0046490 100644
--- a/build/gnat/makefile
+++ b/build/gnat/makefile
@@ -90,7 +90,7 @@ tests: $(LIB_NAME) tests.gpr $(TESTS_SRCS)

tests.gpr: $(TESTS_SRCS) gen/$(SDL_MODE)/test/libtestmaths.so
$(GPRMAKE) -p -gnat2012 -XSDL_MODE=$(SDL_MODE)
-XSDL_PLATFORM=$(SDL_PLATFORM) \
- -Ptests.gpr ${SDL2_CONFIG}
+ -Ptests.gpr # ${SDL2_CONFIG}

# Maths library

@@ -111,7 +111,7 @@ unit_tests: $(LIB_NAME) build_unit_tests/unit_tests

build_unit_tests/unit_tests:
$(GPRMAKE) -p -gnat2012 -XSDL_MODE=$(SDL_MODE)
-XSDL_PLATFORM=$(SDL_PLATFORM) \
- -Punit_tests.gpr ${SDL2_CONFIG}
+ -Punit_tests.gpr # ${SDL2_CONFIG}

.PHONY: clean-unit_tests

diff --git a/build/gnat/sdlada.gpr b/build/gnat/sdlada.gpr
index adc77f5..13ef8ee 100644
--- a/build/gnat/sdlada.gpr
+++ b/build/gnat/sdlada.gpr
@@ -1,10 +1,21 @@
library project SDLAda is
- type Platform_Type is ("linux", "bsd", "windows", "macosx",
"macos_homebrew", "ios", "android");
+ type Platform_Type is ("linux",
+ "bsd",
+ "windows",
+ "macosx",
+ "macos_homebrew",
+ "macos_ports",
+ "ios",
+ "android");
type Mode_Type is ("debug", "release");

Platform : Platform_Type := external ("SDL_PLATFORM", "linux");
Mode : Mode_Type := external ("SDL_MODE", "debug");

+ package Builder is
+ for Default_Switches ("Ada") use ("-gnat2012", "-gnata");
+ end Builder;
+
Source_Platform := "";

case Platform is
@@ -52,6 +63,11 @@ library project SDLAda is
"-I/usr/local/include",
"-D_REENTRANT");

+ when "macos_ports" =>
+ C_Switches := C_Switches & ("-DSDL_MACPORTS",
+ "-I/opt/local/include",
+ "-D_THREAD_SAFE");
+
when others =>
null;
end case;
@@ -59,4 +75,33 @@ library project SDLAda is
for Default_Switches ("C") use Common_Switches & C_Switches;
for Default_Switches ("Ada") use Common_Switches & Ada_Switches;
end Compiler;
+
+ package Linker is
+ Linker_Switches := ();
+
+ case Platform is
+ when "linux" | "bsd" | "android" | "windows" =>
+ Linker_Switches := Linker_Switches & ("-lSDL2",
+ "-lSDL2_ttf",
+ "-lSDL2_image",
+ "-L/usr/lib64");
+
+ when "macos_homebrew" =>
+ Linker_Switches := Linker_Switches & ("-lSDL2",
+ "-lSDL2_ttf",
+ "-lSDL2_image",
+ "-L/usr/local/lib");
+
+ when "macos_ports" =>
+ Linker_Switches := Linker_Switches & ("-lSDL2",
+ "-lSDL2_ttf",
+ "-lSDL2_image",
+ "-L/opt/local/lib");
+
+ when others =>
+ null;
+ end case;
+
+ for Switches ("Ada") use Linker_Switches;
+ end Linker;
end SDLAda;
diff --git a/build/gnat/sdlada_image.gpr b/build/gnat/sdlada_image.gpr
index 1098095..5a9764f 100644
--- a/build/gnat/sdlada_image.gpr
+++ b/build/gnat/sdlada_image.gpr
@@ -11,4 +11,5 @@ library project SDLAda_Image is
for Library_Version use "libsdlada_image.so." & Version;

package Compiler renames SDLAda.Compiler;
+ package Linker renames SDLAda.Linker;
end SDLAda_Image;
diff --git a/build/gnat/tests.gpr b/build/gnat/tests.gpr
index 70dceff..51ee201 100644
--- a/build/gnat/tests.gpr
+++ b/build/gnat/tests.gpr
@@ -15,24 +15,5 @@ project Tests is
"ttf.adb");

package Compiler renames SDLAda.Compiler;
-
- package Linker is
-
- Linker_Switches := ();
-
- case Sdlada.Platform is
- when "macos_homebrew" =>
- Linker_Switches := Linker_Switches & ("-lSDL2",
- "-lSDL2_ttf",
- "-lSDL2_image",
- "-L/usr/local/lib");
-
- when others =>
- null;
- end case;
-
- for Switches ("Ada") use Linker_Switches;
-
- end Linker;
-
+ package Linker renames SDLAda.Linker;
end Tests;
diff --git a/build/gnat/tests_image.gpr b/build/gnat/tests_image.gpr
index f23be3c..fd68309 100644
--- a/build/gnat/tests_image.gpr
+++ b/build/gnat/tests_image.gpr
@@ -8,6 +8,7 @@ project Tests_Image is
for Main use ("load_surface.adb");

package Compiler renames SDLAda.Compiler;
+ package Linker renames SDLAda.Linker;

-- package Builder is
-- for Default_Switches ("Ada") use ("-gnat2012", "-gnata");
--, "-gnatG");
diff --git a/build/gnat/unit_tests.gpr b/build/gnat/unit_tests.gpr
index c469a34..27dd38f 100644
--- a/build/gnat/unit_tests.gpr
+++ b/build/gnat/unit_tests.gpr
@@ -17,4 +17,5 @@ project Unit_Tests is
-- end Ide;

package Compiler renames SDLAda.Compiler;
+ package Linker renames SDLAda.Linker;
end Unit_Tests;
diff --git a/src/image/version_images.c b/src/image/version_images.c
index ba5be68..47813a1 100644
--- a/src/image/version_images.c
+++ b/src/image/version_images.c
@@ -21,7 +21,7 @@
* distribution.

**********************************************************************************************************************/
#ifdef __APPLE__
- #ifdef SDL_HOMEBREW
+ #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS)
#include <SDL2/SDL_image.h>
#else
#include <SDL2_image/SDL_image.h>
diff --git a/src/ttf/version_ttf.c b/src/ttf/version_ttf.c
index cedfebc..0819103 100644
--- a/src/ttf/version_ttf.c
+++ b/src/ttf/version_ttf.c
@@ -21,7 +21,7 @@
* distribution.

**********************************************************************************************************************/
#ifdef __APPLE__
- #ifdef SDL_HOMEBREW
+ #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS)
#include <SDL2/SDL_ttf.h>
#else
#include <SDL2_ttf/SDL_ttf.h>

Kenneth Wolcott

unread,
Jul 2, 2023, 4:20:25 PM7/2/23
to
So, I haven't applied a patch in reverse before :-)

You posted the output of running patch -p1 --dry-run < patch while inside the build/gnat directory.

For the simple diffs, I can apply manually, but for the more intensive diffs, I'll probably run into trouble.

So, I need the patch file (?)

I save the output you posted, I manually try to implement the changes and generate a diff and see if my diff matches your diff?

I guess my brain is too old here :-(

Please spoon-feed me here (*SIGH*)

I really appreciate the work you've put in to try to make this SDLAda package work under MacPorts...

Thanks,
Ken

Kenneth Wolcott

unread,
Jul 2, 2023, 5:34:58 PM7/2/23
to
Hi Luke;

I'm in the midst of applying the diffs manually.

Thanks,
Ken

Luke A. Guest

unread,
Jul 2, 2023, 5:40:15 PM7/2/23
to
On 02/07/2023 21:20, Kenneth Wolcott wrote:

> You posted the output of running patch -p1 --dry-run < patch while inside the build/gnat directory.
>
No, that';s the command to test the patch on the source. To apply it you
remove the dry run option.

Just save the email, cut out the crap that's not the patch and then save
it as test.patch as the above command should say (after the "<"), dunno
what happened there.

Kenneth Wolcott

unread,
Jul 2, 2023, 5:59:48 PM7/2/23
to
Thank you.

I think saved the contents of the posting where the first diff starts as test.patch.

I downloaded a fresh sdlada package from GitHub, calling it sdlada2.

I then placed the test.patch file there.

Results:

patch -p1 --dry-run < test.patch
patching file 'build/gnat/makefile'
patch: **** malformed patch at line 7: tests.gpr: $(TESTS_SRCS) gen/$(SDL_MODE)/test/libtestmaths.so

Did I do something wrong?

wc -l test.patch
189 test.patch

head -1 test.patch
diff --git a/build/gnat/makefile b/build/gnat/makefile

tail -1 test.patch
#include <SDL2_ttf/SDL_ttf.h>

Thanks,
Ken

Luke A. Guest

unread,
Jul 3, 2023, 8:23:16 AM7/3/23
to
On 02/07/2023 22:59, Kenneth Wolcott wrote:
> On Sunday, July 2, 2023 at 2:40:15 PM UTC-7, Luke A. Guest wrote:
>> On 02/07/2023 21:20, Kenneth Wolcott wrote:
>>
>>> You posted the output of running patch -p1 --dry-run < patch while inside the build/gnat directory.
>>>
>> No, that';s the command to test the patch on the source. To apply it you
>> remove the dry run option.
>>
>> Just save the email, cut out the crap that's not the patch and then save
>> it as test.patch as the above command should say (after the "<"), dunno
>> what happened there.
>
> Thank you.
>
> I think saved the contents of the posting where the first diff starts as test.patch.
>
> I downloaded a fresh sdlada package from GitHub, calling it sdlada2.
>
> I then placed the test.patch file there.
>
> Results:
>
> patch -p1 --dry-run < test.patch
> patching file 'build/gnat/makefile'
> patch: **** malformed patch at line 7: tests.gpr: $(TESTS_SRCS) gen/$(SDL_MODE)/test/libtestmaths.so
>
> Did I do something wrong?

No idea. This is what I did it with:

$ git clone g...@github.com:Lucretia/sdlada.git
Cloning into 'sdlada'...
remote: Enumerating objects: 3100, done.
remote: Counting objects: 100% (257/257), done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 3100 (delta 156), reused 227 (delta 144), pack-reused 2843
Receiving objects: 100% (3100/3100), 727.62 KiB | 303.00 KiB/s, done.
Resolving deltas: 100% (2269/2269), done.
$ cd sdlada/
$ patch -p1 --dry-run < ~/src/mine-new/game-dev/sdl/sdlada/test.patch
checking file build/gnat/makefile
checking file build/gnat/sdlada.gpr
checking file build/gnat/sdlada_image.gpr
checking file build/gnat/tests.gpr
checking file build/gnat/tests_image.gpr
checking file build/gnat/unit_tests.gpr
checking file src/image/version_images.c
checking file src/ttf/version_ttf.c





Kenneth Wolcott

unread,
Jul 3, 2023, 3:58:05 PM7/3/23
to
Hi Luke;

I wonder if there was an error introduced by the copy&paste with the mouse and/or with the formatting of the posting/email...I'll try to examine that specific area to see if anything shows up under a closer inspection.

I don't think that downloading the zip file from GitHub would be any different than doing the git clone, but there's another difference that might be a cause, ever so remote.

I'll try to get back to you with results shortly.

Again, thanks for your efforts with regards to porting SDLADA towards MacPorts...

Ken

Luke A. Guest

unread,
Jul 3, 2023, 4:10:51 PM7/3/23
to
On 03/07/2023 20:58, Kenneth Wolcott wrote:
> Hi Luke;
>
> I wonder if there was an error introduced by the copy&paste with the mouse and/or with the formatting of the posting/email...I'll try to examine that specific area to see if anything shows up under a closer inspection.
>
> I don't think that downloading the zip file from GitHub would be any different than doing the git clone, but there's another difference that might be a cause, ever so remote.
>
> I'll try to get back to you with results shortly.
>
> Again, thanks for your efforts with regards to porting SDLADA towards MacPorts...
>
> Ken

I used xclip -i ~/src/mine-new/game-dev/sdl/sdlada/test.patch and paste
with middle mouse button, just like below, the first line should "diff...":

Luke A. Guest

unread,
Jul 3, 2023, 4:11:29 PM7/3/23
to
On 03/07/2023 20:58, Kenneth Wolcott wrote:

> I don't think that downloading the zip file from GitHub would be any different than doing the git clone, but
Just clone it.

Kenneth Wolcott

unread,
Jul 3, 2023, 6:56:27 PM7/3/23
to
Hi Luke;

I've cloned the package.

I've manually applied the patch to the cloned package.

I'm about to build it now (fingers crossed).

Thanks,
Ken

Kenneth Wolcott

unread,
Jul 3, 2023, 7:01:44 PM7/3/23
to
Well, I must have made one or more mistakes in the manual patching of the files (*SIGH*)

make SDL_PLATFORM=macos_ports SDL_MODE=release
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Ptools.gpr
Setup
[mkdir] object directory for project Tools
Compile
[Ada] gen_keyboard.adb
[Ada] scancodes.ads
[Ada] utils.adb
Bind
[gprbind] gen_keyboard.bexch
[Ada] gen_keyboard.ali
Link
[link] gen_keyboard.adb
./gen/release/tools/gen_keyboard > gen/src/sdl-events-keyboards.ads
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
sdlada.gpr:16:07: undefined attribute "default_swiches"
sdlada.gpr:17:03: ";" after declarative items expected
sdlada.gpr:26:09: a variable cannot be declared for the first time here
sdlada.gpr:26:23: unknown variable "C_Switches"
sdlada.gpr:34:08: undefined attribute "languages"
sdlada.gpr:35:08: undefined attribute "source_dirs"
sdlada.gpr:42:08: undefined attribute "library_name"
sdlada.gpr:43:08: undefined attribute "object_dir"
sdlada.gpr:44:08: undefined attribute "library_dir"
sdlada.gpr:45:08: undefined attribute "library_kind"
sdlada.gpr:47:04: a package cannot be declared here
sdlada.gpr:79:04: a package cannot be declared here
sdlada.gpr:108:05: expected "builder"
gprbuild: "sdlada.gpr" processing failed
make: *** [lib/libadasdl.a] Error 5

Ken

Kenneth Wolcott

unread,
Jul 3, 2023, 7:10:07 PM7/3/23
to
After adding a semi-colon at the following line in sdlada.gpr

for Default_Swiches ("Ada") use ("-gnat202", "-gnata");

We have the following when trying to make again:

make SDL_PLATFORM=macos_ports SDL_MODE=debug
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=debug -XSDL_PLATFORM=macos_ports \
-Ptools.gpr
Setup
[mkdir] object directory for project Tools
Compile
[Ada] gen_keyboard.adb
[Ada] scancodes.ads
[Ada] utils.adb
Bind
[gprbind] gen_keyboard.bexch
[Ada] gen_keyboard.ali
Link
[link] gen_keyboard.adb
./gen/debug/tools/gen_keyboard > gen/src/sdl-events-keyboards.ads
gprbuild -p -gnat2012 -XSDL_MODE=debug -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
sdlada.gpr:16:07: undefined attribute "default_swiches"
sdlada.gpr:26:09: a variable cannot be declared for the first time here
sdlada.gpr:26:23: unknown variable "C_Switches"
gprbuild: "sdlada.gpr" processing failed
make: *** [lib/libadasdl.a] Error 5

I hope that this shows that I made mistake(s) that can be shown to me that I can fix or that this is clear regarding what still needs to be done for the SDLAda port to MacPorts...

Ken

Keith Thompson

unread,
Jul 3, 2023, 7:24:37 PM7/3/23
to
Kenneth Wolcott <kenneth...@gmail.com> writes:
[...]
> After adding a semi-colon at the following line in sdlada.gpr
>
> for Default_Swiches ("Ada") use ("-gnat202", "-gnata");
[...]

Unless "-gnat202" requests the version of Ada that was current during
the reign of Septimius Severus, you probably want to use "-gnat2022".
(Options can be abbreviated, but "-gnat202" may become ambiguous if
there's a new Ada standard before 2030.)

Also "Default_Swiches" is mispelled.

If the typos are the result of re-typing that line, I strongly suggest
copy-and-pasting any code you post.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Kenneth Wolcott

unread,
Jul 3, 2023, 7:58:31 PM7/3/23
to
On Monday, July 3, 2023 at 4:24:37 PM UTC-7, Keith Thompson wrote:
> Kenneth Wolcott writes:
> [...]
> > After adding a semi-colon at the following line in sdlada.gpr
> >
> > for Default_Swiches ("Ada") use ("-gnat202", "-gnata");
> [...]
>
> Unless "-gnat202" requests the version of Ada that was current during
> the reign of Septimius Severus, you probably want to use "-gnat2022".
> (Options can be abbreviated, but "-gnat202" may become ambiguous if
> there's a new Ada standard before 2030.)
>
> Also "Default_Swiches" is mispelled.
>
> If the typos are the result of re-typing that line, I strongly suggest
> copy-and-pasting any code you post.
>
> --
> Keith Thompson

Thank you, Keith :-)

Fixed those two typos.

Here's the current output from trying to build:

make SDL_PLATFORM=macos_ports SDL_MODE=debug
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=debug -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
sdlada.gpr:26:09: a variable cannot be declared for the first time here
sdlada.gpr:26:23: unknown variable "C_Switches"
gprbuild: "sdlada.gpr" processing failed
make: *** [lib/libadasdl.a] Error 5

Thanks,
Ken

Luke A. Guest

unread,
Jul 4, 2023, 4:57:45 AM7/4/23
to
On 04/07/2023 00:01, Kenneth Wolcott wrote:
> ./gen/release/tools/gen_keyboard > gen/src/sdl-events-keyboards.ads
> gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
> -Psdlada.gpr
> sdlada.gpr:16:07: undefined attribute "default_swiches"
> sdlada.gpr:17:03: ";" after declarative items expected
> sdlada.gpr:26:09: a variable cannot be declared for the first time here
> sdlada.gpr:26:23: unknown variable "C_Switches"
> sdlada.gpr:34:08: undefined attribute "languages"
> sdlada.gpr:35:08: undefined attribute "source_dirs"
> sdlada.gpr:42:08: undefined attribute "library_name"
> sdlada.gpr:43:08: undefined attribute "object_dir"
> sdlada.gpr:44:08: undefined attribute "library_dir"
> sdlada.gpr:45:08: undefined attribute "library_kind"
> sdlada.gpr:47:04: a package cannot be declared here
> sdlada.gpr:79:04: a package cannot be declared here
> sdlada.gpr:108:05: expected "builder"
> gprbuild: "sdlada.gpr" processing failed
> make: *** [lib/libadasdl.a] Error 5
>
> Ken

I don't know what's going on about, here's the gpr I have:

library project SDLAda is
type Platform_Type is ("linux",
"bsd",
"windows",
"macosx",
"macos_homebrew",
"macos_ports",
"ios",
"android");
type Mode_Type is ("debug", "release");

Platform : Platform_Type := external ("SDL_PLATFORM", "linux");
Mode : Mode_Type := external ("SDL_MODE", "debug");

package Builder is
for Default_Switches ("Ada") use ("-gnat2012", "-gnata");
end Builder;

Source_Platform := "";

case Platform is
when "macos_homebrew" =>
Source_Platform := "../../src/macosx";

when others =>
Source_Platform := "../../src/" & Platform;
end case;

for Languages use ("Ada", "C");
for Source_Dirs use ("../../src", Source_Platform, "gen/src/",

-- For SDL.Image.
"../../src/image",

-- For SDL.TTF.
"../../src/ttf");
for Library_Name use "sdlada";
for Object_Dir use "gen/" & Mode & "/lib/.obj";
for Library_Dir use "gen/" & Mode & "/lib";
for Library_Kind use "static";

package Compiler is
Common_Switches := ("-ffunction-sections", "-fdata-sections");
C_Switches := ();
Ada_Switches := ("-gnat2012", "-gnata", "-gnato", "-gnatE",
"-gnatwa",
"-gnaty", "-gnaty-s", "-gnatyO",
"-gnatyM120", "-gnatyx");

case Mode is
when "debug" =>
Common_Switches := Common_Switches & ("-O0", "-g", "-ggdb");

when "release" =>
Common_Switches := Common_Switches & ("-O2");
end case;

-- These flags require checking on all platforms as they're
taken directly from sdl2-config.
case Platform is
when "linux" | "bsd" | "android" | "windows" =>
C_Switches := C_Switches & ("-I/usr/include/SDL2",
"-D_REENTRANT");

when "macos_homebrew" =>
C_Switches := C_Switches & ("-DSDL_HOMEBREW",
"-I/usr/local/include",
"-D_REENTRANT");

when "macos_ports" =>
C_Switches := C_Switches & ("-DSDL_MACPORTS",
"-I/opt/local/include",
"-D_THREAD_SAFE");

when others =>
null;
end case;

for Default_Switches ("C") use Common_Switches & C_Switches;
for Default_Switches ("Ada") use Common_Switches & Ada_Switches;
end Compiler;

package Linker is
Linker_Switches := ();

case Platform is
when "linux" | "bsd" | "android" | "windows" =>
Linker_Switches := Linker_Switches & ("-lSDL2",
"-lSDL2_ttf",
"-lSDL2_image",
"-L/usr/lib64");

when "macos_homebrew" =>
Linker_Switches := Linker_Switches & ("-lSDL2",
"-lSDL2_ttf",
"-lSDL2_image",
"-L/usr/local/lib");

when "macos_ports" =>
Linker_Switches := Linker_Switches & ("-lSDL2",
"-lSDL2_ttf",
"-lSDL2_image",
"-L/opt/local/lib");

when others =>
null;
end case;

for Switches ("Ada") use Linker_Switches;
end Linker;
end SDLAda;

Luke A. Guest

unread,
Jul 4, 2023, 4:59:15 AM7/4/23
to
On 04/07/2023 00:24, Keith Thompson wrote:
> Kenneth Wolcott <kenneth...@gmail.com> writes:
> [...]
>> After adding a semi-colon at the following line in sdlada.gpr
>>
>> for Default_Swiches ("Ada") use ("-gnat202", "-gnata");
> [...]
>
> Unless "-gnat202" requests the version of Ada that was current during
> the reign of Septimius Severus, you probably want to use "-gnat2022".
> (Options can be abbreviated, but "-gnat202" may become ambiguous if
> there's a new Ada standard before 2030.)
>
> Also "Default_Swiches" is mispelled.
>
> If the typos are the result of re-typing that line, I strongly suggest
> copy-and-pasting any code you post.
>

I don't have that, I have "-gnat2012" see my previous post.

Luke A. Guest

unread,
Jul 4, 2023, 5:00:11 AM7/4/23
to
This makes no sense, line 26 is this:

Kenneth Wolcott

unread,
Jul 6, 2023, 3:37:20 PM7/6/23
to
Hi Luke;

Is it possible for us to arrange a process to send the patch to me in another means? If Google Groups blocks attachments and I'm getting massively confused with the content being pasted inside the posting, we need to derive another means of communicating. I can share a different email address which is already being heavily spammed...

Thanks,
Ken

Kenneth Wolcott

unread,
Jul 6, 2023, 9:23:51 PM7/6/23
to
Hi Luke;

Please email the patch to me as an attachment using the email address: kwol...@yahoo.com...

Please also provide a checksum of some kind so I know that the file didn't get corrupted en-route.

Thanks,
Ken

Kenneth Wolcott

unread,
Jul 6, 2023, 9:25:42 PM7/6/23
to
The email address is kwolcott at yahoo dot com.

Kenneth Wolcott

unread,
Jul 12, 2023, 1:43:37 AM7/12/23
to
> > Please email the patch to me as an attachment using the email address: [redacted :-) ]
> >
> > Please also provide a checksum of some kind so I know that the file didn't get corrupted en-route.
> >
> > Thanks,
> > Ken
> The email address is kwolcott at yahoo dot com.

Hi Luke;

Thanks for the patch via email.

The md5sum matches...

I ran git restore in the sdlada git clone directory...

I then applied the patch:

patch -p1 < test.patch
patching file 'build/gnat/makefile'
patching file 'build/gnat/sdlada.gpr'
patching file 'build/gnat/sdlada_image.gpr'
Reversed (or previously applied) patch detected! Assume -R? [y] y
patching file 'build/gnat/tests.gpr'
Reversed (or previously applied) patch detected! Assume -R? [y] y
patching file 'build/gnat/tests_image.gpr'
Reversed (or previously applied) patch detected! Assume -R? [y] y
patching file 'build/gnat/unit_tests.gpr'
Reversed (or previously applied) patch detected! Assume -R? [y] y
patching file 'src/image/version_images.c'
Reversed (or previously applied) patch detected! Assume -R? [y] y
patching file 'src/ttf/version_ttf.c'
Reversed (or previously applied) patch detected! Assume -R? [y] y

Attempting to build:

make SDL_PLATFORM=macos_ports SDL_MODE=release
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
Setup
[mkdir] object directory for project SDLAda
sdlada.gpr:1:17: warning: Linker switches not taken into account in library projects
sdlada.gpr:30:39: "../../src/macos_ports" is not a valid directory
gprbuild: "sdlada.gpr" processing failed
make: *** [lib/libadasdl.a] Error 5

So, what did I do wrong this time?

Thanks,
Ken

Kenneth Wolcott

unread,
Jul 12, 2023, 2:01:43 AM7/12/23
to
Ok,

I deleted the contents of the sdlada git clone directory...

then did a git restore .

then applied the patch

then ran make.

Still fails...

*****************************************************************
patch -p1 < test.patch
patching file 'build/gnat/makefile'
patching file 'build/gnat/sdlada.gpr'
patching file 'build/gnat/sdlada_image.gpr'
patching file 'build/gnat/tests.gpr'
patching file 'build/gnat/tests_image.gpr'
patching file 'build/gnat/unit_tests.gpr'
patching file 'src/image/version_images.c'
patching file 'src/ttf/version_ttf.c'
sdlada: cd build/gnat
gnat: make SDL_PLATFORM=macos_ports SDL_MODE=release
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Ptools.gpr
Setup
[mkdir] object directory for project Tools
Compile
[Ada] gen_keyboard.adb
[Ada] scancodes.ads
[Ada] utils.adb
Bind
[gprbind] gen_keyboard.bexch
[Ada] gen_keyboard.ali
Link
[link] gen_keyboard.adb
./gen/release/tools/gen_keyboard > gen/src/sdl-events-keyboards.ads
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
Setup
[mkdir] object directory for project SDLAda
sdlada.gpr:1:17: warning: Linker switches not taken into account in library projects
sdlada.gpr:30:39: "../../src/macos_ports" is not a valid directory
gprbuild: "sdlada.gpr" processing failed
make: *** [lib/libadasdl.a] Error 5
*****************************************************************

Thanks,
Ken

Luke A. Guest

unread,
Jul 12, 2023, 11:44:20 AM7/12/23
to
Check the sdlada.gpr, it will get the platform name as the src dir too,
I forgot about that. Change:

case Platform is
when "macos_homebrew" =>

to:

case Platform is
when "macos_homebrew" | "macos_ports" | "macosx" =>


Kenneth Wolcott

unread,
Jul 12, 2023, 7:09:38 PM7/12/23
to
After
1. Completely deleting the cloned instance of sdlada;
2. Applying the patch you provided via email;
3. manually modifying sdlada.gpr as you directed above;

We have the following result:
*********************************************
make SDL_PLATFORM=macos_ports SDL_MODE=release
mkdir -p gen/src/
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Ptools.gpr
Setup
[mkdir] object directory for project Tools
Compile
[Ada] gen_keyboard.adb
[Ada] scancodes.ads
[Ada] utils.adb
Bind
[gprbind] gen_keyboard.bexch
[Ada] gen_keyboard.ali
Link
[link] gen_keyboard.adb
./gen/release/tools/gen_keyboard > gen/src/sdl-events-keyboards.ads
gprbuild -p -gnat2012 -XSDL_MODE=release -XSDL_PLATFORM=macos_ports \
-Psdlada.gpr
Setup
[mkdir] object directory for project SDLAda
sdlada.gpr:1:17: warning: Linker switches not taken into account in library projects
Compile
[C] version_ttf.c
[REDACTED]/sdlada/src/ttf/version_ttf.c:25:18: fatal error: SDL2/SDL_ttf.h: No such file or directory
25 | #include <SDL2/SDL_ttf.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
gprbuild: *** compilation phase failed
make: *** [lib/libadasdl.a] Error 4
*********************************************

Kenneth Wolcott

unread,
Jul 12, 2023, 7:11:19 PM7/12/23
to
1.5. Running git clone again to obtain fresh sdlada source :-)

Luke A. Guest

unread,
Jul 13, 2023, 6:59:47 AM7/13/23
to
Can you edit your replies cutting out irrelevant stuff so I don't have
to scroll through pages of stuff?

Rod Kay

unread,
Jul 13, 2023, 10:14:01 AM7/13/23
to
On 13/7/23 20:59, Luke A. Guest wrote:
> Can you edit your replies cutting out irrelevant stuff so I don't have
> to scroll through pages of stuff?
>

Or perhaps open an issue in the sdlada github project.


Regards.

Kenneth Wolcott

unread,
Jul 13, 2023, 11:15:15 AM7/13/23
to
On Thursday, July 13, 2023 at 7:14:01 AM UTC-7, Rod Kay wrote:
> On 13/7/23 20:59, Luke A. Guest wrote:
> > Can you edit your replies cutting out irrelevant stuff so I don't have
> > to scroll through pages of stuff?

Luke (and others):

I'm sorry, I know better, I was being lazy :-(

> Or perhaps open an issue in the sdlada github project.

Rod;

That is probably what I should have done initially.

Ken
0 new messages