* * *

Author Topic: Is Cocoa the future for Lazarus on macOS?  (Read 1359 times)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5529
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #15 on: July 16, 2017, 06:06:44 pm »
The problem for Lazarus on Mac is not that it can't attract Mac users, but that it can't retain them. And can you blame these users? 32-bit Carbon? gdb? Are you kidding me? That should be the normal reaction to Lazarus. And a quick exit stage right. And that's exactly what happens. Just follow the postings and subsequent silence from new Mac users here.

Too many users, too few developers for Mac indeed. 

Quote
Lazarus on Mac just needs to be something reasonable. Easy to get installed and started with and capable of creating apps that aren't an embarrassment. Carbon needs to be deprecated like GTK1 was. We should be emphasizing the targeting of Cocoa, warts and all.

Setting policies is not useful in a purely volunteer effort. People work on what they work for their own reasons, not because of policies or popularity (exhibit A: the Amiga ports seem to have more devels than Mac)

If you want Cocoa to improve, improve Cocoa or raise money to do so. Oh, and GTK1 was only deprecated long after GTK2 was usable.

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #16 on: July 16, 2017, 06:14:45 pm »
[Oh, and GTK1 was only deprecated long after GTK2 was usable.

Exactly. But the only way to get a usable Cocoa is to log bug reports. And that means to start using Cocoa, which most Mac users never do.


carl_caulkett

  • Full Member
  • ***
  • Posts: 157
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #17 on: July 16, 2017, 06:21:01 pm »
No, Cocoa has to be where Lazarus gets to on Mac. Otherwise, there's no point to it.

As a newcomer to the Apple Mac world, it's taken me a few weeks to appreciate the differences in Widget sets and the effect on Lazarus as an IDE and on apps built with Lazarus. I have to say that while I have been delighted by the quality of the Carbon widget set, I am concerned about where Lazarus is going to be a few years into the future. As I see it, part of the problem is one of perception. Lazarus, built with the Cocoa widget set just looks really unready for wide consumption, and apps built with Cocoa don't look any better. Maybe that's because I'm basing judgement on the 1.9 Lazarus truck source. I haven't yet tried the last stable version. Maybe what's needed is a major push in the next few weeks and months, where efforts are concentrated on making the product look better, even if the bits below the surface are not yet polished. Hopefully, this would attract more users and the Cocoa version of Lazarus would develop some sort of momentum.

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #18 on: July 16, 2017, 06:26:22 pm »
Lazarus, built with the Cocoa widget set just looks really unready for wide consumption, and apps built with Cocoa don't look any better. Maybe that's because I'm basing judgement on the 1.9 Lazarus truck source.

Right, the IDE probably exercises just about the entire widgetset, so it's only going to be as complete as the Cocoa widgetset.

However, the parts of the Cocoa widgetset I've used in the trunk are quite stable and complete. If you have issues with the trunk Cocoa in your apps, then you need to log bug reports with small projects that demo the problems. Yes, that's tedious, wasted time, but it has to be done.


mischi

  • Jr. Member
  • **
  • Posts: 70
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #19 on: July 16, 2017, 06:30:41 pm »
I can see the use case for Qt5 and fink with Lazarus on Mac, but that would be a very small number of developers, perhaps vanishingly small, possibly only experienced developers with large apps who are comfortable with Qt and deploying and supporting Qt (ie, C++ developers). But that is not a solution for the rest of us.

The problem for Lazarus on Mac is not that it can't attract Mac users, but that it can't retain them. And can you blame these users? 32-bit Carbon? gdb? Are you kidding me? That should be the normal reaction to Lazarus. And a quick exit stage right. And that's exactly what happens. Just follow the postings and subsequent silence from new Mac users here.
I agree on the second paragraph, but there are more severe reasons than you give in the first paragraph. My point of view is, that the lcl itself has a number of shortcomings with respect to macOS and violations of the Human Interface Guidelines, independent of its basis, whereas the extra layer of the lcl actually prevents you to deal with subtleties of Qt, at least from most of them. The problem with gdb is also independent of the lcl basis. The point I want to stress is that if the carbon-based lcl was good enough for you so far, chances are good that you can get along for example with the Qt-based lcl. That is what i meant with no reason for despair if the support for carbon stops. The end of lazarus-carbon does simply not put an absolute end to lazarus on macOS. Even if lazarus-cocoa has not reached a sufficient level. Sure enough, without lazarus-carbon the situation becomes even worse on macOS, but lazarus-gtk2 and lazarus-qt4 are already available as fink packages and can be used, although i haven't tested them extensively. As soon as lazarus-cocoa is possible as a release, i will put it together, even if it needs some patches. I'll give lazarus-qt5 a try with version 1.8.0.

I have the impression that when it comes to macOS, people limit their view to the carbon-based lcl and miss all other options.

MiSchi

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #20 on: July 16, 2017, 06:51:02 pm »
I have the impression that when it comes to macOS, people limit their view to the carbon-based lcl and miss all other options.

Right. I don't have a problem with a Carbon-based IDE, or even a Qt-based one that includes all the Qt libraries, but I think it's time to start encouraging the targeting of Cocoa when building your apps.

The way I'm doing that is by creating custom LCL controls for Lazarus that can't be used with Carbon because it's, well, Carbon. For example, the TWebBrowser needs the Cocoa WebView - nothing like that available for Carbon:

https://macpgmr.github.io/MacXPlatform/lclwebbrowser-src.zip

I'm also creating a custom control that wraps the Mapbox SDK, so I started with TWebBrowser since was easier to do. I'm already using Mapbox on the Web in production and the native MacOS SDK is equally awesome:

https://mapbox.github.io/mapbox-gl-native/macos/0.5.0/

It's so cool that I simply had to do a custom LCL control to share the joy.

And note that Mapbox SDK on Mac is a 64-bit Cocoa framework, so no 32-bit, no Carbon need apply.


mischi

  • Jr. Member
  • **
  • Posts: 70
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #21 on: July 16, 2017, 08:14:19 pm »
Right. I don't have a problem with a Carbon-based IDE, or even a Qt-based one that includes all the Qt libraries, but I think it's time to start encouraging the targeting of Cocoa when building your apps.
I agree on that.
The way I'm doing that is by creating custom LCL controls for Lazarus that can't be used with Carbon because it's, well, Carbon. For example, the TWebBrowser needs the Cocoa WebView - nothing like that available for Carbon:

https://macpgmr.github.io/MacXPlatform/lclwebbrowser-src.zip

I'm also creating a custom control that wraps the Mapbox SDK, so I started with TWebBrowser since was easier to do. I'm already using Mapbox on the Web in production and the native MacOS SDK is equally awesome:

https://mapbox.github.io/mapbox-gl-native/macos/0.5.0/

It's so cool that I simply had to do a custom LCL control to share the joy.

And note that Mapbox SDK on Mac is a 64-bit Cocoa framework, so no 32-bit, no Carbon need apply.
As always, I appreciate your work. Sometimes i even find the time to make a fink package description for it.

MiSchi.

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #22 on: July 17, 2017, 12:57:30 am »
Sometimes i even find the time to make a fink package description for it.

And good on you for that.

Wait till you see the Mapbox control for Lazarus, although I can't really claim much credit there. I used Ryan's most excellent parser to parse the entire Mapbox SDK headers (https://github.com/genericptr). And of course the Mapbox lads somehow managed to put all of that stuff into a single 3.5MB library that you include with your app. Take a look at the code below. Even if you don't know Objective C, it should be fairly readable. And how did they achieve that? Well, generous use of white space, consistency in indentation and naming, good organization, and comments where they're needed. Good looking code.

https://github.com/mapbox/mapbox-gl-native/blob/master/platform/macos/src/MGLMapView.mm

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3536
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #23 on: July 17, 2017, 11:47:13 am »
I think that the original post is missing a link, I found something in macrumors:

https://www.macrumors.com/2017/06/06/apple-to-phase-out-32-bit-mac-apps/

Anyway, don't panic people, we'll just need to switch the Lazarus IDE to run in Cocoa. Even if there are some bugs.

wittbo

  • New member
  • *
  • Posts: 22
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #24 on: July 20, 2017, 12:06:59 pm »
Back again. It was a good feeling for me to follow the engaged discussion.
It confirmed my decision, that a switch to Cocoa is the right way. So I started registering for bug tracker and I will post those cocoa bugs I find upon developing with cocoa. Hope that there is a stable cocoa implementation until end of this year.
-wittbo-
Lazarus 1.6.4  with FPC 3.0.2
MacOS 10.10.5

zeljko

  • Hero Member
  • *****
  • Posts: 913
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #25 on: July 21, 2017, 02:44:29 pm »

But is that even true anymore? The Qt 4.8.6 package for Mac is now incompatible with El Capitan and later, probably because it tries to put files in /usr/bin. And I was unable to compile the interface framework for 64-bits.

Laz 1.8 includes support for Qt5, as well as the C++ code for compiling the interface framework yourself, but has any Mac user ever gotten that to work? I posed that question here a while back and got no response, so I would guess we know the answer.

Yes, Qt5 works on Mac (Cocoa 64 bit). Haven't enough time for testing, but it works here in virtual machine, only thing is that you must build libQt5Pas on your own.

esvignolo

  • Full Member
  • ***
  • Posts: 117
  • Using FPC in Windows, Linux, Macos
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #26 on: July 21, 2017, 05:23:19 pm »
Hi zeljko/Phil/or another user :)

How do u make the Qt5Pas.framework, i use from codetyphon (only this framework) and after install qt, i can build from lazarus. But i get this error running the app:

dyld: Library not loaded: /opt/local/libexec/qt5-mac/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
  Referenced from: /Users/esteban/Qt5Pas.framework/Versions/1/Qt5Pas
  Reason: image not found
Abort trap: 6

Or i get this error running macdeployqt: (the other files from framework are copied to framework subdir's app)
ERROR: no file at "/Library/Frameworks/Qt5Pas.framework/Versions/1/Qt5Pas.framework/Versions/1/Qt5Pas"


Thanks !

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #27 on: July 21, 2017, 05:32:03 pm »
dyld: Library not loaded: /opt/local/libexec/qt5-mac/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
  Referenced from: /Users/esteban/Qt5Pas.framework/Versions/1/Qt5Pas
  Reason: image not found
Abort trap: 6

Sounds like it can't find QtWebKitWidgets library. Note that the installation does not make any sense to me. Normally frameworks are installed under /Library/Frameworks or locally inside the .app bundle.

Or i get this error running macdeployqt: (the other files from framework are copied to framework subdir's app)
ERROR: no file at "/Library/Frameworks/Qt5Pas.framework/Versions/1/Qt5Pas.framework/Versions/1/Qt5Pas"

That path makes no sense. Did you copy it here wrong?

esvignolo

  • Full Member
  • ***
  • Posts: 117
  • Using FPC in Windows, Linux, Macos
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #28 on: July 21, 2017, 05:45:07 pm »
I agree with you Phil, for that reason create the directories and a symbolic link, but also the directory QtWebKitWidgets does not exist in my QT installation and install all the components of the installer that is recommended in the wiki. Subsequently probe install with brew install qt, but there is still no such library.

Phil

  • Hero Member
  • *****
  • Posts: 2143
Re: Is Cocoa the future for Lazarus on macOS?
« Reply #29 on: July 21, 2017, 05:50:20 pm »
I agree with you Phil, for that reason create the directories and a symbolic link, but also the directory QtWebKitWidgets does not exist in my QT installation and install all the components of the installer that is recommended in the wiki. Subsequently probe install with brew install qt, but there is still no such library.

I can't help you with CodeTyphon or homebrew. Why don't you start clean with Lazarus and install Qt5 frameworks (under /Library/Frameworks), build Pascal interface library and framework, etc?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus