client icon indicating copy to clipboard operation
client copied to clipboard

How to build the client on Mac OS X

Open ozata opened this issue 6 years ago • 20 comments

Expected behaviour

owncloud.app/Contents/Frameworks should exists

Actual behaviour

It does not

Steps to reproduce

  1. Do the mac build steps
  2. Set cmake parameters cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.15.0 -DCMAKE_INSTALL_PREFIX=~/owncloud/build ../
  3. run make
  4. Check bin/owncloud.app/Contents you will see "Info.plist MacOS PlugIns Resources" folders and files but no Frameworks folder.
  5. Download owncloud desktop mac client from official site. Install it, you will see owncloud.app/Contents/Frameworks

Without Frameworks app won't run on Macs with no QT Packages.

ozata avatar Jul 16 '20 11:07 ozata

Hi for 2.7 we switched to Craft on mac. So in a dev environment the client can be directly started in the build dir but for a deployment we use Craft.

We have a new neat script which should help to set up a dev env, https://github.com/owncloud/ownbuild . It not only sets up Craft but also creates a setup identical to the one we use on out ci (versions etc).

Could you give it a try :)

TheOneRing avatar Jul 17 '20 09:07 TheOneRing

Hello, I'm giving it a try now, thanks

ozata avatar Jul 17 '20 10:07 ozata

@TheOneRing I tried the craft but it gave me permission errors (Maybe couldnt connect to the repo.) And as far as I know we can't build 2.6.3 with craft right? And there is no 2.7 release right now?

The error I have: (I'm looking into the script right now) `➜ ownbuild git:(master) sudo python3 build.py owncloud-client Password: Cloning into '/Users/ataoz/owncloud/ownbuild/craftmast'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.`

ozata avatar Jul 20 '20 07:07 ozata

Hi I fixed the url, just do a pull in the ownbuild folder.

I'm sorry I used authenticated git url... thx for testing 🙈

TheOneRing avatar Jul 20 '20 08:07 TheOneRing

ownbuild built but I got an error at the last step, still there's a possibility that I have a successful build, Im trying to open it right now, not sure if error is because of my system. ownbuild build error

The second error is when I'm trying to build 2.

ownbuild git:(master) ✗ python3 build.py --branch 2.7 owncloud-client 
Download: https://raw.githubusercontent.com/owncloud/client/2.7/.craft.ini to /Users/ataoz/owncloud/ownbuild/2.7/.craft.ini
HTTP Error 404: Not Found

ozata avatar Jul 21 '20 08:07 ozata

thx for pointing out I will fix it. For now passing --no-cache should fix it (be sure dependencies are installed first. if not it will build everything from scratch)

TheOneRing avatar Jul 21 '20 08:07 TheOneRing

Should by fixed by https://github.com/owncloud/ownbuild/commit/a6eb57538181b470d0d6801fc2b31f0b9f423d9f

TheOneRing avatar Jul 21 '20 08:07 TheOneRing

error

It stops because of a python error but it was getting past this steps 2 days ago, couldn't understand the error, im trying to debug

ozata avatar Jul 22 '20 09:07 ozata

Fixed in https://invent.kde.org/packaging/craft/commit/f613280429fb44de75b889c13e7f0ac30287e060 but the only way that could happen is if craft failed to create a log file. This can happen with a full disk, see the notification on the screenshot or on Windows when multiple instance are running.

TheOneRing avatar Jul 22 '20 10:07 TheOneRing

Thanks. Process finished successfully but app couldnt be opened because Frameworks folder and some Plugins is not in owncloud.app. (This was my first problem, they dont come when building with generic build instructions too.) Is there a parameter where installs the frameworks and plugins into the owncloud.app

I tried on clean mac machine with only xcode. There is no errors but no QT frameworks or plugins either.

err Screen Shot 2020-07-22 at 15 06 48 Screen Shot 2020-07-22 at 15 06 41 Screen Shot 2020-07-22 at 15 06 33

ozata avatar Jul 22 '20 12:07 ozata

I belive it doesnt install QT noqterror

ozata avatar Jul 22 '20 12:07 ozata

Ah yes you'd need to execute it through the build script by passing --run ./macos-x64..... or by entering a craft env by sourcing the craftenv.sh in the sub folder. The reason for this is that craft will set some environment variables needed.

Another solution is to call the build.py with --package owncloud-client which should produce a .pkg file :)

TheOneRing avatar Jul 22 '20 13:07 TheOneRing

I'm trying the first solution but I got error in second solution: error3

error2 ================================================================= error1

ozata avatar Jul 22 '20 14:07 ozata

python3 build.py -- --package owncloud-client python3 build.py -- --run ./Applications/...

TheOneRing avatar Jul 22 '20 14:07 TheOneRing

I updated the readme https://github.com/owncloud/ownbuild/blob/master/README.md

TheOneRing avatar Jul 22 '20 14:07 TheOneRing

I had this error on one machine with python3 build.py -- --package owncloud-client error1

And this one on the second machine error2

Two different errors looked odd. Second instance kept going longer but stopped in the end.

ozata avatar Jul 23 '20 07:07 ozata

Hi, did you delete the build folder in between? If yes, before you can package owncloud, you need to build it first :) so its build.py -- owncloud-client build.py -- --package owncloud-client

TheOneRing avatar Jul 23 '20 07:07 TheOneRing

I have successfully build with: 🚀

python3 build.py --branch 2.7 owncloud-client
python3 build.py --branch 2.7 -- --package owncloud-client

But it shows 2.8.0 git as the version

Screen Shot 2020-07-23 at 14 20 06

And I have a question. We already have a branded 2.6.3 branch. Could I build that branch with Craft? Or can I edit build.py and build our custom branded branch by changing the links? Do you have any suggestions?

ozata avatar Jul 23 '20 11:07 ozata

2.6 is not supported with craft on mac, and 2.6 is not supported with the build.py at all. The branch command is for builds.py and ensures that you end up with the dependencies for that branch.

To get a 2.7 build run python3 build.py --branch 2.7 -- --target 2.7 owncloud-client same for the package step.

TheOneRing avatar Jul 23 '20 12:07 TheOneRing

Hello Hannah, owncloud builds successfully and easily with craft but we couldn't build our branded version, but we managed it with generic build instructions on Mac OS X. Our problem is solved, so, I'm closing this ticket, thanks for your help.

ozata avatar Aug 06 '20 12:08 ozata