From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:620a:468f:b0:765:6a0f:8279 with SMTP id bq15-20020a05620a468f00b007656a0f8279mr23116qkb.0.1688329223372; Sun, 02 Jul 2023 13:20:23 -0700 (PDT) X-Received: by 2002:a05:6a00:2d02:b0:663:517c:82f with SMTP id fa2-20020a056a002d0200b00663517c082fmr10419403pfb.6.1688329223009; Sun, 02 Jul 2023 13:20:23 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 2 Jul 2023 13:20:22 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 References: <5bd661f7-f077-47e4-a3c0-aef7d3b41059n@googlegroups.com> <5442a053-9c59-4be4-8485-b0df2e589aedn@googlegroups.com> <21e6c8c0-ec62-4192-aa5d-39d38149821cn@googlegroups.com> <016412bf-0247-466b-add9-8b5d41c6a9d7n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6de97f96-fae6-4e13-9439-e8f550287835n@googlegroups.com> Subject: Re: SDL Ada package fails to compile on Mac, gnat 13.1, missing "SDL2_ttf/SDL_ttf.h" From: Kenneth Wolcott Injection-Date: Sun, 02 Jul 2023 20:20:23 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 9179 Xref: news.eternal-september.org comp.lang.ada:65405 List-Id: On Sunday, July 2, 2023 at 12:52:55=E2=80=AFPM UTC-7, Luke A. Guest wrote: > On 02/07/2023 20:26, Kenneth Wolcott wrote:=20 >=20 > >> Google Groups has suppressed Luke's two posts with attached patches.= =20 > >=20 > > Well, that's a very logical explanation for me not seeing anything to r= espond to :-) > Friggin' goggle. It's this (within the source dir - patch --dry-run -p1= =20 > < test.patch):=20 >=20 > diff --git a/build/gnat/makefile b/build/gnat/makefile=20 > index b13930f..0046490 100644=20 > --- a/build/gnat/makefile=20 > +++ b/build/gnat/makefile=20 > @@ -90,7 +90,7 @@ tests: $(LIB_NAME) tests.gpr $(TESTS_SRCS)=20 >=20 > tests.gpr: $(TESTS_SRCS) gen/$(SDL_MODE)/test/libtestmaths.so=20 > $(GPRMAKE) -p -gnat2012 -XSDL_MODE=3D$(SDL_MODE)=20 > -XSDL_PLATFORM=3D$(SDL_PLATFORM) \=20 > - -Ptests.gpr ${SDL2_CONFIG}=20 > + -Ptests.gpr # ${SDL2_CONFIG}=20 >=20 > # Maths library=20 >=20 > @@ -111,7 +111,7 @@ unit_tests: $(LIB_NAME) build_unit_tests/unit_tests= =20 >=20 > build_unit_tests/unit_tests:=20 > $(GPRMAKE) -p -gnat2012 -XSDL_MODE=3D$(SDL_MODE)=20 > -XSDL_PLATFORM=3D$(SDL_PLATFORM) \=20 > - -Punit_tests.gpr ${SDL2_CONFIG}=20 > + -Punit_tests.gpr # ${SDL2_CONFIG}=20 >=20 > .PHONY: clean-unit_tests=20 >=20 > diff --git a/build/gnat/sdlada.gpr b/build/gnat/sdlada.gpr=20 > index adc77f5..13ef8ee 100644=20 > --- a/build/gnat/sdlada.gpr=20 > +++ b/build/gnat/sdlada.gpr=20 > @@ -1,10 +1,21 @@=20 > library project SDLAda is=20 > - type Platform_Type is ("linux", "bsd", "windows", "macosx",=20 > "macos_homebrew", "ios", "android");=20 > + type Platform_Type is ("linux",=20 > + "bsd",=20 > + "windows",=20 > + "macosx",=20 > + "macos_homebrew",=20 > + "macos_ports",=20 > + "ios",=20 > + "android");=20 > type Mode_Type is ("debug", "release");=20 >=20 > Platform : Platform_Type :=3D external ("SDL_PLATFORM", "linux");=20 > Mode : Mode_Type :=3D external ("SDL_MODE", "debug");=20 >=20 > + package Builder is=20 > + for Default_Switches ("Ada") use ("-gnat2012", "-gnata");=20 > + end Builder;=20 > +=20 > Source_Platform :=3D "";=20 >=20 > case Platform is=20 > @@ -52,6 +63,11 @@ library project SDLAda is=20 > "-I/usr/local/include",=20 > "-D_REENTRANT");=20 >=20 > + when "macos_ports" =3D>=20 > + C_Switches :=3D C_Switches & ("-DSDL_MACPORTS",=20 > + "-I/opt/local/include",=20 > + "-D_THREAD_SAFE");=20 > +=20 > when others =3D>=20 > null;=20 > end case;=20 > @@ -59,4 +75,33 @@ library project SDLAda is=20 > for Default_Switches ("C") use Common_Switches & C_Switches;=20 > for Default_Switches ("Ada") use Common_Switches & Ada_Switches;=20 > end Compiler;=20 > +=20 > + package Linker is=20 > + Linker_Switches :=3D ();=20 > +=20 > + case Platform is=20 > + when "linux" | "bsd" | "android" | "windows" =3D>=20 > + Linker_Switches :=3D Linker_Switches & ("-lSDL2",=20 > + "-lSDL2_ttf",=20 > + "-lSDL2_image",=20 > + "-L/usr/lib64");=20 > +=20 > + when "macos_homebrew" =3D>=20 > + Linker_Switches :=3D Linker_Switches & ("-lSDL2",=20 > + "-lSDL2_ttf",=20 > + "-lSDL2_image",=20 > + "-L/usr/local/lib");=20 > +=20 > + when "macos_ports" =3D>=20 > + Linker_Switches :=3D Linker_Switches & ("-lSDL2",=20 > + "-lSDL2_ttf",=20 > + "-lSDL2_image",=20 > + "-L/opt/local/lib");=20 > +=20 > + when others =3D>=20 > + null;=20 > + end case;=20 > +=20 > + for Switches ("Ada") use Linker_Switches;=20 > + end Linker;=20 > end SDLAda;=20 > diff --git a/build/gnat/sdlada_image.gpr b/build/gnat/sdlada_image.gpr=20 > index 1098095..5a9764f 100644=20 > --- a/build/gnat/sdlada_image.gpr=20 > +++ b/build/gnat/sdlada_image.gpr=20 > @@ -11,4 +11,5 @@ library project SDLAda_Image is=20 > for Library_Version use "libsdlada_image.so." & Version;=20 >=20 > package Compiler renames SDLAda.Compiler;=20 > + package Linker renames SDLAda.Linker;=20 > end SDLAda_Image;=20 > diff --git a/build/gnat/tests.gpr b/build/gnat/tests.gpr=20 > index 70dceff..51ee201 100644=20 > --- a/build/gnat/tests.gpr=20 > +++ b/build/gnat/tests.gpr=20 > @@ -15,24 +15,5 @@ project Tests is=20 > "ttf.adb");=20 >=20 > package Compiler renames SDLAda.Compiler;=20 > -=20 > - package Linker is=20 > -=20 > - Linker_Switches :=3D ();=20 > -=20 > - case Sdlada.Platform is=20 > - when "macos_homebrew" =3D>=20 > - Linker_Switches :=3D Linker_Switches & ("-lSDL2",=20 > - "-lSDL2_ttf",=20 > - "-lSDL2_image",=20 > - "-L/usr/local/lib");=20 > -=20 > - when others =3D>=20 > - null;=20 > - end case;=20 > -=20 > - for Switches ("Ada") use Linker_Switches;=20 > -=20 > - end Linker;=20 > -=20 > + package Linker renames SDLAda.Linker;=20 > end Tests;=20 > diff --git a/build/gnat/tests_image.gpr b/build/gnat/tests_image.gpr=20 > index f23be3c..fd68309 100644=20 > --- a/build/gnat/tests_image.gpr=20 > +++ b/build/gnat/tests_image.gpr=20 > @@ -8,6 +8,7 @@ project Tests_Image is=20 > for Main use ("load_surface.adb");=20 >=20 > package Compiler renames SDLAda.Compiler;=20 > + package Linker renames SDLAda.Linker;=20 >=20 > -- package Builder is=20 > -- for Default_Switches ("Ada") use ("-gnat2012", "-gnata");=20 > --, "-gnatG");=20 > diff --git a/build/gnat/unit_tests.gpr b/build/gnat/unit_tests.gpr=20 > index c469a34..27dd38f 100644=20 > --- a/build/gnat/unit_tests.gpr=20 > +++ b/build/gnat/unit_tests.gpr=20 > @@ -17,4 +17,5 @@ project Unit_Tests is=20 > -- end Ide;=20 >=20 > package Compiler renames SDLAda.Compiler;=20 > + package Linker renames SDLAda.Linker;=20 > end Unit_Tests;=20 > diff --git a/src/image/version_images.c b/src/image/version_images.c=20 > index ba5be68..47813a1 100644=20 > --- a/src/image/version_images.c=20 > +++ b/src/image/version_images.c=20 > @@ -21,7 +21,7 @@=20 > * distribution.=20 >=20 > *************************************************************************= *********************************************/=20 > #ifdef __APPLE__=20 > - #ifdef SDL_HOMEBREW=20 > + #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS)=20 > #include =20 > #else=20 > #include =20 > diff --git a/src/ttf/version_ttf.c b/src/ttf/version_ttf.c=20 > index cedfebc..0819103 100644=20 > --- a/src/ttf/version_ttf.c=20 > +++ b/src/ttf/version_ttf.c=20 > @@ -21,7 +21,7 @@=20 > * distribution.=20 >=20 > *************************************************************************= *********************************************/=20 > #ifdef __APPLE__=20 > - #ifdef SDL_HOMEBREW=20 > + #if defined (SDL_HOMEBREW) || defined (SDL_MACPORTS)=20 > #include =20 > #else=20 > #include So, I haven't applied a patch in reverse before :-) You posted the output of running patch -p1 --dry-run < patch while inside t= he build/gnat directory. For the simple diffs, I can apply manually, but for the more intensive diff= s, 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 g= enerate 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 packa= ge work under MacPorts... Thanks, Ken