Recent

Author Topic: FPC not building certain Cocoa units? (eg. Photos.pas)  (Read 1341 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 737
  • Tweaking4All.com
    • Tweaking4All
FPC not building certain Cocoa units? (eg. Photos.pas)
« on: March 28, 2025, 06:52:55 pm »
I'm trying to use the Photos framework (PhotoKit) and I see in the FPC sources that all the appropriate units are there.

Code: [Select]
../fpcsrc/packages/cocoaint/src/Photos.pas
There is a proper Sources.pas as well, which in turn includes the all units I'd need for Photos.
The Makefile in "./fpcsrc/packages/cocoaint/src/" lists the unit as well:

Code: [Select]
${FPC} Photos.pas ${OPTS} ${SINGLE_UNIT}
But after rebuilding FPC from scratch there are no compiled files (related to Photos) to be not found in.

Code: [Select]
~/fpcupdeluxe/fpc/units/aarch64-darwin/cocoaint
FPC does not seem to be building this unit (and a few others).
Other more common Cocoa units are found there, like AVFoundation.

The Lazarus IDE cannot find the unit either when trying to do an autocomplete in the uses clause. However when typing the unit name manually, it DOES find "Photos" and even opens it just fine when right clicking the unit name in the uses clause ("find declaration of Photos").

I read that FPC and Lazarus maintain different config files, so they are not necessarily in sync (Wiki).
But after spending an afternoon trying to figure this out, I'm at a complete loss.

For reference, I've reinstall FPC and Lazarus from scratch today, from trunk, with FPCUpDeluxe;
Lazarus 4.99 (rev main_4_99-1679-g9613485cf8)
FPC 3.3.1 aarch64-darwin-cocoa.
I've seen this problem before with previous versions of FPC and Lazarus.

What am I missing here?
Can anyone help or tell me where or how I can use the Photos.pas unit?

Hansaplast

  • Hero Member
  • *****
  • Posts: 737
  • Tweaking4All.com
    • Tweaking4All
Re: FPC not building certain Cocoa units? (eg. Photos.pas)
« Reply #1 on: March 30, 2025, 04:15:29 pm »
Still trying to figure this out and diffing through code and config files.
Looks like the FPC build sees the file(s) but just is not compiling them.


Not knowing what I'm doing or looking at, but could this somehow be related to these defines in the Photos.pas file?


Code: Pascal  [Select][+][-]
  1. // System Versions MacOSX SDK
  2.  
  3. {$define MAC_OS_X_VERSION_10_0 := 1000}
  4. {$define MAC_OS_X_VERSION_10_1 := 1010}
  5. {$define MAC_OS_X_VERSION_10_2 := 1020}
  6. {$define MAC_OS_X_VERSION_10_3 := 1030}
  7. {$define MAC_OS_X_VERSION_10_4 := 1040}
  8. {$define MAC_OS_X_VERSION_10_5 := 1050}
  9. {$define MAC_OS_X_VERSION_10_6 := 1060}
  10. {$define MAC_OS_X_VERSION_10_7 := 1070}
  11. {$define MAC_OS_X_VERSION_10_8 := 1080}
  12. {$define MAC_OS_X_VERSION_10_9 := 1090}
  13. {$define MAC_OS_X_VERSION_10_10 := 1100}
  14. {$define MAC_OS_X_VERSION_10_11 := 1110}
  15. {$define MAC_OS_X_VERSION_10_12 := 1120}
  16. {$define MAC_OS_X_VERSION_10_13 := 1130}
  17. {$define MAC_OS_X_VERSION_10_14 := 1140}
  18. {$define MAC_OS_X_VERSION_10_15 := 1150}
  19. {$define MAC_OS_X_VERSION_LATEST := MAC_OS_X_VERSION_10_15}

and later on in the code:

Code: Pascal  [Select][+][-]
  1. {$define MAC_OS_X_VERSION_MAX_ALLOWED := MAC_OS_X_VERSION_LATEST}

I noticed in the converted macOS 11.3 headers (link) that these are still in place and that there are no definitions for macOS version beyond 10.15 (even though the files are for 11.3).
If so: how do I modify them as the numbering didn't make sense so me? (eg. 10.8 -> 1080, 10.9 -> 1090, but 10.11 -> 1100, 10.15->1150, what would 11.3 then become?)
« Last Edit: March 31, 2025, 02:52:36 pm by Hansaplast »

Hansaplast

  • Hero Member
  • *****
  • Posts: 737
  • Tweaking4All.com
    • Tweaking4All
Re: FPC not building certain Cocoa units? (eg. Photos.pas)
« Reply #2 on: March 31, 2025, 02:51:30 pm »
Not fixing the issue at hand, ... but did convert the macOS 13.1 SDK AvailabilityVersions.h file.
Just in case this saves others work.
Not sure how to use these in de SDK files though to get the PhotoKit to get compiled by FPC.

Code: Pascal  [Select][+][-]
  1. {$define MAC_OS_X_VERSION_10_0 := 1000}
  2. {$define MAC_OS_X_VERSION_10_1 := 1010}
  3. {$define MAC_OS_X_VERSION_10_2 := 1020}
  4. {$define MAC_OS_X_VERSION_10_3 := 1030}
  5. {$define MAC_OS_X_VERSION_10_4 := 1040}
  6. {$define MAC_OS_X_VERSION_10_5 := 1050}
  7. {$define MAC_OS_X_VERSION_10_6 := 1060}
  8. {$define MAC_OS_X_VERSION_10_7 := 1070}
  9. {$define MAC_OS_X_VERSION_10_8 := 1080}
  10. {$define MAC_OS_X_VERSION_10_9 := 1090}
  11. {$define MAC_OS_X_VERSION_10_10 := 101000}
  12. {$define MAC_OS_X_VERSION_10_10_2 := 101002}
  13. {$define MAC_OS_X_VERSION_10_10_3 := 101003}
  14. {$define MAC_OS_X_VERSION_10_11 := 101100}
  15. {$define MAC_OS_X_VERSION_10_11_2 := 101102}
  16. {$define MAC_OS_X_VERSION_10_11_3 := 101103}
  17. {$define MAC_OS_X_VERSION_10_11_4 := 101104}
  18. {$define MAC_OS_X_VERSION_10_12 := 101200}
  19. {$define MAC_OS_X_VERSION_10_12_1 := 101201}
  20. {$define MAC_OS_X_VERSION_10_12_2 := 101202}
  21. {$define MAC_OS_X_VERSION_10_12_4 := 101204}
  22. {$define MAC_OS_X_VERSION_10_13 := 101300}
  23. {$define MAC_OS_X_VERSION_10_13_1 := 101301}
  24. {$define MAC_OS_X_VERSION_10_13_2 := 101302}
  25. {$define MAC_OS_X_VERSION_10_13_4 := 101304}
  26. {$define MAC_OS_X_VERSION_10_14 := 101400}
  27. {$define MAC_OS_X_VERSION_10_14_1 := 101401}
  28. {$define MAC_OS_X_VERSION_10_14_4 := 101404}
  29. {$define MAC_OS_X_VERSION_10_14_6 := 101406}
  30. {$define MAC_OS_X_VERSION_10_15 := 101500}
  31. {$define MAC_OS_X_VERSION_10_15_1 := 101501}
  32. {$define MAC_OS_X_VERSION_10_15_4 := 101504}
  33. {$define MAC_OS_X_VERSION_10_16 := 101600}
  34. {$define MAC_OS_X_VERSION_11_0 := 110000}
  35. {$define MAC_OS_X_VERSION_11_1 := 110100}
  36. {$define MAC_OS_X_VERSION_11_3 := 110300}
  37. {$define MAC_OS_X_VERSION_11_4 := 110400}
  38. {$define MAC_OS_X_VERSION_11_5 := 110500}
  39. {$define MAC_OS_X_VERSION_11_6 := 110600}
  40. {$define MAC_OS_X_VERSION_12_0 := 120000}
  41. {$define MAC_OS_X_VERSION_12_1 := 120100}
  42. {$define MAC_OS_X_VERSION_12_2 := 120200}
  43. {$define MAC_OS_X_VERSION_12_3 := 120300}
  44. {$define MAC_OS_X_VERSION_13_0 := 130000}
  45. {$define MAC_OS_X_VERSION_13_1 := 130100}
  46. {$define MAC_OS_X_VERSION_LATEST := MAC_OS_X_VERSION_13_1}


 

TinyPortal © 2005-2018