Bug 4442 - Important Haiku patches from HaikuPorts repository
Summary: Important Haiku patches from HaikuPorts repository
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.9
Hardware: All Haiku
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.16
Depends on:
Blocks:
 
Reported: 2019-01-05 20:16 UTC by EXL
Modified: 2020-07-16 18:29 UTC (History)
2 users (show)

See Also:


Attachments
Patchset from official HaikuPorts repository. (32.77 KB, application/mbox)
2019-01-05 20:16 UTC, EXL
Details
Haiku Patchset for SDL2 2.0.9 (32.94 KB, text/plain)
2019-03-31 06:41 UTC, Pirat
Details
Patched not applied. (5.24 KB, patch)
2019-11-12 03:35 UTC, Ryan C. Gordon
Details | Diff
Renaming BE_* to HAIKU_* (6.19 KB, patch)
2019-11-12 20:56 UTC, EXL
Details | Diff
The last unapplied Haiku support patch (2.47 KB, patch)
2019-12-03 07:55 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description EXL 2019-01-05 20:16:12 UTC
Created attachment 3559 [details]
Patchset from official HaikuPorts repository.

Please integrate relevant C/C++ patches from official HaikuPorts repository to the SDL2 upstream:

https://github.com/haikuports/haikuports/blob/master/media-libs/libsdl2/patches/libsdl2-2.0.8.patchset

