Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OS X] Improve client build and packaging instructions #5594

Closed
Delta-38 opened this issue Mar 10, 2017 · 10 comments
Closed

[OS X] Improve client build and packaging instructions #5594

Delta-38 opened this issue Mar 10, 2017 · 10 comments

Comments

@Delta-38
Copy link

Hello, we are trying to build the Mac client for owncloud (after successfully building the windows and Linux clients) however, even following the instructions to the letter, and trying on several different development Macs at our office, we cannot get it to complete.

We are trying to build on a Mac with OSX 10.12 and have tried both building with qt4 (with the corresponding option on ) and with qt5 (trie 5.6, 5.7 and about to try with 5.8...)

We have faced the following issues:

1)The instructions for MacOSX aren't very clear as to the actual folder structure that has to be attained relative to the client and qtkeychain projects, there is frequent reference to install-prefix dirs, but it is unclear as to wheter the qtkeychain cmake and the client cmake should aim at the same folder or not. Other references to build-dir, install-dir are often unclear as to what they refer to.
2) Is there a way to use the installed version of Qt (The ones coming with the Qt installer rather than the brew version? ) This is a recent iMac and after 140 minutes it is still stuck in the brew install qt5 ... step... (The comments related to other sections of the install process have already been run on other machines here)

  1. When we run cmake on the client it comments not finding iconv.h we tried solving this pointing CMAKE_PREFIX_PATH to the Qt lib folder, but the problem reemerged in the create_mac.sh phase.
    4)We also get an error in the creation of the package where it says macosx.pkgproj is not a packages project file. (On the machine that got furthest with the build attempts).
    4.1) On this machine the owncloud.app runs, but the created package won't run on other Macs, we tried with running macdeployqt over the .app but it didn't help.
  2. the documented "use QT4" cmake parameter is ignored. When used we get the warning qt5 was not found.

I understand it is a lot to ask and probably several separate comple issues, but we are stumped and we would love to get some help with the build.
We feel that the Mac build process documentation could use some love, a probably a bit less optimism. :)

Paolo Manili

Client configuration

Client version:2.3.0
Operating system: OSX 10.12
OS language: Italian

@Delta-38
Copy link
Author

Hi, we finally got it to build successfully, I am posting the steps we followed and some friendly suggestions for the documentation :) :

We eventually managed to build first the standard owncloud and then our customized version.

We identified two separate problems that were stopping us:
We had first to proceed to the older "brew install qtkeychain" approach to get a usable keychain, as per this old blogpost:
https://jose-manuel.me/2014/02/compile-latest-owncloud-client-mac-osx-mavericks/
The second thing that was unclear is that the installer cannot be created correctly if you don't run make install on the mac_build dir. Given this part was marked optional and it seemed counterintuitive to install on the development machine (As we felt it would potentially alter the environment). Once that was done, the installer produced by mac_create_build.sh worked as expected and a usable installer was produced.

We also had to call packages manually as we coulnd't figure out the right parameters from the error using the .sh version:
This worked for us: run from /pathtoowncloud/mac_build/
581 /usr/local/bin/packagesbuild -F ../install/ admin/osx/macosx.pkgproj

So I guess we have to apologize for misunderstanding part of the documentation.
However, we would suggest the following changes to the documentation:

Specify absolute path (With some example path given) for all operations pertaining the mix and match of owncloud and qtkeychain otherwise it is terribly easy to mixup what goes where and the number of libs not found by simple path mistake gives few clews as to where we screwed up. We still don't know, as we eventually used the brew supplied keychain.

The documentation makes abundant use of "install" as a word and target dir, but it is not always clear if what is meant is a system install, a build dir, an include dir or what. This can probably be fixed by slightly more abundant comments.

The make install part is "NOT" optional for a functional installer being built, and should either be mentioned in the "#installer" documentation or the build phase.

I also feel it would probably also help if the different build processes were in consecutive sections throughout the process so Mac from scratch to installer, windows same, unix same, jumping back and forth is confusing when unfamiliar with the project and tech.

It would also help immensely if a default "will work for most of you guys" cmake command was provided and leaving advanced options for the more savvy users, whereas it is currenty the opposite as a complicated unexplained command is given:
This is provided: cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/install/ -D_OPENSSL_LIBDIR=/usr/local/opt/openssl/lib/ -D_OPENSSL_INCLUDEDIR=/usr/local/opt/openssl/include/ -D_OPENSSL_VERSION=1.0.2a -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ -DNO_SHIBBOLETH=1
For example I still don't know what shibboleth is, and I googled for it... :)

this is not:
cmake -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX=../install ..

TL:DR:
Not your fault but the documentation is a bit vague :)

Thanks in advance,
Paolo Manili

@guruz
Copy link
Contributor

guruz commented Mar 16, 2017

Could you please send a pull request with documentation fixes?

:)

@SamuAlfageme SamuAlfageme changed the title Mac OSX client build process [OS X] Improve client build and packaging instructions Mar 16, 2017
@settermjd
Copy link
Contributor

@Delta-38 thanks for the details. I'm going to step through the process this afternoon and see what I find.

@guruz guruz assigned settermjd and unassigned guruz Apr 10, 2017
@settermjd
Copy link
Contributor

settermjd commented May 2, 2017

It's been a while since I looked at this. But I'm looking at it this week. I'm thinking that the simplest way to resolve it going forward is to create a shell script that can be run on macOS.

@Delta-38
Copy link
Author

Delta-38 commented May 2, 2017 via email

@settermjd
Copy link
Contributor

I've gone through the steps and have been able to build it. But there are steps that I don't understand, which I need more information on before I can document it. And I agree that the process isn't documented correctly (and is overly complicated).

@settermjd settermjd added the WIP label May 24, 2017
@Delta-38
Copy link
Author

Delta-38 commented May 24, 2017 via email

@settermjd
Copy link
Contributor

Sorry, I see that I dropped the proverbial ball on this one. Picking it up again to conclusion now.

@ArthurChiao
Copy link
Contributor

ArthurChiao commented Nov 10, 2017

hi @ALL,

I've also built a client installer for MAC OSX after a trial and error process. I'd like to share some info with you.

Main references:

  1. owncloud 2.3 build guide
  2. owncloud 2.1 build guide
  3. Install QT with WebKit (OSX 10.12)

os and software versions:

  • OS: MAC OSX 10.12.6
  • xcode: 9.1 (full version, download from App Store)
  • brew: 1.3.6
  • MacPorts: 2.4.0
  • client: 2.2 (customized, but i think official client code should also be ok)
  • qt: 5.5.1 (get through qmake --version)
  • qt-webkit: ? (installed through macport)

Problems & Solutions:

  1. qtkeychain

    Compile and install this from source. If you encountered version mismatch problem, check out a previous tag (e.g. I fall back to v0.5.0), compile and install.

    $ git clone https://github.com/frankosterfeld/qtkeychain.git
    $ git checkout -b <br> <tag>
    $ cmake -D DCMAKE_INSTALL_PREFIX=<path to cdrive make-install dir>
    $ make && make install
    
  2. Install QT with WebKit

    I cannot install QT with webkit by following the official docs. Later QT versions (e.g. 5.9) has dropped the WebKit support, I tried many methods, and finally get it installed by following Reference 3 in the above, using macports tool.

  3. Mistakes in official doc

    Correct format: ./admin/osx/create_mac.sh <your-make-install-dir> <your build dir>, the doc got the two paths opposite. After success, the installer will be placed in ../install/

    Example usage:

    $ cd client-build
    $ ./admin/osx/create_mac.sh ../client-install ./
    
  4. Dynamic library dependencies

    When packing the compiled client into an installer, the packing scripts ignores the dylib version, which may result to the installed client crashes on startup, because it references lower version libs (e.g. libxml2.2.dylib) in system path.

    This problem need more space to explain, a quick remedy is to modify FindSystemLibrary(), let it always return None, then re-execute the packing command.

@guruz
Copy link
Contributor

guruz commented Apr 4, 2018

#6423

karakayasemi added a commit to ITUBIDB/kovan-desktop-client that referenced this issue Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants