diff --git a/build.py b/build.py index f2f14cb5d83ee9a27a8de0a1ca29f1ce42221888..78dfcd48aa257bebe4aebed5f39b5a91f5ce4622 100755 --- a/build.py +++ b/build.py @@ -93,16 +93,7 @@ ZYPPER_DEPENDENCIES = [ 'libopenssl-devel', 'libavutil-devel', ] -ZYPPER_CLIENT_GNOME_DEPENDENCIES = [ - # lrc - 'qt6-core-devel', 'qt6-dbus-devel', 'qt6-linguist-devel', - # client-gnome - 'gtk3-devel', 'clutter-gtk-devel', 'gettext-tools', 'libnotify-devel', 'libappindicator3-devel', - 'webkit2gtk3-devel', 'libcanberra-gtk3-devel', - 'qrencode-devel', 'NetworkManager-devel' -] - -ZYPPER_CLIENT_QT_DEPENDENCIES = [ +ZYPPER_CLIENT_DEPENDENCIES = [ # lrc 'qt6-core-devel', 'qt6-dbus-devel', 'qt6-linguist-devel', # client-qt @@ -131,19 +122,9 @@ DNF_DEPENDENCIES = [ 'bzip2' ] -DNF_CLIENT_GNOME_DEPENDENCIES = [ - # lrc - 'qt6-qtbase-devel', - # client-gnome - 'gtk3-devel', 'clutter-devel', 'clutter-gtk-devel', 'libnotify-devel','libappindicator-gtk3-devel', - 'webkitgtk4-devel', 'libcanberra-devel', - 'qrencode-devel', 'NetworkManager-libnm-devel' -] - -DNF_CLIENT_QT_DEPENDENCIES = [ - # lrc +DNF_CLIENT_DEPENDENCIES = [ + 'libnotify-devel', 'qt6-qtbase-devel', - # client-qt 'qt6-qtsvg-devel', 'qt6-qtmultimedia-devel', 'qt6-qtdeclarative-devel', 'qrencode-devel', 'NetworkManager-libnm-devel' ] @@ -152,11 +133,11 @@ DNF_QT_WEBENGINE = [ 'qt6-qtwebengine-devel' ] APT_DEPENDENCIES = [ 'autoconf', 'autoconf-archive', 'autopoint', 'automake', 'cmake', 'make', 'dbus', 'doxygen', 'graphviz', - 'g++', 'gettext', 'gnome-icon-theme-symbolic', 'libasound2-dev', 'libavcodec-dev', + 'g++', 'gettext', 'libasound2-dev', 'libavcodec-dev', 'libavdevice-dev', 'libavformat-dev', 'libboost-dev', 'libcppunit-dev', 'libdbus-1-dev', 'libdbus-c++-dev', 'libebook1.2-dev', 'libexpat1-dev', 'libgnutls28-dev', - 'libgtk-3-dev', 'libjack-dev', 'libnotify-dev', + 'libgtk-3-dev', 'libjack-dev', 'libopus-dev', 'libpcre3-dev', 'libpulse-dev', 'libssl-dev', 'libspeex-dev', 'libspeexdsp-dev', 'libswscale-dev', 'libtool', 'libudev-dev', 'libyaml-cpp-dev', 'sip-tester', 'swig', @@ -164,20 +145,9 @@ APT_DEPENDENCIES = [ 'pandoc', 'nasm', 'dpkg-dev' ] -APT_CLIENT_GNOME_DEPENDENCIES = [ - # lrc - 'qt6-base-dev', 'qt6-tools-dev', 'qt6-tools-dev-tools', - 'qt6-l10n-tools', 'libqt6sql6-sqlite', - # client-gnome - 'libwebkit2gtk-4.0-dev', 'libayatana-appindicator3-dev', 'libcanberra-gtk3-dev', - 'libclutter-gtk-1.0-dev', 'libqrencode-dev', 'libnm-dev' -] - -APT_CLIENT_QT_DEPENDENCIES = [ - # lrc +APT_CLIENT_DEPENDENCIES = [ 'qt6-base-dev', 'qt6-tools-dev', 'qt6-tools-dev-tools', - 'qt6-l10n-tools', 'libqt6sql6-sqlite', - # client-qt + 'qt6-l10n-tools', 'libnotify-dev', 'libqt6sql6-sqlite', 'libqt6core5compat6-dev', 'libqt6networkauth6-dev', 'qt6-multimedia-dev', 'libqt6svg6-dev', 'qt6-declarative-dev', 'qml6-module-qt-labs-qmlmodels', @@ -204,16 +174,7 @@ PACMAN_DEPENDENCIES = [ 'automake', 'libva', 'libvdpau', 'openssl', 'pandoc', 'nasm' ] -PACMAN_CLIENT_GNOME_DEPENDENCIES = [ - # lrc - 'qt6-base', - # client-gnome - 'clutter-gtk','gnome-icon-theme-symbolic', 'gtk3', 'libappindicator-gtk3', - 'libcanberra', 'libnotify', 'webkit2gtk', - 'qrencode', 'libnm' -] - -PACMAN_CLIENT_QT_DEPENDENCIES = [ +PACMAN_CLIENT_DEPENDENCIES = [ # lrc 'qt6-base', # client-qt @@ -275,16 +236,11 @@ def run_dependencies(args): execute_script( APT_INSTALL_SCRIPT, {"packages": ' '.join(map(shlex.quote, APT_DEPENDENCIES))}) - if not args.gnome: - if not args.no_webengine: - APT_CLIENT_QT_DEPENDENCIES.extend(APT_QT_WEBENGINE) - execute_script( - APT_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, APT_CLIENT_QT_DEPENDENCIES))}) - else: - execute_script( - APT_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, APT_CLIENT_GNOME_DEPENDENCIES))}) + if not args.no_webengine: + APT_CLIENT_DEPENDENCIES.extend(APT_QT_WEBENGINE) + execute_script( + APT_INSTALL_SCRIPT, + {"packages": ' '.join(map(shlex.quote, APT_CLIENT_DEPENDENCIES))}) elif args.distribution in DNF_BASED_DISTROS: if args.assume_yes: @@ -293,16 +249,11 @@ def run_dependencies(args): execute_script( RPM_INSTALL_SCRIPT, {"packages": ' '.join(map(shlex.quote, DNF_DEPENDENCIES))}) - if not args.gnome: - if not args.no_webengine: - DNF_CLIENT_QT_DEPENDENCIES.extend(DNF_QT_WEBENGINE) - execute_script( - RPM_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, DNF_CLIENT_QT_DEPENDENCIES))}) - else: - execute_script( - RPM_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, DNF_CLIENT_GNOME_DEPENDENCIES))}) + if not args.no_webengine: + DNF_CLIENT_DEPENDENCIES.extend(DNF_QT_WEBENGINE) + execute_script( + RPM_INSTALL_SCRIPT, + {"packages": ' '.join(map(shlex.quote, DNF_CLIENT_DEPENDENCIES))}) elif args.distribution in PACMAN_BASED_DISTROS: if args.assume_yes: @@ -311,16 +262,11 @@ def run_dependencies(args): execute_script( PACMAN_INSTALL_SCRIPT, {"packages": ' '.join(map(shlex.quote, PACMAN_DEPENDENCIES))}) - if not args.gnome: - if not args.no_webengine: - PACMAN_CLIENT_QT_DEPENDENCIES.extend(PACMAN_QT_WEBENGINE) - execute_script( - PACMAN_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, PACMAN_CLIENT_QT_DEPENDENCIES))}) - else: - execute_script( - PACMAN_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, PACMAN_CLIENT_GNOME_DEPENDENCIES))}) + if not args.no_webengine: + PACMAN_CLIENT_DEPENDENCIES.extend(PACMAN_QT_WEBENGINE) + execute_script( + PACMAN_INSTALL_SCRIPT, + {"packages": ' '.join(map(shlex.quote, PACMAN_CLIENT_DEPENDENCIES))}) elif args.distribution in ZYPPER_BASED_DISTROS: if args.assume_yes: @@ -329,16 +275,11 @@ def run_dependencies(args): execute_script( ZYPPER_INSTALL_SCRIPT, {"packages": ' '.join(map(shlex.quote, ZYPPER_DEPENDENCIES))}) - if not args.gnome: - if not args.no_webengine: - ZYPPER_CLIENT_QT_DEPENDENCIES.extend(ZYPPER_QT_WEBENGINE) - execute_script( - ZYPPER_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, ZYPPER_CLIENT_QT_DEPENDENCIES))}) - else: - execute_script( - ZYPPER_INSTALL_SCRIPT, - {"packages": ' '.join(map(shlex.quote, ZYPPER_CLIENT_GNOME_DEPENDENCIES))}) + if not args.no_webengine: + ZYPPER_CLIENT_DEPENDENCIES.extend(ZYPPER_QT_WEBENGINE) + execute_script( + ZYPPER_INSTALL_SCRIPT, + {"packages": ' '.join(map(shlex.quote, ZYPPER_CLIENT_DEPENDENCIES))}) elif args.distribution == OSX_DISTRIBUTION_NAME: execute_script( @@ -464,23 +405,17 @@ def run_install(args): environ['CMAKE_PREFIX_PATH'] = proc.stdout.rstrip("\n") environ['CONFIGURE_FLAGS'] = '--without-dbus' - if args.qt is not None: - install_args += ("-c", "client-qt") - install_args += ("-Q", args.qt) - else: - install_args += ("-c", "client-macosx") + if not args.qt: + raise Exception('provide the Qt path using --qt=/qt/install/prefix') + install_args += ("-Q", args.qt) else: if args.distribution in ZYPPER_BASED_DISTROS: # fix jsoncpp pkg-config bug, remove when jsoncpp package bumped environ['JSONCPP_LIBS'] = "-ljsoncpp" - if not args.gnome: - install_args += ("-c", "client-qt") - if args.qt is not None: - install_args += ("-Q", args.qt) - else: - install_args += ("-c", "client-gnome") + if args.qt: + install_args += ("-Q", args.qt) - command = ['bash', 'scripts/install.sh'] + install_args + command = ['scripts/install.sh'] + install_args if args.distribution == 'guix': if args.global_install: @@ -513,14 +448,13 @@ def run_uninstall(args): else: execute_script(UNINSTALL_DAEMON_SCRIPT) - CLIENT_SUFFIX = 'qt' if (not args.gnome) else 'gnome' INSTALL_DIR = '/build-global' if args.global_install else '/build-local' # Client needs to be uninstalled first - if (os.path.exists('./client-' + CLIENT_SUFFIX + INSTALL_DIR)): + if (os.path.exists('./client-qt' + INSTALL_DIR)): UNINSTALL_CLIENT = [ - 'make -C client-' + CLIENT_SUFFIX + INSTALL_DIR + ' uninstall', - 'rm -rf ./client-' + CLIENT_SUFFIX + INSTALL_DIR + 'make -C client-qt' + INSTALL_DIR + ' uninstall', + 'rm -rf ./client-qt' + INSTALL_DIR ] execute_script(UNINSTALL_CLIENT) @@ -538,17 +472,7 @@ def run_clean(): def run_run(args): - if args.distribution == OSX_DISTRIBUTION_NAME and args.qt is None: - subprocess.Popen( - ["install/client-macosx/Ring.app/Contents/MacOS/Ring"]) - return True - run_env = os.environ - if args.gnome or (args.distribution == OSX_DISTRIBUTION_NAME \ - and args.qt is None): - run_env['LD_LIBRARY_PATH'] = run_env.get( - 'LD_LIBRARY_PATH', '') + ":install/lrc/lib" - try: jamid_log = open("daemon.log", 'a') jamid_log.write('=== Starting daemon (%s) ===' % @@ -562,23 +486,15 @@ def run_run(args): with open('daemon.pid', 'w') as f: f.write(str(jamid_process.pid)+'\n') - client_suffix = "" - if not args.gnome: - client_suffix += "qt" - else: - client_suffix += "gnome" - client_log = open("jami-" + client_suffix + ".log", 'a') + client_log = open('jami-qt.log', 'a') client_log.write('=== Starting client (%s) ===' % time.strftime("%d/%m/%Y %H:%M:%S")) - client_process = subprocess.Popen( - ["./install/client-" + client_suffix + - "/bin/jami-" + client_suffix, "-d"], - stdout=client_log, - stderr=client_log, - env=run_env - ) + client_process = subprocess.Popen(["./install/client-qt/bin/jami-qt", "-d"], + stdout=client_log, + stderr=client_log, + env=run_env) - with open("jami-" + client_suffix + ".pid", 'w') as f: + with open('jami-qt.pid', 'w') as f: f.write(str(client_process.pid)+'\n') if args.debug: @@ -612,21 +528,18 @@ def run_run(args): def run_stop(args): - client_suffix = "qt" if (not args.gnome) else "gnome" - STOP_SCRIPT = [ - 'xargs kill < jami-' + client_suffix + '.pid', - 'xargs kill < daemon.pid' - ] + STOP_SCRIPT = ['xargs kill < jami-qt.pid', + 'xargs kill < daemon.pid'] execute_script(STOP_SCRIPT) def execute_script(script, settings=None, fail=True): - if settings == None: + if settings is None: settings = {} for line in script: line = line % settings rv = os.system(line) - if rv != 0 and fail == True: + if rv and fail: print('Error executing script! Exit code: %s' % rv, file=sys.stderr) sys.exit(1) @@ -710,9 +623,8 @@ def parse_args(): ap.add_argument('--background', default=False, action='store_true') ap.add_argument('--no-priv-install', dest='priv_install', default=True, action='store_false') - ap.add_argument('--gnome', default=False, action='store_true') - ap.add_argument('--qt', nargs='?', const='', type=str, - help='Build the Qt client with the Qt path supplied') + ap.add_argument('--qt', type=str, + help='Use the Qt path supplied') ap.add_argument('--no-libwrap', dest='no_libwrap', default=False, action='store_true', help='Disable libwrap. Also set --disable-shared option to daemon configure') @@ -786,9 +698,6 @@ def main(): elif parsed_args.run: if (parsed_args.distribution == 'guix' and 'GUIX_ENVIRONMENT' not in os.environ): - if not parsed_args.gnome: - print('FIXME: Qt fails loading QML modules due to ' - 'https://issues.guix.gnu.org/47655') # Relaunch this script, this time in a pure Guix environment. guix_args = ['shell', '--pure', # to allow pulseaudio to connect to an existing server diff --git a/client-android b/client-android index ea91200e4ec802db4306bab8c4d53223672806f0..24c832d8e9d9d89cbf21f3d3a60e6b3125091f8b 160000 --- a/client-android +++ b/client-android @@ -1 +1 @@ -Subproject commit ea91200e4ec802db4306bab8c4d53223672806f0 +Subproject commit 24c832d8e9d9d89cbf21f3d3a60e6b3125091f8b diff --git a/client-qt b/client-qt index bb54825082e99b9c80ea7e6f3e0c61b003b67568..730b00bd5d5c5744b460a0ff259b4629e8e07fc0 160000 --- a/client-qt +++ b/client-qt @@ -1 +1 @@ -Subproject commit bb54825082e99b9c80ea7e6f3e0c61b003b67568 +Subproject commit 730b00bd5d5c5744b460a0ff259b4629e8e07fc0 diff --git a/daemon b/daemon index 5c55f5efa86526afc5420adaff0f5236cfdf5a79..b16308eaf2c3ad9a68016a516f4f92bc0c57e46d 160000 --- a/daemon +++ b/daemon @@ -1 +1 @@ -Subproject commit 5c55f5efa86526afc5420adaff0f5236cfdf5a79 +Subproject commit b16308eaf2c3ad9a68016a516f4f92bc0c57e46d diff --git a/guix/channels.scm b/guix/channels.scm new file mode 100644 index 0000000000000000000000000000000000000000..6c333f7eb43fd88ad65fa15409d233ceaa833ef5 --- /dev/null +++ b/guix/channels.scm @@ -0,0 +1,5 @@ +;;; Tested with this revision of GNU Guix. +(list (channel + (inherit %default-guix-channel) + (commit + "f5cc7d03a778f20e2ad487e2c17cc8853bc871f0"))) ;2022-08-01 diff --git a/guix/manifest.scm b/guix/manifest.scm index cc6e44c31ee716ec8b6e32287deca899d99c12f4..59f2a831f3f878976bfbcc5d9da939c439234dfe 100644 --- a/guix/manifest.scm +++ b/guix/manifest.scm @@ -4,18 +4,17 @@ ;;; Commentary: ;;; ;;; A full-blown development environment that can be used to build the -;;; whole project. It includes both the GNOME as well as the Qt -;;; libraries, so that both clients can be built. The sensitive -;;; (i.e., patched) dependencies are consciously omitted from this -;;; list so that the bundled libraries are the ones used, which is -;;; usually what is desired for development purposes. +;;; whole project. The sensitive (i.e., patched) dependencies are +;;; consciously omitted from this list so that the bundled libraries +;;; are the ones used, which is usually what is desired for +;;; development purposes. -;;; The make-jami.py script makes use of it to build Jami in a Linux +;;; The build.py script makes use of it to build Jami in a Linux ;;; container with the dependencies below when Guix is detected (and ;;; no /etc/os-release file exists) or when explicitly specified, ;;; e.g.: ;;; -;;; $ ./make-jami.py --distribution=guix --install +;;; $ ./build.py --distribution=guix --install ;;; ;;; It can also be invoked directly to spawn a development environment, like so: ;;; @@ -93,52 +92,25 @@ "yaml-cpp" "yasm" - ;; For libringclient (LRC) and the Qt client. - "qtbase@5" - "qtbase@5:debug" - - ;; Shared by the GNOME and Qt clients. - "qrencode" - - ;; Shared by the LRC, GNOME and Qt clients. - "network-manager" ;libnm - - ;; For the GNOME client (client-gnome) - "adwaita-icon-theme" - "hicolor-icon-theme" - "clutter" - "clutter-gtk" - "glib:bin" ;for glib-compile-resources - "gtk+" - "gtk+:debug" - "libcanberra" - "libindicator" - "libnotify" - "sqlite" - "webkitgtk" - ;; For the Qt client. + "libxkbcommon" + "network-manager" ;libnm + "qrencode" + "qtbase" + "qt5compat" + "qtdeclarative" + "qtmultimedia" + "qtnetworkauth" + "qtpositioning" "qtsvg" - "qtsvg:debug" "qttools" - "qtwebengine" - "qtwebengine:debug" "qtwebchannel" - "qtwebchannel:debug" - "qtmultimedia" - "qtmultimedia:debug" - "qtdeclarative" - "qtdeclarative:debug" - "qtgraphicaleffects" - "qtgraphicaleffects:debug" - "qtquickcontrols" - "qtquickcontrols:debug" - "qtquickcontrols2" - "qtquickcontrols2:debug" + "qtwebengine" + "vulkan-headers" ;; For tests and debugging. - "cppunit" "file" "gdb" + "googletest" "ltrace" "strace")) diff --git a/scripts/install.sh b/scripts/install.sh index d75ea6c50ed4528f1bc6d448499339db0e6f3017..64a69cf30c8230ca6e7c46aedbf785d5b41d541e 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7,7 +7,6 @@ export OSTYPE # -g: install globally instead for all users # -s: link everything statically, no D-Bus communication. More likely to work! - # -c: client to build # -p: number of processors to use # -u: disable use of privileges (sudo) during install # -W: disable libwrap and shared library @@ -21,7 +20,6 @@ QT_MIN_VER="6.2" debug= global=false static='' -client='' qtpath='' proc='1' priv_install=true @@ -36,9 +34,6 @@ while getopts gsc:dQ:P:p:uWw OPT; do s) static='-DENABLE_STATIC=true' ;; - c) - client="${OPTARG}" - ;; d) debug=true ;; @@ -124,8 +119,8 @@ fi make -j"${proc}" V=1 make_install "${global}" "${priv_install}" -# For the client-qt, verify system's version if no path provided -if [ "${client}" = "client-qt" ] && [ -z "$qtpath" ]; then +# Verify system's version if no path provided. +if [ -z "$qtpath" ]; then sys_qtver="" if command -v qmake6 &> /dev/null; then sys_qtver=$(qmake6 -v) @@ -151,58 +146,24 @@ if [ "${client}" = "client-qt" ] && [ -z "$qtpath" ]; then fi fi -# libringclient (only if not client-qt) -if [ "${client}" != "client-qt" ]; then - cd "${TOP}/lrc" - mkdir -p "${BUILDDIR}" - cd "${BUILDDIR}" - # Compute LRC CMake flags - lrc_cmake_flags=(-DCMAKE_PREFIX_PATH="${qtpath}" - -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" - -DENABLE_LIBWRAP="${enable_libwrap}" - $static) - if [ "${global}" = "true" ]; then - lrc_cmake_flags+=(${prefix:+"-DCMAKE_INSTALL_PREFIX=$prefix"}) - else - lrc_cmake_flags+=(-DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" - -DRING_BUILD_DIR="${DAEMON}/src") - fi - echo "info: Configuring LRC with flags: ${lrc_cmake_flags[*]}" - cmake .. "${lrc_cmake_flags[@]}" - make -j"${proc}" V=1 - make_install "${global}" "${priv_install}" -fi - # client -cd "${TOP}/${client}" +cd "${TOP}/client-qt" mkdir -p "${BUILDDIR}" cd "${BUILDDIR}" client_cmake_flags=(-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" - -DCMAKE_PREFIX_PATH="${qtpath}") - -if [ "${client}" = "client-qt" ]; then - client_cmake_flags+=(-DENABLE_LIBWRAP="${enable_libwrap}" - -DWITH_WEBENGINE="${enable_webengine}") - if [ "${global}" = "true" ]; then - client_cmake_flags+=(${prefix:+"-DCMAKE_INSTALL_PREFIX=$prefix"} - $static) - else - client_cmake_flags+=(-DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" - -DLIBJAMI_BUILD_DIR="${DAEMON}/src") - fi + -DCMAKE_PREFIX_PATH="${qtpath}" + -DENABLE_LIBWRAP="${enable_libwrap}" + -DWITH_WEBENGINE="${enable_webengine}") + +if [ "${global}" = "true" ]; then + client_cmake_flags+=(${prefix:+"-DCMAKE_INSTALL_PREFIX=$prefix"} + $static) else - # Compute GNOME client CMake flags. - client_cmake_flags+=($static) - if [ "${global}" = "true" ]; then - client_cmake_flags+=(${prefix:+"-DCMAKE_INSTALL_PREFIX=$prefix"}) - else - client_cmake_flags+=( - -DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" - -DRINGTONE_DIR="${INSTALL}/daemon/share/jami/ringtones" - -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient") - fi + client_cmake_flags+=(-DCMAKE_INSTALL_PREFIX="${INSTALL}/client-qt" + -DLIBJAMI_BUILD_DIR="${DAEMON}/src") fi + echo "info: Configuring $client client with flags: ${client_cmake_flags[*]}" cmake .. "${client_cmake_flags[@]}" make -j"${proc}" V=1