Skip to content

Commit

Permalink
SNC-2269. Update package dist files to new requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnok committed Apr 19, 2022
1 parent b1d7674 commit 4af7e37
Show file tree
Hide file tree
Showing 7 changed files with 436 additions and 220 deletions.
28 changes: 13 additions & 15 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
## CREDITS
# CREDITS

Here is the list of the external libraries used by MEGAsync.
We thank them all for their contributions:
Here is the list of the third party libraries used by MEGA Desktop Application.
We are grateful and thankful for their efforts and the opportunity to rely and
extend on their existing body of work.

#### QT
http://www.qt.io/
## Qt SDK
http://www.qt.io/ © 2016 The Qt Company Ltd.

© 2016 The Qt Company Ltd.
### Description
Qt is the cross-platform framework for C++ GUI development.

###### Description:
QT is framework for cross-platform develppment

###### Usage:
QT is the framework used by MEGAsync to get cross platform compatibility
### Usage
Qt is used by MEGA Desktop to get cross-platform compatibility and GUI
functionality across the supported desktop operating systems.

###### License:
Dual license: LGPL 3
### Licence
Dual licence: LGPL 3

https://www.gnu.org/licenses/lgpl-3.0.html

https://www.gnu.org/licenses/licenses.html

http://www.qt.io/licensing/

--------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions INSTALL.mac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OS X compilation

##### Requirements:
* Xcode 12.4
* Qt 5.12.11

##### Preparation:
1. Follow the instructions collected in the [macOS](README.mac.md) to build the required tools / third-party dependencies and get the source code of Desktop repository.
2. Set the env variables `MEGAQTPATH` to a valid Qt installation path and `VCPKGPATH` to a directory containing a valid vcpkg installation.
2. Run the script `installer_mac.sh` to build the project and generate the application bundle for Desktop application. You can generate full packages using either cmake or qmake. Check script options with `--help` flag. Build directory is `Release_x64`
3. Enjoy!

20 changes: 7 additions & 13 deletions LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MEGA LIMITED CODE REVIEW LICENCE
================================
# Mega Limited Code Review Licence

This licence grants you the rights, and only the rights, set out
below, to access and review Mega's code. If you take advantage of
Expand All @@ -12,8 +11,7 @@ there is any inconsistency between this licence and those Terms of
Service, these terms prevail.


Section 1 -- Definitions
------------------------
## Section 1: Definitions

- "code" means the Mega code made available from time, in our sole
discretion, for access under this licence at [https://github.com/].
Expand All @@ -30,8 +28,7 @@ Section 1 -- Definitions
- "you" means the licensee of rights set out in this licence.


Section 2 -- Grant of Rights
----------------------------
## Section 2: Grant of rights

1. Subject to the terms of this licence, we grant you a
non-transferable, non-exclusive, worldwide, royalty-free licence to
Expand All @@ -56,8 +53,7 @@ Section 2 -- Grant of Rights
and Takedown Guidance Policy [https://mega.nz/takedown].


Section 3 -- Limitations
------------------------
## Section 3: Limitations

1. This licence does not grant you any rights to use Mega's name,
logo, or trademarks and you must not in any way indicate you are
Expand All @@ -71,7 +67,7 @@ Section 3 -- Limitations
3. THE CODE IS MADE AVAILABLE "AS-IS" AND WITHOUT ANY EXPRESS OF
IMPLIED GUARANTEES AS TO FITNESS, MERCHANTABILITY, NON-INFRINGEMENT
OR OTHERWISE. IT IS NOT BEING PROVIDED IN TRADE BUT ON A VOLUNTARY
BASIS ON OUR PART AND YOURS AND IS NOT MADE AVAILABE FOR CONSUMER
BASIS ON OUR PART AND YOURS AND IS NOT MADE AVAILABLE FOR CONSUMER
USE OR ANY OTHER USE OUTSIDE THE TERMS OF THIS LICENCE. ANYONE
ACCESSING THE CODE SHOULD HAVE THE REQUISITE EXPERTISE TO SECURE
THEIR OWN SYSTEM AND DEVICES AND TO ACCESS AND USE THE CODE FOR
Expand All @@ -81,17 +77,15 @@ Section 3 -- Limitations
ACCESSING AND USING THE CODE.


Section 4 -- Termination, suspension and variation
--------------------------------------------------
## Section 4: Termination, suspension and variation

1. We may suspend, terminate or vary the terms of this licence and any
access to the code at any time, without notice, for any reason or
no reason, in respect of any licensee, group of licensees or all
licensees.


Section 5 -- General
--------------------
## Section 5: General

1. This licence and its interpretation and operation are governed
solely by New Zealand law. We and each you submit to the exclusive
Expand Down
98 changes: 98 additions & 0 deletions README.linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Linux instructions

For MEGA Desktop App development we are targeting Ubuntu LTS, although we are providing
packages for other Linux flavors as well; please check the main README file for a
definitive list.

MEGA Desktop App may run on any flavor of Linux as long as the Desktop Manager and Window
Environment is supported by the Qt SDK and the required third-party dependencies are
available in their package management repositories. The officially supported distros
guarantee that availability and MEGAsync compatibility with their default Window Manager
and Desktop environment. In this document we aim to provide instructions for Debian (APT
packaging) and RedHat (RPM packaging).

# Requirements

Important requirements for MEGAsync are GCC above version 5 and Qt above version 5.10. The
other third-party requirements will vary from distro to distro; we will aim for a
base-line here and rely on you for the necessary adjustments for your specific Linux
installation. If you need help, you can always reach out to us on GitHub.

## Tools

Some essential tools are needed to get the building process going. Here is the
example Debian APT install command:

```
$ sudo apt install git build-essential wget dh-autoreconf cdbs unzip libtool-bin pkg-config debhelper
```
And here is the example for Fedora:
```
$ sudo dnf install @"C Development Tools and Libraries" git wget unzip
```
The package `build-essential` on Debian and the `C Development Tools and Libraries` on
Fedora, are responsible for installing g++, autoconf, automake and some other build
essential tools. Please install these packages, or their available equivalent, in your
distribution's package repository.

The biggest differentiating factor in getting MEGAsync to work on your distro is, whether
you can install (or build) all the library dependencies we need.

## APT Libraries

Here is the third-party dependency list for APT based distros (e.g. Ubuntu):
```
$ sudo apt install qt5-default qttools5-dev-tools qtbase5-dev qt5-qmake libqt5x11extras5-dev libqt5dbus5 libqt5svg5-dev libcrypto++-dev libraw-dev libc-ares-dev libssl-dev libsqlite3-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libfreeimage-dev libreadline-dev libsodium-dev libuv1-dev libudev-dev libzen-dev
```

## RPM Libraries

Here is the dependency list for RPM based distros (e.g. Fedora):
```
$ sudo dnf install qt5-qtbase-devel qt5-qttools-devel qt5-qtsvg-devel qt5-qtx11extras-devel c-ares-devel cryptopp-devel openssl-devel sqlite-devel zlib-devel LibRaw-devel libudev-devel libzen-devel libmediainfo-devel
```

# Get the source

Open a Terminal and clone the MEGAsync repository:
```
$ mkdir ~/mega
$ cd ~/mega
$ git clone --recursive https://github.com/meganz/MEGAsync.git desktop
```
The MEGA SDK is fetched recursively from https://github.com/meganz/sdk.git

# Build everything

This steps, will check-out all the 3rdParty dependencies and then
proceed to build those, the SDK and MEGA Desktop:
```
$ cd ~/mega/desktop/src/
$ ./configure -g -q -i
$ qmake MEGASync/MEGASync.pro
$ lrelease MEGASync/MEGASync.pro
$ make
```
Note: when compiling for RPM based distros, `qmake` and `lrelease` programs might be missing.
Use `qmake-qt5` and `lrelease-qt5` instead.

# Development

For development, you can open `desktop/src/MEGASync/MEGASync.pro` in Qt Creator
IDE, which can be installed on Debian flavors like so:
```
$ sudo apt install qtcreator libclang-common-8-dev
```
or on Fedora running:
```
$ sudo dnf install qtcreator
```

When building via Qt Creator, note that the SDK is also being rebuilt, since it has its
own QMake project file in the SDK sub-project at `bindings/qt/sdk.pri` included by the
parent QMake.

You might have to generate the initial set of language files, so they are found by the
build system onwards. To do that, in Qt Creator, in the application menu, go to Tools ->
External -> Linguist and click on Release Translations action.

117 changes: 117 additions & 0 deletions README.mac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# macOS instructions

For MEGA Desktop App development we are targeting macOS Big Sur, although we are providing
packages for other versions as well; please check the main README file for a definitive
list.

# Tools

Downloading the latest stable versions of these tools should generally be Ok.

## Xcode & CMake

Install latest XCode via App Store using your Apple account.

For MEGA Desktop development, we have a working headless build system via CMake
which we are using the build the installer packages, however, for day-to-day
development we are primarily using QMake as a team, due to having good Qt
tooling support and a working system for all the supported platforms. That being
said, we are using CMake right now to build the 3rdParty dependencies required
for both SDK and MEGA Desktop and then switching over to QMake + Qt Creator for
developer convenience.

Please download and copy CMake.app into /Applications (or custom location) using the macOS
dmg Installer from:
https://cmake.org/download/

It is useful to add CMake to the system path in the installer wizard. (for current user is
fine), so run the following command:
```
$ sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
```

## YASM (latest version from upstream)

Download and install YASM which is required to build ffmpeg dependency.
Follow these steps:
```
$ git clone https://github.com/yasm/yasm/
$ cd yasm
$ cmake .
$ cmake --build . 
$ sudo cmake --install
```

# Third-Party dependencies

## Qt SDK (5.12.11)

Install Qt Open Source and Qt Creator using the Qt Online Installer from:
https://www.qt.io/download-qt-installer

You will have to create an account, even if you only install the Community Editions.
Install Qt 5.12.11 for macOS; only macOS components are needed during installation.
A good installation path is `~/Qt`.

## VCPKG

Along with Qt, MEGA Desktop and the MEGA SDK require another dozen or more
3rdParty libraries to cover all the functionality exposed to our users. We are
using Microsoft's VCPKG C++ Library Manager for managing our dependencies and we
employ it automagically from our CMake scripts. You don't have to install it
manually.

A notable exception from this rule, is the PDFIUM library, which is used to
create thumbnails for PDF documents. This library is not available in VCPKG for
the moment, thus we are using a patched version from upstream Chromium Depot
Tools for the moment. Download our pre-built version from:
https://mega.nz/file/M1JCRCRa#Ne5sbVD2yZaCt9ijcCaKXs3m_ayfrw0ZovJMdERXRlU

Start decompressing the zip archive as you proceed to the next step.

# Get the source

Open macOS Terminal and clone the Desktop repository:
```
$ mkdir ~/mega/
$ cd ~/mega/
$ git clone --recursive https://github.com/meganz/MEGAsync.git desktop
```

The MEGA SDK is fetched recursively from https://github.com/meganz/sdk.git

# Build everything

This step, will check-out all the 3rdParty dependencies via VCPKG and then
proceed to build those, the SDK and MEGA Desktop in that order, via CMake.

```
$ cd ~/mega/desktop/contrib/cmake
$ cmake -DEXTRA_ARGS="-DCMAKE_PREFIX_PATH=~/Qt/5.12.11/clang_64" -DTARGET=MEGAsync -DTRIPLET=x64-osx-mega -P build_from_scratch.cmake
```

In a short while, but before the build stops because of missing PDFIUM library, you should
notice `~/mega/3rdparty_desktop/vcpkg` directory being created. You can start copying
the extracted pdfium subdirectory to the vcpkg directory.

In case the build fails anyway, just run the cmake command again, once pdfium is copied.

# Development using Qt Creator

Now you can open open `src/MEGASync/MEGASync.pro` to start editing and building. Set it up
as any other Qt QMake based project, using the Qt 5.12.11 kit you installed and set
matching target architecture.

When building using the QMake project, both the application and the SDK are
being rebuilt since the latter has its own QMake project files in the
sub-project at bindings/qt/sdk.pri. Whereas the 3rdParty libs remain the ones
being already built by CMake.

You might have to generate the initial set of language files so they are found
by the build system onwards. To do that, in Qt Creator, in the application menu,
go to Tools -> External -> Linguist and click on Release Translations action.
You can achieve the same, from the command-line:
```
$ cd ~/mega/desktop/src
$ ~/Qt/5.12.11/clang_64/bin/lrelease MEGASync/MEGASync.pro
```
Loading

0 comments on commit 4af7e37

Please sign in to comment.