flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
25.01k stars 1.6k forks source link

Building for MacOS #586

Closed Kricheldorf closed 4 years ago

Kricheldorf commented 5 years ago

This feature request is related to my love for this software.

I had been an avid Arch Linux user for years and had been using Flameshot for a good amount of time.

I just want to know what are the main challenges I will find when I try to build it for Mac. I already tried a little bit and the first problem I faced was QDBusConnection.

Do you know if it's possible to build it for Mac without making modifications to the source code? Do you believe it's possible with some modifications? Or is it actually impossible without a massive code rewrite?

I'll certainly give it another try in my free time, but it would be nice to get a heads up on the amount of work I should expect.

Thank you for your time and keep up with the amazing work!

P.S.: It's actually a question instead of a feature request. If I manage to build it for Mac, I am certainly opening a PR to add instructions to the README file.

P.S.(2): I couldn't find any related PR but maybe I didn't look hard enough. Sorry if it's a duplicate.

electriquo commented 5 years ago

i would LOOOOOVE to see flameshot on my mac!

electriquo commented 5 years ago

@Kricheldorf: did you create a pull request?

Kricheldorf commented 5 years ago

@Kricheldorf: did you create a pull request?

Maybe I didn't try hard enough but I couldn't do it. 😞

If you have some insight that might be helpful, please let me know.

Kricheldorf commented 5 years ago

I am having this problem right now. I believe macOS doesn't have a native dbus service.

image

Another thing that might be a problem is that there are checks for OS in some places. Example:

https://github.com/lupoDharkael/flameshot/blob/abe356a4d812782562aeebd1a70633cd7445844d/src/utils/systemnotification.cpp#L14

ipatch commented 5 years ago

haven't worked with linux in sometime so i may be wrong but I do believe DBUS can be installed using homebrew or macports, that said, not sure how well DBUS would work with Darwin XNU as it kind of uses it's own messaging system which appears to be another way to call / name something IPC from what I understand.

electriquo commented 5 years ago

@ipatch: you could kindly just use brew and check whether dbus is available. let me do that for you :)

$ brew search dbus
==> Formulae
dbus   dbus-glib   libmodbus

$ brew info dbus
dbus: stable 1.12.16 (bottled), HEAD
Message bus system, providing inter-application communication
https://wiki.freedesktop.org/www/Software/dbus
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/dbus.rb
==> Dependencies
Build: xmlto ✘
==> Options
--HEAD
    Install HEAD version

@Kricheldorf: try to install dbus and see whether it solves the issue. id you have brew, then you can do it by invoking

$ brew install dbus
Kricheldorf commented 5 years ago

@y0y0z @ipatch

I installed dbus and ran make again. Same problem. Maybe I need to install the QDBusConnection module separately from Qt? I tried searching for similar errors but no success to this point.

brendaw commented 4 years ago

Hi, @Kricheldorf!

Any progress on building for MacOS?

If you have some news about this I want to know because I'll start playing around with this feature :D

Kricheldorf commented 4 years ago

Hi, @Kricheldorf!

Any progress on building for MacOS?

If you have some news about this I want to know because I'll start playing around with this feature :D

Hey, @brendaw !

No success so far. It's been a while since I tried it. I'll try it again to see if I can do it.

It's good to know this thread is not dead and there are still people wanting to use flameshot with MacOS

4goodapp commented 4 years ago

It's good to know this thread is not dead and there are still people wanting to use flameshot with MacOS

Indeed!

Meanwhile you can try Ksnip. It has similar feature and is multiplatform.

Or, you have this usefull post from r/mac/ .

