EasyRPG / buildscripts

The scripts used to compile needed libraries for supported platform ports on our Jenkins server
https://ci.easyrpg.org/view/Toolchains/
Other
16 stars 17 forks source link

Fix buildscripts for iOS to bring back iOS support in the future #163

Closed Serena1432 closed 2 months ago

Serena1432 commented 7 months ago

As an EasyRPG user who has some interest at developing EasyRPG for iOS, I want to fix the current buildscripts for iOS that were unable to build before.

I already tested the toolchain building using the computer below:

The fixed buildscripts will generate toolchain for armv7, arm64 and universal, seperated into 3 respective folders. I already compressed the universal one into this file below containing the latest version of all libraries for iOS:

ios_toolchain.tar.gz (70.0 MB)

I also tested building the latest version of liblcf with the toolchain above:

liblcf-ios.tar.gz (34.8 MB)

However, while trying to build the latest version of Player, I encountered an error that some codes in the Player only supports iOS 11 or later, but it seemed that the toolchain could be used without any errors.

Ghabry commented 7 months ago

Thanks for the contribution!

Right now I cannot build this myself because the macOS VM we use is still on 12.3. Guess have to update it first and then install the XCode bloatware as iPhone SDK is bundled with XCode, not with the lightweight command line tools :(

I will report back when I found motivation to do this infrastructure stuff.

Serena1432 commented 7 months ago

Thanks for the contribution!

Right now I cannot build this myself because the macOS VM we use is still on 12.3. Guess have to update it first and then install the XCode bloatware as iPhone SDK is bundled with XCode, not with the lightweight command line tools :(

I will report back when I found motivation to do this infrastructure stuff.

Xcode 12.3 is fine. 12.4 is just the latest supported version for macOS Catalina but in theory you can use any version of Xcode that isn't too old (even Xcode 10 is also fine tho).

Edit: I just remembered that the buildscripts didn't work with Clang 10 (that was used in Xcode 10) so Xcode 10 may also not work on your computer. But I'm quite sure that 12.3 is fine.

Ghabry commented 3 months ago

sorry for not giving more feedback on this. All my recent attempts to boot the latest macOS in a VM (KVM linux) failed with a kernel panic. :/

Serena1432 commented 3 months ago

sorry for not giving more feedback on this. All my recent attempts to boot the latest macOS in a VM (KVM linux) failed with a kernel panic. :/

As I know, there's currently no way to boot the latest version of macOS on virtual machines. I also tried booting macOS 13 (Ventura) before but it didn't succeed.

However, I think the older version of macOS is enough; remember that I edited and built the buildscripts using macOS 10.15 (Catalina), so can you try booting Catalina or Big Sur on VM?

Btw, I also bought a new MacBook Pro 2018 some days before (cause my MBP Late 2013 mentioned in this PR was already broken), so let me know if you need any help.

Ghabry commented 3 months ago

ah okay, this explains it. I will try macOS 12 when I find time and report back. Thanks.

Ghabry commented 3 months ago

Uhm yesterday I saw a comment in the configuration file that the CPU must be changed from Penryn to Haswell-noTSX for Sonoma and... my installation I made a month ago booted.

So obvious case of RTFM xD

The background image is not rendering (desktop is white) and audio is broken but who cares.

grafik

Serena1432 commented 3 months ago

Uhm yesterday I saw a comment in the configuration file that the CPU must be changed from Penryn to Haswell-noTSX for Sonoma and... my installation I made a month ago booted.

So obvious case of RTFM xD

The background image is not rendering (desktop is white) and audio is broken but who cares.

grafik

"The background image is not rendering" and especially the "Display 7 MB" at the Graphics part mean there's no graphics acceleration at all, so the UI and graphics-related experience will be very bad.

But since we only use it for building the buildscripts, I think the graphics acceleration is not very necessary.

I used to try macOS on VM before, both on VMware and VirtualBox; and I don't know if that was because of my misconfiguration or anything else, but on my computer the macOS performed better on VirtualBox than VMware. But that was macOS Catalina, and I don't know if that also applies to macOS Sonoma, as I already got a MacBook before Sonoma was even released. But yes, there is no way to enable graphics acceleration on virtual machines, especially when no VM software officially supports installing macOS.

Finally, if you can consider it; why don't you try to Hackintosh your PC? That is much better than installing on a VM.

Ghabry commented 3 months ago

It compiled for me after bumping the iphoneos version to "9.0".

Thanks for that contribution.

I will rebase and merge it when #167 is in.

Then it will be become part of our automatic library update system and shouldn't break anytime soon.


yeah I know that it has no hardware acceleration because its just running in KVM on Linux. But it feels faster than my Windows 11 VM.

For testing whether it compiles and runs it is good enough.

Finally, if you can consider it; why don't you try to Hackintosh your PC? That is much better than installing on a VM.

I'm not a fan of macOS. I only use it when testing Player development.

carstene1ns commented 3 months ago

Is the SDL2 IOS patch upstreamed yet?

Ghabry commented 3 months ago

My guess here is that the wrong buildscript for iOS is invoked (the patch looks like replacing macOS headers with iOS headers).

Serena1432 commented 3 months ago

My guess here is that the wrong buildscript for iOS is invoked (the patch looks like replacing macOS headers with iOS headers).

Yes, it actually is; the buildscripts used to accidentally build macOS headers instead of iOS headers and I didn't know why, so I made a manual patch for SDL2 to fix that issue. If you have a better idea, please let me know.

Serena1432 commented 3 months ago

Is the SDL2 IOS patch upstreamed yet?

I don't fully understand what does the "upstreamed" word mean in this situation. Probably because my English is not good. But I made the patch myself for (temporarily) fixing with the buildscripts building macOS headers instead of iOS one.

fdelapena commented 3 months ago

Is the SDL2 IOS patch upstreamed yet?

I don't fully understand what does the "upstreamed" word mean in this situation.

It seems it's about the patch replacing Cocoa with Foundation headers. If it's the solution for everybody using SDL for iOS, then it is worth to be sent to SDL auhors to fix the build there (upstream) instead of keeping that particular patch here or in distributions (downstream). https://en.m.wikipedia.org/wiki/Upstream_(software_development)

Ghabry commented 2 months ago

Don't worry about it. We will fix/ check this before merging.

Ghabry commented 2 months ago

To convince SDL2 that we build for iOS the triplet must contain "-iOS-". Though then I get later build errors because of -Werror,-Wdeclaration-after-statement.

With CMake it builds but only because they didn't enable that -Werror for it. :sweat_smile: (for SDL3 they discuss to just deprecate C89 which would get rid of that warning).

Ghabry commented 2 months ago

Thanks again. I rebased it and made some small changes in #173 . Closing this one.