P.S. Is it possible to apply these patches so that the author and the date of the changes was saved in Mercurial commits?
Comment 2 Pirat 2019-03-31 06:41:02 UTC
Created attachment 3719 [details]
Haiku Patchset for SDL2 2.0.9
Comment 3 Ryan C. Gordon 2019-07-30 17:49:39 UTC
(Sorry if you get several emails like this, we're marking a bunch of bugs.)

We're hoping to ship SDL 2.0.11 on a much shorter timeframe than we have historically done releases, so I'm starting to tag bugs we hope to have closed in this release cycle.

Note that this tag means we just intend to scrutinize this bug for the 2.0.11 release: we may fix it, reject it, or even push it back to a later release for now, but this helps give us both a goal and a wishlist for the next release.

If this bug has been quiet for a few months and you have new information (such as, "this is definitely still broken" or "this got fixed at some point"), please feel free to retest and/or add more notes to the bug.

--ryan.
Comment 4 Ryan C. Gordon 2019-09-20 20:47:35 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 5 Ryan C. Gordon 2019-09-20 20:48:43 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 6 Ryan C. Gordon 2019-11-12 03:32:05 UTC
Okay, most of these patches are in now, under the original author's names:

https://hg.libsdl.org/SDL/rev/57ed423da32a
https://hg.libsdl.org/SDL/rev/7685ed78cd5c
https://hg.libsdl.org/SDL/rev/6058a0286a96
https://hg.libsdl.org/SDL/rev/9dfa95a693ba
https://hg.libsdl.org/SDL/rev/c6c5c0c9ad2b
https://hg.libsdl.org/SDL/rev/7e53f9a1d5e4
https://hg.libsdl.org/SDL/rev/00da92ddae19
https://hg.libsdl.org/SDL/rev/f5298e605071

Some notes:

- I didn't test this, I just made sure things applied cleanly. Reopen this bug if I screwed something up.  :)

- The B_NO_POINTER_HISTORY patch is probably wrong...?  I assume it was meant to be an optimization, but it seems to me that you would want old mouse events even if your framerate isn't keeping up (think of a painting program, where you would want all the curves painted, regardless of when the program catches up to processing them). This is just my opinion though, and maybe this is more complicated than I think. It's common for SDL apps to process all available events, and decide where the mouse is at the end, if they don't need old positions.

- I didn't remove the NaCl code from the configure script, because obviously that's not a correct patch in general, but if I could understand why it causes problems on Haiku, we can fix that. That code is never called (at least, it shouldn't be called!) on Haiku.

- The "Fix AC_DEFINE" patch is wrong. I'm not sure why this one AC_DEFINE is being changed when all the others aren't, especially because this one is in the X11 support code which Haiku doesn't use. Also, it's changing the AC_DEFINE from something that's correct to something that isn't. Can I get an understanding of what the problem was here?

- I can't apply the "Fix secondary arch build" patch because it hardcodes in the assumption that you are using a C++ compiler to Makefile.in, which is true on Haiku but almost nowhere else.

--ryan.
Comment 7 Ryan C. Gordon 2019-11-12 03:35:01 UTC
Created attachment 4041 [details]
Patched not applied.


Here are just the unapplied patches, to make this easier to sort out.

--ryan.
Comment 8 Ryan C. Gordon 2019-11-12 03:44:27 UTC
Also, this is failing to build: https://buildbot.libsdl.org/builders/sdl-haiku/builds/3964/steps/compile/logs/stdio

If we just need to upgrade the (very old) Haiku install on the buildbot to fix this, disregard these errors.

--ryan.
Comment 9 EXL 2019-11-12 20:56:29 UTC
Created attachment 4044 [details]
Renaming BE_* to HAIKU_*

Renaming BE_* entities to HAIKU_* and bump copyright years.

See Bugzilla #2349: https://bugzilla.libsdl.org/show_bug.cgi?id=2349
Comment 10 Ryan C. Gordon 2019-11-12 22:25:56 UTC
(In reply to EXL from comment #9)
> Created attachment 4044 [details]
> Renaming BE_* to HAIKU_*

This patch is now https://hg.libsdl.org/SDL/rev/007002587d5d, thanks!

--ryan.
Comment 11 Ryan C. Gordon 2019-11-12 22:26:51 UTC
Comment on attachment 4044 [details]
Renaming BE_* to HAIKU_*


Marking EXL's attachment obsolete, because it's in revision control now!

--ryan.
Comment 12 PulkoMandy 2019-11-19 20:34:31 UTC
Hi,
So I tried building from unpatched mercurial, here is what I found:
- Patch for nacl: seems not needed, probably we carried this over from older versions without checking if it was still a problem
- Patch for xinput2 multitouch: likewise
- Patch to use CXX instead of CC for libtool: still needed except for the gcc2 version of Haiku. AC_CHECK_FILE as it is done currently isn't working because our 32bit system ships with both gcc2 and gcc8, and has both variants of the C++ library. If you really want to manually specify which C++ library to use, you can use the "getarch" commandm if its output is x86_gcc2, you need libstdc++.r4. But using CXX in libtool options would be cleaner for Haiku
- The event mask: note that the window and GL view run in their own thread which I don't expect to be too much CPU bound, and will quickly pop these messages and forward them to the main thread in our SDL code. Therefore the B_NO_POINTER_HISTORY should be no problem, and is the default on Haiku anyway (it was not in BeOS, but we changed that and added a B_FULL_POINTER_HISTORY flag to request the old behavior explicitly). So, this seems fine.
- The build is currently not broken for me (besides the error with linking libstdc++.r4 with gcc8), so if you still have problems, consider updating your bot to a recent nightly. You could also use the bot to build the gcc8 version to improve coverage (use "setarch x86 somescript" to run "somescript" in the gcc8 environment) and/or setup a 64bit buildbot (which will be gcc8 only)
Comment 13 Ryan C. Gordon 2019-12-03 07:50:48 UTC
The B_NO_POINTER_HISTORY patch is applied:

https://hg.libsdl.org/SDL/rev/c51961094960
Comment 14 Ryan C. Gordon 2019-12-03 07:55:14 UTC
Created attachment 4086 [details]
The last unapplied Haiku support patch


Updated attached patch to remove the B_NO_POINTER_HISTORY patch (since it's in revision control now) and the other things that PulkoMandy said could be dropped. It's down to the one last libtool thing. We'll probably just need some small effort to wrap this in an extra variable so it does "CXX" on Haiku and "CC" everywhere else, but I haven't done so yet.

--ryan.
Comment 15 Ryan C. Gordon 2020-02-12 20:19:00 UTC
I'm going to remove the target-2.0.12 tag from this bug soon; if any Haiku people want to see about making that final patch agreeable, I'd like to get it into 2.0.12.

Thanks,
--ryan.
Comment 16 Ryan C. Gordon 2020-02-14 02:36:30 UTC
Moved to target-2.0.14. If anyone gets to this last patch before me, we'll accept it at any time.

Thanks!

--ryan.