Commit 6c949295 authored by Alexandre Lision's avatar Alexandre Lision Committed by Guillaume Roguez

add OSX distribution

- update README
- add dependencies
- install script
- run command

Tuleap: #449
Change-Id: I43431df02dfa91180d275bcdc0c97e796c6b948b
parent 9e4a117a
......@@ -2,21 +2,38 @@
Synchronization via submodules of the repositories of <https://ring.cx/> to states in which they work together + scripts to build for each platform easily.
Fixes <https://tuleap.ring.cx/plugins/tracker/?aid=250>.
## First thing first
I'd rather have a single Git repo, but without official support, maintaining a merged single git repo is useless, so I'll start with submodules which are easier to paste together.
git submodule update --init
## Install python3
Ring installer uses python3. Please make sure it is installed before running it.
## Using make-ring.py
Build and install all the dependencies:
./ring-build --dependencies
#### Linux
Your distro package manager will be used.
#### OSX
You need to setup Homebrew (http://brew.sh/) since their is no built-in package manager on OSX.
Build and install locally under this repository:
./make-ring.py --install
Run daemon and client that were installed locally.
Run daemon and client that were installed locally:
./make-ring.py --run
You can then stop the processes with CTRL-C. You can also run them in the background with the `--background` argument and then use the `--stop` command to stop them. Stdout and stderr go to `daemon.log` and `client-gnome.log`.
You can then stop the processes with CTRL-C.
_On Linux_ You can also run them in the background with the `--background` argument and then use the `--stop` command to stop them.
Stdout and stderr go to `daemon.log` and `client-gnome.log`.
Install globally for all users instead:
......@@ -32,6 +49,15 @@ Uninstall the global install:
./make-ring.py --uninstall
## Outputs
#### Linux
#### OSX
You can find the .app file in the ./install/client-macosx folder.
## Ubuntu 15.10 host Android device
This script does not automate the installation of any Android development tools.
......
......@@ -22,6 +22,12 @@ APT_INSTALL_SCRIPT = [
'apt-get install -y %(packages)s'
]
BREW_INSTALL_SCRIPT = [
'brew update',
'brew install -y %(packages)s',
'brew link --force gettext'
]
UBUNTU_DEPENDENCIES = [
'autoconf', 'autopoint', 'cmake', 'dbus', 'doxygen', 'g++', 'gettext',
'gnome-icon-theme-symbolic', 'libasound2-dev', 'libavcodec-dev',
......@@ -50,12 +56,22 @@ DEBIAN_DEPENDENCIES = [
'qtbase5-dev', 'sip-tester', 'swig', 'uuid-dev', 'yasm'
]
OSX_DEPENDENCIES = [
'autoconf', 'cmake', 'gettext', 'pkg-config', 'qt5',
'libtool', 'yasm', 'automake'
]
UNINSTALL_SCRIPT = [
'make -C daemon uninstall',
'xargs rm < lrc/build-global/install_manifest.txt',
'xargs rm < client-gnome/build-global/install_manifest.txt',
]
OSX_UNINSTALL_SCRIPT = [
'make -C daemon uninstall',
'rm -rf install/client-macosx',
]
STOP_SCRIPT = [
'xargs kill < daemon.pid',
'xargs kill < gnome-ring.pid',
......@@ -74,6 +90,12 @@ def run_dependencies(args):
{"packages": ' '.join(DEBIAN_DEPENDENCIES)}
)
elif args.distribution == "OSX":
execute_script(
BREW_INSTALL_SCRIPT,
{"packages": ' '.join(OSX_DEPENDENCIES)}
)
else:
print("Not yet implemented for current distribution (%s)" % args.distribution)
sys.exit(1)
......@@ -85,14 +107,26 @@ def run_install(args):
install_args += ' -s'
if args.global_install:
install_args += ' -g'
execute_script(["./scripts/install.sh " + install_args])
if args.distribution == "OSX":
install_args += " -c client-macosx"
execute_script(["CONFIGURE_FLAGS='--without-dbus' ./scripts/install.sh " + install_args])
else:
install_args += '-c client-gnome'
execute_script(["./scripts/install.sh " + install_args])
def run_uninstall(args):
execute_script(UNINSTALL_SCRIPT)
if args.distribution == "OSX":
execute_script(OSX_UNINSTALL_SCRIPT)
else:
execute_script(UNINSTALL_SCRIPT)
def run_run(args):
if args.distribution == "OSX":
subprocess.Popen(["install/client-macosx/Ring.app/Contents/MacOS/Ring"])
return True
run_env = os.environ
run_env['LD_LIBRARY_PATH'] = run_env.get('LD_LIBRARY_PATH', '') + ":install/lrc/lib"
......@@ -149,6 +183,7 @@ def run_run(args):
# file. All that matters is that we close files and kill processes
# in the right order.
pass
return True
def run_stop(args):
......@@ -172,7 +207,7 @@ def validate_args(parsed_args):
"""Validate the args values, exit if error is found"""
# Check arg values
supported_distros = ['Ubuntu', 'Debian']
supported_distros = ['Ubuntu', 'Debian', 'OSX']
if parsed_args.distribution not in supported_distros:
print('Distribution not supported.\nChoose one of: %s' \
% ', '.join(supported_distros),
......
......@@ -6,12 +6,14 @@
# -g: install globally instead for all users
# -s: link everything statically, no D-Bus communication. More likely to work!
# -c: client to build
set -ex
global=false
static=''
while getopts gs OPT; do
client=''
while getopts gsc: OPT; do
case "$OPT" in
g)
global='true'
......@@ -19,6 +21,9 @@ while getopts gs OPT; do
s)
static='-DENABLE_STATIC=true'
;;
c)
client="${OPTARG}"
;;
\?)
exit 1
;;
......@@ -55,9 +60,9 @@ make -j$(nproc)
cd "${DAEMON}"
./autogen.sh
if $global; then
./configure
./configure $CONFIGURE_FLAGS
else
./configure --prefix="${INSTALL}/daemon"
./configure $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon"
fi
make -j$(nproc)
make_install $global
......@@ -73,13 +78,13 @@ fi
make
make_install $global
cd "${TOP}/client-gnome"
cd "${TOP}/${client}"
mkdir -p ${BUILDDIR}
cd ${BUILDDIR}
if $global; then
cmake .. $static
else
cmake .. -DCMAKE_INSTALL_PREFIX="${INSTALL}/client-gnome" -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" $static
cmake .. -DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" $static
fi
make
make_install $global
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment