abraunegg-onedrive/docs/INSTALL.md
abraunegg 7cf2912d2d
Rework directory layout and refactor MD files for readability (#523)
* Move lots of stuff into contrib directory to clean up root folder
* Update autoconf files for new location of some files
* Refactor README split and move to docs directory
* Update INSTALL.md
* Update Makefile.in
* Install docs from new location
* Uninstall docs correctly
* Update Dockerfile
* Fix up Dockerfile spacing
* Move systemd stuff to contrib
* Move docker specific stuff to contrib/docker, update docs
* Fix Alpine and Stretch docker files
* Update configure after changed file locations
* Update INSTALL.md to include pkg-config as requirement
* Move also entrypoint.sh to contrib/docker
* Update 'min-notif-changes' to 'min-notify-changes' which was missed in PR #467
* Update to add --sync-root-files to usage.md and man page
* Update usage.md to include --auth-files ARG details
2019-06-11 18:40:05 +10:00

7.8 KiB

Building and Installing the OneDrive Free Client

Build Requirements

Note: DMD version >= 2.083.1 or LDC version >= 1.11.0 is required to compile this application

Dependencies: Ubuntu/Debian - x86_64

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is necessary:

sudo apt install libnotify-dev

Dependencies: Ubuntu - i386 / i686

Note: Validated with Linux ubuntu-i386-vm 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:26:51 UTC 2018 i686 i686 i686 GNU/Linux and DMD 2.081.1

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is necessary:

sudo apt install libnotify-dev

Dependencies: Debian - i386 / i686

Note: Validated with Linux debian-i386 4.9.0-8-686-pae #1 SMP Debian 4.9.130-2 (2018-10-27) i686 GNU/Linux and LDC - the LLVM D compiler (1.12.0).

First install development dependencies as per below:

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git

Second, install the LDC compiler as per below:

mkdir ldc && cd ldc
wget http://httpredir.debian.org/debian/pool/main/g/gcc-8/gcc-8-base_8.2.0-19_i386.deb
wget http://httpredir.debian.org/debian/pool/main/g/gcc-8/libgcc1_8.2.0-19_i386.deb
wget http://httpredir.debian.org/debian/pool/main/l/ldc/libphobos2-ldc-shared82_1.12.0-1_i386.deb
wget http://httpredir.debian.org/debian/pool/main/l/ldc/libphobos2-ldc-shared-dev_1.12.0-1_i386.deb
wget http://httpredir.debian.org/debian/pool/main/l/ldc/ldc_1.12.0-1_i386.deb
wget http://httpredir.debian.org/debian/pool/main/l/llvm-toolchain-6.0/libllvm6.0_6.0.1-10_i386.deb
wget http://httpredir.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.1+20181013-1_i386.deb
sudo dpkg -i ./*.deb

For notifications the following is necessary:

sudo apt install libnotify-dev

Dependencies: Fedora < Version 18 / CentOS / RHEL

sudo yum groupinstall 'Development Tools'
sudo yum install libcurl-devel
sudo yum install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is necessary:

sudo yum install libnotify-devel

Dependencies: CentOS 6.x / RHEL 6.x

In addition to the above requirements, the sqlite version used on CentOS 6.x / RHEL 6.x needs to be upgraded. Use the following instructions to update your version of sqlite so that it can support the client:

sudo yum -y update
sudo yum -y install epel-release, wget
sudo yum -y install mock
wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.7.15.2/2.fc19/src/sqlite-3.7.15.2-2.fc19.src.rpm
sudo mock --rebuild sqlite-3.7.15.2-2.fc19.src.rpm
sudo yum -y upgrade /var/lib/mock/epel-6-{arch}/result/sqlite-*

Dependencies: Fedora > Version 18

sudo dnf groupinstall 'Development Tools'
sudo dnf install libcurl-devel
sudo dnf install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is necessary:

sudo yum install libnotify-devel

Dependencies: Arch Linux

sudo pacman -S curl sqlite dmd

For notifications the following is necessary:

sudo pacman -S libnotify

Dependencies: Raspbian (ARMHF)

sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libxml2
sudo apt-get install pkg-config
wget https://github.com/ldc-developers/ldc/releases/download/v1.13.0/ldc2-1.13.0-linux-armhf.tar.xz
tar -xvf ldc2-1.13.0-linux-armhf.tar.xz

For notifications the following is necessary:

sudo apt install libnotify-dev

Dependencies: Debian (ARM64)

sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libxml2
sudo apt-get install pkg-config
wget https://github.com/ldc-developers/ldc/releases/download/v1.14.0/ldc2-1.14.0-linux-aarch64.tar.xz
tar -xvf ldc2-1.14.0-linux-aarch64.tar.xz

For notifications the following is necessary:

sudo apt install libnotify-dev

Dependencies: Gentoo

sudo emerge app-portage/layman
sudo layman -a dlang

Add ebuild from contrib/gentoo to a local overlay to use.

For notifications the following is necessary:

sudo emerge x11-libs/libnotify

Dependencies: OpenSuSE Leap 15.0

sudo zypper addrepo --check --refresh --name "D" http://download.opensuse.org/repositories/devel:/languages:/D/openSUSE_Leap_15.0/devel:languages:D.repo
sudo zypper install git libcurl-devel sqlite3-devel D:dmd D:libphobos2-0_81 D:phobos-devel D:phobos-devel-static

For notifications the following is necessary:

sudo zypper install libnotify-devel

Compilation & Installation

Building using DMD Reference Compiler

Before cloning and compiling, if you have installed DMD via curl for your OS, you will need to activate DMD as per example below:

Run `source ~/dlang/dmd-2.081.1/activate` in your shell to use dmd-2.081.1.
This will setup PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1.
Run `deactivate` later on to restore your environment.

Without performing this step, the compilation process will fail.

Note: Depending on your DMD version, substitute 2.081.1 above with your DMD version that is installed.

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure
make clean; make;
sudo make install

Build options

Notifications can be enabled using the configure switch --enable-notifications.

Systemd service files are installed in the appropriate directories on the system, as provided by pkg-config systemd settings. If the need for overriding the deduced path are necessary, the two options --with-systemdsystemunitdir (for the Systemd system unit location), and --with-systemduserunitdir (for the Systemd user unit location) can be specified. Passing in no to one of these options disabled service file installation.

By passing --enable-debug to the configure call, onedrive gets built with additional debug information, useful (for example) to get perf-issued figures.

By passing --enable-completions to the configure call, shell completion functions are installed for bash and zsh. The installation directories are determined as far as possible automatically, but can be overridden by passing --with-bash-completion-dir=<DIR> and --with-zsh-completion-dir=<DIR> to configure.

Building using a different compiler (for example LDC)

Debian - i386 / i686

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure DC=ldc2
make clean; make
sudo make install

ARMHF Architecture

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure DC=~/ldc2-1.13.0-linux-armhf/bin/ldmd2
make clean; make
sudo make install

ARM64 Architecture

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure DC=~/ldc2-1.14.0-linux-aarch64/bin/ldmd2
make clean; make
sudo make install

Uninstall

sudo make uninstall
# delete the application state
rm -rf ~/.config/onedrive

If you are using the --confdir option, substitute ~/.config/onedrive above for that directory.

If you want to just delete the application key, but keep the items database:

rm -f ~/.config/onedrive/refresh_token