β‡§βŒ˜-3 (shift-command-3): To take a screen shot of the entire screen. This will result in a image file on your desktop. βŒƒβ‡§βŒ˜-3 (control-shift-command-3):This will take screen shot of your entire screen and have it go straight to the Clipboard. Paste it into any application you want (Mail, Photoshop, Messages, etc). Very handy if you don't want to actually deal with the file sitting on your desktop. β‡§βŒ˜-4 (shift-command-4): To get a crosshair cursor to take a screen shot of just a portion of the screen, press Command Shift 4. Drag over an area. This will result in a image file on your desktop. β‡§βŒ˜-4, followed by space (shift-command-4, followed by space): To take a screen shot of a selected item, such as an open window, an icon, or the Desktop, press Command Shift 4, then press the Spacebar (this one is my favorite by far). The pointer turns into a camera icon that highlights items beneath it, as shown on the left. When the item you want to shoot is highlighted, click the mouse.This will result in a image file on your desktop. βŒƒβ‡§βŒ˜-4 (control-shift-command-4): This will result in a picture of the selected area to the clipboard. βŒƒβ‡§βŒ˜-4, followed by space (control-shift-command-4, followed by space): This brings up the crosshair cursor which allows you to take just a partial screen shot of your screen. If you ever want to change the resulting screenshots from a PNG to a JPG to something else (like PDF), you can do that via a free program called Onyx. Onyx also let's you alter where all screenshots end up. I created a Screenshot folder in my Documents, and then put a shortcut on the Dock.

tnkr commented 4 years ago

Love the app but looking for a way to get the cross compile and make working for AT LEAST MacOS but also getting it up and running in Windows as well. We use this tool a lot for penetration testing.

brendaw commented 4 years ago

Hi, folks!

I have some progress since my message in this issue.

I was able to compile and run flameshot in macOS. The necessary changes was made in my fork and with then you all can build from your Mac. Just clone the fork and run this script (it does all the magic).

See it in action below:

image

The only problem now is that the program does not run properly from terminal, or even when I run it from .app. Actually, it does not run at all in the terminal. Only in .app.

In .app is able to take screenshots, but still has some annoying issues like only taking screenshot when clicking in the tray icon. And I failed to bind some shortcut to open the screenshot dialog.

After all, I think we are more close to have a more stable version of flameshot in macOS.

Any help is welcome to try it out and/or improve it.

OliverDrechsler commented 4 years ago

Hi, folks!

I have some progress since my message in this issue.

I was able to compile and run flameshot in macOS. The necessary changes was made in my fork and with then you all can build from your Mac. Just clone the fork and run this script (it does all the magic).

See it in action below:

image

The only problem now is that the program does not run properly from terminal, or even when I run it from .app. Actually, it does not run at all in the terminal. Only in .app.

In .app is able to take screenshots, but still has some annoying issues like only taking screenshot when clicking in the tray icon. And I failed to bind some shortcut to open the screenshot dialog.

After all, I think we are more close to have a more stable version of flameshot in macOS.

Any help is welcome to try it out and/or improve it.

It worked for me fine!!! Cool ;-) I love flameshot since i'd used it on ubuntu and now on mac!!

realmayus commented 4 years ago

@brendaw Nice work! Do you maybe want to create a PR so that we can have this in the mainstream repository?

AlaaSaadAbdo commented 4 years ago

@brendaw I just tried this but the build failed for me. here's the command output:

make: *** No targets specified and no makefile found.  Stop.
Cloning into 'macdeployqtfix'...
remote: Enumerating objects: 82, done.
remote: Total 82 (delta 0), reused 0 (delta 0), pack-reused 82
Receiving objects: 100% (82/82), 19.48 KiB | 6.49 MiB/s, done.
Resolving deltas: 100% (41/41), done.
Error: Could not find app bundle "flameshot.app"
INFO | fixing executable 'flameshot.app/Contents/MacOS/flameshot'
INFO | fixing plugins
INFO | macdeployqtfix terminated with success
mv: rename /Users/amansour/flameshot/build/flameshot.app to ./flameshot.app: No such file or directory
created: /Users/amansour/flameshot/dist/flameshot.dmg

Cheers! and thanks :)

brendaw commented 4 years ago

@brendaw Nice work! Do you maybe want to create a PR so that we can have this in the mainstream repository?

@realmayus yes, I'll do this. Before create the PR, I just need to validate if Travis will generate the package correctly for macOS. Probably in this week I'll check this in my fork and then create the PR.

@brendaw I just tried this but the build failed for me. here's the command output:

make: *** No targets specified and no makefile found.  Stop.
Cloning into 'macdeployqtfix'...
remote: Enumerating objects: 82, done.
remote: Total 82 (delta 0), reused 0 (delta 0), pack-reused 82
Receiving objects: 100% (82/82), 19.48 KiB | 6.49 MiB/s, done.
Resolving deltas: 100% (41/41), done.
Error: Could not find app bundle "flameshot.app"
INFO | fixing executable 'flameshot.app/Contents/MacOS/flameshot'
INFO | fixing plugins
INFO | macdeployqtfix terminated with success
mv: rename /Users/amansour/flameshot/build/flameshot.app to ./flameshot.app: No such file or directory
created: /Users/amansour/flameshot/dist/flameshot.dmg

Cheers! and thanks :)

@AlaaSaadAbdo please, show more logs for debug.

AlaaSaadAbdo commented 4 years ago

@brendaw I would love to add more. What else do you need?

zecevic-matej commented 4 years ago

@od2017 script, just as for @AlaaSaadAbdo, does not work for me.

I actually encounter some qmake related errors seemingly.

I'm using a fresh install of Mac OS 10.15.4, therefore, some dependencies are possibly missing.

Here is the log:

➜  macos git:(osx-support) βœ— sh build.sh
Warning: qt 5.15.0 is already installed and up-to-date
To reinstall 5.15.0, run `brew reinstall qt`
Info: creating stash file /Users/mzecevic/flameshot/build/.qmake.stash
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_es.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_es.qm'...
    Generated 151 translation(s) (151 finished and 0 unfinished)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_ca.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_ca.qm'...
    Generated 126 translation(s) (124 finished and 2 unfinished)
    Ignored 24 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_ru.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_ru.qm'...
    Generated 156 translation(s) (156 finished and 0 unfinished)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_zh_CN.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_zh_CN.qm'...
    Generated 169 translation(s) (169 finished and 0 unfinished)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_zh_TW.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_zh_TW.qm'...
    Generated 132 translation(s) (129 finished and 3 unfinished)
    Ignored 24 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_tr.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_tr.qm'...
    Generated 149 translation(s) (148 finished and 1 unfinished)
    Ignored 7 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_ka.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_ka.qm'...
    Generated 132 translation(s) (129 finished and 3 unfinished)
    Ignored 24 untranslated source text(s)
Warning: dropping duplicate messages in '/Users/mzecevic/flameshot/build/translations/Internationalization_fr.qm':

* Context: SidePanelWidget
* Source: Grab Color

* Context: SidePanelWidget
* Source: Active color:

* Context: SidePanelWidget
* Source: Press ESC to cancel

Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_fr.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_fr.qm'...
    Generated 149 translation(s) (149 finished and 0 unfinished)
    Ignored 3 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_pl.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_pl.qm'...
    Generated 146 translation(s) (146 finished and 0 unfinished)
    Ignored 4 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_ja.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_ja.qm'...
    Generated 154 translation(s) (154 finished and 0 unfinished)
    Ignored 2 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_pt_br.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_pt_br.qm'...
    Generated 150 translation(s) (150 finished and 0 unfinished)
    Ignored 2 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_sr.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_sr.qm'...
    Generated 154 translation(s) (154 finished and 0 unfinished)
    Ignored 2 untranslated source text(s)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_uk.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_uk.qm'...
    Generated 156 translation(s) (156 finished and 0 unfinished)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_de_DE.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_de_DE.qm'...
    Generated 153 translation(s) (153 finished and 0 unfinished)
Updating '/Users/mzecevic/flameshot/build/translations/Internationalization_sk.qm'...
Removing translations equal to source text in '/Users/mzecevic/flameshot/build/translations/Internationalization_sk.qm'...
    Generated 168 translation(s) (168 finished and 0 unfinished)
Makefile:1210: warning: overriding commands for target `flameshot.app/Contents/Resources/flameshot.icns'
Makefile:1206: warning: ignoring old commands for target `flameshot.app/Contents/Resources/flameshot.icns'
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DAPP_VERSION=\"v0.6.0-74-gae0233a\" -DQT_DEPRECATED_WARNINGS -DQAPPLICATION_CLASS=QApplication -DAPP_PREFIX=\"/usr\" -DIMGUR_CLIENT_ID=\"313baf0c7b4d3ff\" -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I../../flameshot -I. -I../src/third-party/singleapplication -I../src/third-party/Qt-Color-Widgets/src -I../src/third-party/Qt-Color-Widgets/include -I/usr/local/Cellar/qt/5.15.0/lib/QtSvg.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtNetwork.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtDBus.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.15.0/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.15.0/lib -o singleapplication.o ../src/third-party/singleapplication/singleapplication.cpp
../src/third-party/singleapplication/singleapplication.cpp:110:17: warning:
      'start' is deprecated: Use QProcess::start(const QString &program, const
      QStringList &arguments,OpenMode mode = ReadWrite) instead
      [-Wdeprecated-declarations]
        process.start( QStringLiteral("whoami") );
                ^
/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qprocess.h:164:5: note:
      'start' has been explicitly marked deprecated here
    QT_DEPRECATED_X(
    ^
/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qglobal.h:294:33: note:
      expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note:
      expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
1 warning generated.
/Library/Developer/CommandLineTools/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DAPP_VERSION=\"v0.6.0-74-gae0233a\" -DQT_DEPRECATED_WARNINGS -DQAPPLICATION_CLASS=QApplication -DAPP_PREFIX=\"/usr\" -DIMGUR_CLIENT_ID=\"313baf0c7b4d3ff\" -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I../../flameshot -I. -I../src/third-party/singleapplication -I../src/third-party/Qt-Color-Widgets/src -I../src/third-party/Qt-Color-Widgets/include -I/usr/local/Cellar/qt/5.15.0/lib/QtSvg.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtNetwork.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtDBus.framework/Headers -I/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.15.0/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.15.0/lib -o color_wheel.o ../src/third-party/Qt-Color-Widgets/src/color_wheel.cpp
../src/third-party/Qt-Color-Widgets/src/color_wheel.cpp:68:44: warning:
      'background' is deprecated: Use QPalette::window() instead
      [-Wdeprecated-declarations]
        QColor bgColor = widget->palette().background().color();
                                           ^
/usr/local/Cellar/qt/5.15.0/lib/QtGui.framework/Headers/qpalette.h:148:5: note:
      'background' has been explicitly marked deprecated here
    QT_DEPRECATED_X("Use QPalette::window() instead")
    ^
/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qglobal.h:294:33: note:
      expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note:
      expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
../src/third-party/Qt-Color-Widgets/src/color_wheel.cpp:350:22: error: variable
      has incomplete type 'QPainterPath'
        QPainterPath clip;
                     ^
/usr/local/Cellar/qt/5.15.0/lib/QtGui.framework/Headers/qmatrix.h:54:7: note:
      forward declaration of 'QPainterPath'
class QPainterPath;
      ^
1 warning and 1 error generated.
make: *** [color_wheel.o] Error 1
Cloning into 'macdeployqtfix'...
remote: Enumerating objects: 82, done.
remote: Total 82 (delta 0), reused 0 (delta 0), pack-reused 82
Unpacking objects: 100% (82/82), done.
ERROR: Could not find bundle binary for "flameshot.app"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
WARNING:
WARNING: Could not find any external Qt frameworks to deploy in "flameshot.app"
WARNING: Perhaps macdeployqt was already used on "flameshot.app" ?
WARNING: If so, you will need to rebuild "flameshot.app" before trying again.
ERROR: Could not find bundle binary for "flameshot.app"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/strip: can't open file:  (No such file or directory)\n"
ERROR: ""
INFO | fixing executable 'flameshot.app/Contents/MacOS/flameshot'
INFO | fixing plugins
INFO | macdeployqtfix terminated with success
mkdir: Flameshot: File exists
mv: rename /Users/mzecevic/flameshot/build/flameshot.app to ./flameshot.app: Directory not empty
ln: ./Applications/Applications: File exists
hdiutil: create failed - File exists
majormoses commented 4 years ago

I think that might be missing https://formulae.brew.sh/formula/binutils doing a bit of sleuthing on a working linux instance:

$ which objdump 
/usr/bin/objdump

$ dpkg -S /usr/bin/objdump
binutils: /usr/bin/objdump

$ which strip
/usr/bin/strip

$ dpkg -S /usr/bin/strip
binutils: /usr/bin/strip

I don't use or have a mac to test but thats my semi educated guess. It could also be that thats installed but in a different context and the app is looking for it elsewhere.

enricozb commented 4 years ago

@majormoses @zecevic-matej

I'm not sure how this was able to build before but, I was able to get it to build by adding #include <QPainterPath> to the following files:

Here's a diff for exactly where I added the #include statements.

I also do have binutils installed, so I'm not sure if that is required or not.

enricozb commented 4 years ago

Here is a very stupid way of taking a screenshot from the terminal, given that flameshot is running.

Save this to flameshot.scpt:

tell application "System Events" to tell process "flameshot"
  click menu bar item of menu bar 2
end tell

Now you can do osascript flameshot.scpt

borgmanJeremy commented 4 years ago

@brendaw The codebase has changed quite a bit since this was opened, but I would be happy to help you integrate the MacOS changes if you could help validate them.

pen-pal commented 4 years ago

I got the following error while trying to build it on Darwin masks-MacBook-Air.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64

/usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'                                                                                                                                                                                                         
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))                                                                                                                                                                                                                                                                  
                                                      ^                                                                                                                                                                                                                                                                                       
../src/third-party/Qt-Color-Widgets/src/color_wheel.cpp:350:22: error: variable has incomplete type 'QPainterPath'                                                                                                                                                                                                                            
        QPainterPath clip;                                                                                                                                                                                                                                                                                                                    
                     ^                                                                                                                                                                                                                                                                                                                        
/usr/local/Cellar/qt/5.15.0/lib/QtGui.framework/Headers/qmatrix.h:54:7: note: forward declaration of 'QPainterPath'                                                                                                                                                                                                                           
class QPainterPath;                                                                                                                                                                                                                                                                                                                           
      ^                                                                                                                                                                                                                                                                                                                                       
1 warning and 1 error generated.                                                                                                                                                                                                                                                                                                              
make: *** [color_wheel.o] Error 1                                                                                                                                                                                                                                                                                                             
Cloning into 'macdeployqtfix'...                                                                                                                                                                                                                                                                                                              
remote: Enumerating objects: 82, done.
remote: Total 82 (delta 0), reused 0 (delta 0), pack-reused 82
Unpacking objects: 100% (82/82), 19.46 KiB | 45.00 KiB/s, done.
ERROR: Could not find bundle binary for "flameshot.app"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
ERROR: "/Library/Developer/CommandLineTools/usr/bin/objdump: error: '': No such file or directory\n"
WARNING:
WARNING: Could not find any external Qt frameworks to deploy in "flameshot.app"
WARNING: Perhaps macdeployqt was already used on "flameshot.app" ?
WARNING: If so, you will need to rebuild "flameshot.app" before trying again.
ERROR: Could not find bundle binary for "flameshot.app"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/strip: can't open file:  (No such file or directory)\n"
ERROR: ""
INFO | fixing executable 'flameshot.app/Contents/MacOS/flameshot'
INFO | fixing plugins
INFO | macdeployqtfix terminated with success
...
created: /private/tmp/flameshot/flameshot/dist/flameshot.dmg
borgmanJeremy commented 4 years ago

Are you building from the master branch?

pen-pal commented 4 years ago

I am building from the branch mentioned * osx-support

Are you building from the master branch?

borgmanJeremy commented 4 years ago

Ok you will need to rebase on the master branch. This issue (and many other issues) are resolved on the master branch.

pen-pal commented 4 years ago

Ok you will need to rebase on the master branch. This issue (and many other issues) are resolved on the master branch.

Just to be clear, I should checkout to master branch and run the script to build for mac now? Because I am confused to be honest.

borgmanJeremy commented 4 years ago

That's a good first step but I can't help too much. Macos is not officially supported because I don't have a MacBook and apple forces devs to use a MacBook when developing for macos.

pen-pal commented 4 years ago

That's a good first step but I can't help too much. Macos is not officially supported because I don't have a MacBook and apple forces devs to use a MacBook when developing for macos.

You mean I need to checkout to the master branch of this repo https://github.com/flameshot-org/flameshot/ or this one https://github.com/brendaw/flameshot/

What else suggestion you have can you guide me through, that would be a great help :)

borgmanJeremy commented 4 years ago

I recommend you checkout https://github.com/flameshot-org/flameshot/

I don't know much about MacOs, but I think then you would brew install the dependencies. After that this is a cmake project so you should just be able to follow the linux compilation directions and begin working through issues.

hosiet commented 4 years ago

It's worth mentioning that flameshot never provided macOS support. If you encounter issues on macOS, you will need to figure it out by yourself or seek help from other macOS exports. I don't believe any of the current active contributors are familiar with macOS.

The patches mentioned earlier in #586 cannot be directly applied on recent releases due to recent switch from QMake to CMake.

If you are a developer on macOS that is familiar with macOS porting, please do join the development of flameshot and provide patches to make flameshot build and run smoothly on macOS.

borgmanJeremy commented 4 years ago

@hosiet @M-A-N-I-S-H-K

Okay I had time to check this out during CI runs today. I installed MacOs in a VM and can build flameshot no problem.

I used brew to install qt5, cmake, and git. When brew installed qt5 it gave me some instructions on how to properly setup the local PATH.

Then I built with standard cmake commands and ran from the terminal no problem. Qt + cmake = cross platform magic :)

I did see some strange behavior where windows are hidden when flameshot launches so if we want to actually add beta support for Mac this will need to be fixed and it would be nice to get a committed MacOS developer for the early work.

If one of you tries this and wants to submit a PR to update the docs that would be great otherwise I can when other high priority stuff is done.

image

mktoaster commented 4 years ago

https://github.com/flameshot-org/flameshot/issues/586#issuecomment-623054095

Just ran this and not sure what happened, but it nuked my Mac user profile. ~/Library/ is gone and ~/Desktop is gone. Bash history, keychain, the whole shebang. Docs and downloads are still there, luckily.

I ran the script a second time to re-build and it just nuked everything.

Pretty sure it was line 17 rm -rf $BUILD_FOLDER -- because the first time it made the folder /Users/dist/ which i thought was weird.

Fuck this sucks.

borgmanJeremy commented 4 years ago

ah, thats really unfortunate. I should point out that that script is totally incorrect at this point since we transitioned to cmake. Sorry about the data loss :/ not sure how to help there.

mktoaster commented 4 years ago

ah, thats really unfortunate. I should point out that that script is totally incorrect at this point since we transitioned to cmake. Sorry about the data loss :/ not sure how to help there.

No worries -- I can piece together backups. I learned that reading is important.

borgmanJeremy commented 4 years ago

So the master branch actually builds fine with no modifications. I am going to close this issue.

Simply brew install qt5, and cmake, and then build the project.

EugeneSnikhovskiy commented 4 years ago

@borgmanJeremy Sorry for stupid question. I install qt5, cmake and during build on macos 10.15.7 I receive an error

eugenes-iMac:build eugene$ cmake ../
CMake Warning at cmake/Cache.cmake:28 (message):
  ccache is enabled but was not found.  Not using it
Call Stack (most recent call first):
  CMakeLists.txt:36 (include)

CMake Error at external/singleapplication/CMakeLists.txt:14 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!
See also "/Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

The system is: Darwin - 19.6.0 - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /Library/Developer/CommandLineTools/usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
0

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"

The CXX compiler identification is AppleClang, found in "/Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/3.18.4/CompilerIdCXX/a.out"

Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_cbbe3/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_cbbe3.dir/build.make CMakeFiles/cmTC_cbbe3.dir/build
Building CXX object CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o
/Library/Developer/CommandLineTools/usr/bin/c++   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -v -Wl,-v -o CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/CMakeCXXCompilerABI.cpp
Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument]
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/v1"
 "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.6 -fcompatibility-qualified-id-block-type-checking -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -fdeprecated-macro -fdebug-compilation-dir /Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/CMakeCXXCompilerABI.cpp
clang -cc1 version 12.0.0 (clang-1200.0.32.21) default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
 /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks (framework directory)
End of search list.
Linking CXX executable cmTC_cbbe3
/usr/local/Cellar/cmake/3.18.4/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cbbe3.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/c++  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  -v -Wl,-v CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_cbbe3 
Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 10.15.0 10.15.6 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o cmTC_cbbe3 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-609
BUILD 18:16:50 Sep 24 2020
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib
Framework search paths:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/

Parsed CXX implicit include dir info from above output: rv=done
  found start of include info
  found start of implicit include info
    add: [/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1]
    add: [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include]
    add: [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include]
    add: [/Library/Developer/CommandLineTools/usr/include]
  end of search list found
  collapse include dir [/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1] ==> [/Library/Developer/CommandLineTools/usr/include/c++/v1]
  collapse include dir [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include] ==> [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include]
  collapse include dir [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include]
  collapse include dir [/Library/Developer/CommandLineTools/usr/include] ==> [/Library/Developer/CommandLineTools/usr/include]
  implicit include dirs: [/Library/Developer/CommandLineTools/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include;/Library/Developer/CommandLineTools/usr/include]

Parsed CXX implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command(s):/usr/bin/make cmTC_cbbe3/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_cbbe3.dir/build.make CMakeFiles/cmTC_cbbe3.dir/build]
  ignore line: [Building CXX object CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o]
  ignore line: [/Library/Developer/CommandLineTools/usr/bin/c++   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -v -Wl -v -o CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/CMakeCXXCompilerABI.cpp]
  ignore line: [Apple clang version 12.0.0 (clang-1200.0.32.21)]
  ignore line: [Target: x86_64-apple-darwin19.6.0]
  ignore line: [Thread model: posix]
  ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin]
  ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]]
  ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/v1"]
  ignore line: [ "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.6 -fcompatibility-qualified-id-block-type-checking -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -fdeprecated-macro -fdebug-compilation-dir /Volumes/WORKSPACE/projects/flameshot/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/CMakeCXXCompilerABI.cpp]
  ignore line: [clang -cc1 version 12.0.0 (clang-1200.0.32.21) default target x86_64-apple-darwin19.6.0]
  ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/include"]
  ignore line: [ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/Library/Frameworks"]
  ignore line: [#include "..." search starts here:]
  ignore line: [#include <...> search starts here:]
  ignore line: [ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1]
  ignore line: [ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include]
  ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include]
  ignore line: [ /Library/Developer/CommandLineTools/usr/include]
  ignore line: [ /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks (framework directory)]
  ignore line: [End of search list.]
  ignore line: [Linking CXX executable cmTC_cbbe3]
  ignore line: [/usr/local/Cellar/cmake/3.18.4/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cbbe3.dir/link.txt --verbose=1]
  ignore line: [/Library/Developer/CommandLineTools/usr/bin/c++  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names  -v -Wl -v CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_cbbe3 ]
  ignore line: [Apple clang version 12.0.0 (clang-1200.0.32.21)]
  ignore line: [Target: x86_64-apple-darwin19.6.0]
  ignore line: [Thread model: posix]
  ignore line: [InstalledDir: /Library/Developer/CommandLineTools/usr/bin]
  link line: [ "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 10.15.0 10.15.6 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o cmTC_cbbe3 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a]
    arg [/Library/Developer/CommandLineTools/usr/bin/ld] ==> ignore
    arg [-demangle] ==> ignore
    arg [-lto_library] ==> ignore, skip following value
    arg [/Library/Developer/CommandLineTools/usr/lib/libLTO.dylib] ==> skip value of -lto_library
    arg [-dynamic] ==> ignore
    arg [-arch] ==> ignore
    arg [x86_64] ==> ignore
    arg [-platform_version] ==> ignore
    arg [macos] ==> ignore
    arg [10.15.0] ==> ignore
    arg [10.15.6] ==> ignore
    arg [-syslibroot] ==> ignore
    arg [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk] ==> ignore
    arg [-o] ==> ignore
    arg [cmTC_cbbe3] ==> ignore
    arg [-search_paths_first] ==> ignore
    arg [-headerpad_max_install_names] ==> ignore
    arg [-v] ==> ignore
    arg [CMakeFiles/cmTC_cbbe3.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
    arg [-lc++] ==> lib [c++]
    arg [-lSystem] ==> lib [System]
    arg [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a]
  Library search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib]
  Framework search paths: [;/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/]
  remove lib [System]
  remove lib [/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.osx.a]
  collapse library dir [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib]
  collapse framework dir [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/] ==> [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks]
  implicit libs: [c++]
  implicit dirs: [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib]
  implicit fwks: [/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks]

Can you help me with this error?

borgmanJeremy commented 4 years ago

Yeah I resolved that with this post. https://stackoverflow.com/questions/40081327/macos-sierra-cmake-failed-with-qt5. If you want to add that to the readme I'd gladly merge it

EthianWong commented 3 years ago

@hosiet @M-A-N-I-S-H-K

Okay I had time to check this out during CI runs today. I installed MacOs in a VM and can build flameshot no problem.

I used brew to install qt5, cmake, and git. When brew installed qt5 it gave me some instructions on how to properly setup the local PATH.

Then I built with standard cmake commands and ran from the terminal no problem. Qt + cmake = cross platform magic :)

I did see some strange behavior where windows are hidden when flameshot launches so if we want to actually add beta support for Mac this will need to be fixed and it would be nice to get a committed MacOS developer for the early work.

If one of you tries this and wants to submit a PR to update the docs that would be great otherwise I can when other high priority stuff is done.

image

@borgmanJeremy So how to display window when flameshot launches

borgmanJeremy commented 3 years ago

@thepurple has done quite a bit of work to get flameshot working well on MacOs. I am going to merge content from his fork to the upstream this weekend and I'll chime in here once its done.

pen-pal commented 3 years ago

@borgmanJeremy is this merged to upstream??

borgmanJeremy commented 3 years ago

Yeah a good portion of it. I'm using it on Mac right now.

pen-pal commented 3 years ago

I now started getting new errors @borgmanJeremy

[ 16%] Building CXX object src/CMakeFiles/flameshot.dir/core/controller.cpp.o
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:288:30: warning: 'screenNumber' is deprecated: Use QGuiApplication::screenAt() [-Wdeprecated-declarations]
        n = qApp->desktop()->screenNumber(globalCursorPos);
                             ^
/usr/local/opt/qt/lib/QtWidgets.framework/Headers/qdesktopwidget.h:75:5: note: 'screenNumber' has been explicitly marked deprecated here
    QT_DEPRECATED_X("Use QGuiApplication::screenAt()") int screenNumber(const QPoint &) const;
    ^
/usr/local/opt/qt/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/opt/qt/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:395:52: error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'
    if (currentMacOsVersion >= currentMacOsVersion.MacOSBigSur) {
                               ~~~~~~~~~~~~~~~~~~~ ^
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:407:51: error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'
    if (currentMacOsVersion < currentMacOsVersion.MacOSBigSur) {
                              ~~~~~~~~~~~~~~~~~~~ ^
1 warning and 2 errors generated.
make[2]: *** [src/CMakeFiles/flameshot.dir/core/controller.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/flameshot.dir/all] Error 2
make: *** [all] Error 2
borgmanJeremy commented 3 years ago

Ahh I'm on Catalina. @thepurple is BigSur support in the works?

swyxio commented 3 years ago

for those with the CMAKE_MODULE_PATH error

i solved it with cmake .. -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.15.2/ - source

LiLister commented 3 years ago

I now started getting new errors @borgmanJeremy

[ 16%] Building CXX object src/CMakeFiles/flameshot.dir/core/controller.cpp.o
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:288:30: warning: 'screenNumber' is deprecated: Use QGuiApplication::screenAt() [-Wdeprecated-declarations]
        n = qApp->desktop()->screenNumber(globalCursorPos);
                             ^
/usr/local/opt/qt/lib/QtWidgets.framework/Headers/qdesktopwidget.h:75:5: note: 'screenNumber' has been explicitly marked deprecated here
    QT_DEPRECATED_X("Use QGuiApplication::screenAt()") int screenNumber(const QPoint &) const;
    ^
/usr/local/opt/qt/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/local/opt/qt/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:395:52: error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'
    if (currentMacOsVersion >= currentMacOsVersion.MacOSBigSur) {
                               ~~~~~~~~~~~~~~~~~~~ ^
/Users/mask/Learn/flameshot/flameshot/src/core/controller.cpp:407:51: error: no member named 'MacOSBigSur' in 'QOperatingSystemVersion'
    if (currentMacOsVersion < currentMacOsVersion.MacOSBigSur) {
                              ~~~~~~~~~~~~~~~~~~~ ^
1 warning and 2 errors generated.
make[2]: *** [src/CMakeFiles/flameshot.dir/core/controller.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/flameshot.dir/all] Error 2
make: *** [all] Error 2

I have cloned the latest code from the original project and following the README.md, build out the app successfully. Have a try and good luck to you.

karlhorky commented 3 years ago

Nice, really cool to see this working on macOS, thanks!!

I've opened an issue to see if there's any openness to adding a Homebrew cask: https://github.com/flameshot-org/flameshot/issues/1475