Skip to content
Snippets Groups Projects
Select Git revision
  • 904d538ec7c71e2dafce122f38165c7a0c10db07
  • master default protected
  • release/beta-qt-202301101210
  • stable
  • release/beta-qt-202211182015
  • release/beta-qt-202211181752
  • release/beta-qt-202211171508
  • release/beta-qt-202211081754
  • release/beta-qt-202211071518
  • release/beta-qt-202210270957
  • release/beta-qt-202210071648
  • release/beta-qt-202209291549
  • release/beta-qt-202209011129
  • release/beta-qt-202208261640
  • release/beta-qt-202208241511
  • release/beta-qt-202208231849
  • release/beta-qt-202208091525
  • release/beta-qt-202207191241
  • release/beta-qt-202207181708
  • release/beta-qt-202207131914
  • release/beta-qt-202207131513
  • android/release_358
  • android/release_357
  • android/release_356
  • android/release_355
  • android/release_354
  • 20221220.0956.79e1207
  • android/release_353
  • android/release_352
  • android/release_350
  • android/release_349
  • android/release_348
  • android/release_347
  • 20221031.1308.130cc26
  • android/release_346
  • android/release_345
  • android/release_344
  • android/release_343
  • android/release_342
  • android/release_341
  • android/release_340
41 results

install.sh

Blame
    • Maxim Cournoyer's avatar
      139b307f
      build.py: Streamline and update dependencies, build script. · 139b307f
      Maxim Cournoyer authored and Amin Bandali's avatar Amin Bandali committed
      Remove the GNOME dependencies and have the --qt argument always
      require a value when used (exclusively to specify a Qt installation
      prefix).
      
      * build.py (ZYPPER_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (ZYPPER_CLIENT_QT_DEPENDENCIES): Rename to...
      (ZYPPER_CLIENT_DEPENDENCIES): ... this.
      (DNF_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (DNF_CLIENT_QT_DEPENDENCIES): Rename to...
      (DNF_CLIENT_DEPENDENCIES): ... this.
      (APT_DEPENDENCIES): Delete 'gnome-icon-theme-symbolic'.
      (APT_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (APT_CLIENT_QT_DEPENDENCIES): Rename to...
      (APT_CLIENT_DEPENDENCIES): ... this.
      (PACMAN_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (PACMAN_CLIENT_QT_DEPENDENCIES): Rename to...
      (PACMAN_CLIENT_DEPENDENCIES): ... this.
      (run_dependencies): Remove usage of args.gnome.  Streamline use of
      --qt; now it's only used to specify a custom Qt prefix.
      (run_uninstall): Get rid of CLIENT_SUFFIX, adjusting users
      accordingly.
      (run_install): Delete '-c' option of install script.
      (run_run): Delete hacks used to build the now-deprecated client-macos
      on macOS.  Get rid of client_suffix.  Adjust client path to run.
      (run_stop): Get rid of suffix.
      (execute_script): Test falsy values as intended.
      (parse_args): Delete '--gnome' argument.  Adjust doc of '--qt'.
      (main): Get rid of 'parsed_args.gnome'.
      * guix/manifest.scm: Streamline and update dependencies.
      * scripts/install.sh: Remove '-c' option.  Remove conditional branches
      handling GNOME client.
      * guix/channels.scm: New file.
      
      Change-Id: I26898c3331467bfc4ab63d3e9df1d50560c287c2
      139b307f
      History
      build.py: Streamline and update dependencies, build script.
      Maxim Cournoyer authored and Amin Bandali's avatar Amin Bandali committed
      Remove the GNOME dependencies and have the --qt argument always
      require a value when used (exclusively to specify a Qt installation
      prefix).
      
      * build.py (ZYPPER_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (ZYPPER_CLIENT_QT_DEPENDENCIES): Rename to...
      (ZYPPER_CLIENT_DEPENDENCIES): ... this.
      (DNF_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (DNF_CLIENT_QT_DEPENDENCIES): Rename to...
      (DNF_CLIENT_DEPENDENCIES): ... this.
      (APT_DEPENDENCIES): Delete 'gnome-icon-theme-symbolic'.
      (APT_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (APT_CLIENT_QT_DEPENDENCIES): Rename to...
      (APT_CLIENT_DEPENDENCIES): ... this.
      (PACMAN_CLIENT_GNOME_DEPENDENCIES): Delete variable.
      (PACMAN_CLIENT_QT_DEPENDENCIES): Rename to...
      (PACMAN_CLIENT_DEPENDENCIES): ... this.
      (run_dependencies): Remove usage of args.gnome.  Streamline use of
      --qt; now it's only used to specify a custom Qt prefix.
      (run_uninstall): Get rid of CLIENT_SUFFIX, adjusting users
      accordingly.
      (run_install): Delete '-c' option of install script.
      (run_run): Delete hacks used to build the now-deprecated client-macos
      on macOS.  Get rid of client_suffix.  Adjust client path to run.
      (run_stop): Get rid of suffix.
      (execute_script): Test falsy values as intended.
      (parse_args): Delete '--gnome' argument.  Adjust doc of '--qt'.
      (main): Get rid of 'parsed_args.gnome'.
      * guix/manifest.scm: Streamline and update dependencies.
      * scripts/install.sh: Remove '-c' option.  Remove conditional branches
      handling GNOME client.
      * guix/channels.scm: New file.
      
      Change-Id: I26898c3331467bfc4ab63d3e9df1d50560c287c2
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    install.sh 3.72 KiB
    #!/usr/bin/env bash
    
    # Build and install to a local prefix under this repository.
    export OSTYPE
    
    # Flags:
    
      # -g: install globally instead for all users
      # -s: link everything statically, no D-Bus communication. More likely to work!
      # -p: number of processors to use
      # -u: disable use of privileges (sudo) during install
      # -W: disable libwrap and shared library
      # -w: do not use Qt WebEngine
    
    set -ex
    
    # Qt_MIN_VER required for client-qt
    QT_MIN_VER="6.2"
    
    debug=
    global=false
    static=''
    qtpath=''
    proc='1'
    priv_install=true
    enable_libwrap=true
    enable_webengine=true
    
    while getopts gsc:dQ:P:p:uWw OPT; do
      case "$OPT" in
        g)
          global='true'
        ;;
        s)
          static='-DENABLE_STATIC=true'
        ;;
        d)
          debug=true
        ;;
        Q)
          qtpath="${OPTARG}"
        ;;
        P)
          prefix="${OPTARG}"
        ;;
        p)
          proc="${OPTARG}"
        ;;
        u)
          priv_install='false'
        ;;
        W)
          enable_libwrap='false'
        ;;
        w)
          enable_webengine='false'
        ;;
        \?)
          exit 1
        ;;
      esac
    done
    
    # $1: global-install?
    # $2: private-install?
    make_install() {
      if [ "$1" = "true" ] && [ "$2" != "false" ]; then
        sudo make install
        # Or else the next non-sudo install will fail, because this generates some
        # root owned files like install_manifest.txt under the build directory.
        sudo chown -R "$USER" .
      else
        make install
      fi
    }
    
    TOP="$(pwd)"
    INSTALL="${TOP}/install"
    
    if [ "${global}" = "true" ]; then
        BUILDDIR="build-global"
    else
        BUILDDIR="build-local"
    fi
    
    # jamid
    DAEMON=${TOP}/daemon
    cd "$DAEMON"
    
    # Build the contribs.
    mkdir -p contrib/native
    (
        cd contrib/native
        ../bootstrap ${prefix:+"--prefix=$prefix"}
        make -j"${proc}"
    )
    
    if [[ "${enable_libwrap}" != "true" ]]; then
      # Disable shared if requested
      if [[ "$OSTYPE" != "darwin"* ]]; then
        CONFIGURE_FLAGS+=" --disable-shared"
      fi
    fi
    
    BUILD_TYPE="Release"
    if [ "${debug}" = "true" ]; then
      BUILD_TYPE="Debug"
      CONFIGURE_FLAGS+=" --enable-debug"
    fi
    
    # Build the daemon itself.
    test -f configure || ./autogen.sh
    
    if [ "${global}" = "true" ]; then
        ./configure ${CONFIGURE_FLAGS} ${prefix:+"--prefix=$prefix"}
    else
        ./configure ${CONFIGURE_FLAGS} --prefix="${INSTALL}/daemon"
    fi
    make -j"${proc}" V=1
    make_install "${global}" "${priv_install}"
    
    # 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)
        elif command -v qmake-qt6 &> /dev/null; then
            sys_qtver=$(qmake-qt6 -v) # Fedora
        elif command -v qmake &> /dev/null; then
            sys_qtver=$(qmake -v)
        else
            echo "No valid Qt found"; exit 1;
        fi
    
        sys_qtver=${sys_qtver#*Qt version}
        sys_qtver=${sys_qtver%\ in\ *}
    
        installed_qtver=$(echo "$sys_qtver" | cut -d'.' -f 2)
        required_qtver=$(echo $QT_MIN_VER | cut -d'.' -f 2)
    
        if [[ $installed_qtver -ge $required_qtver ]] ; then
            # Set qtpath to empty in order to use system's Qt.
            qtpath=""
        else
            echo "No valid Qt found"; exit 1;
        fi
    fi
    
    # client
    cd "${TOP}/client-qt"
    mkdir -p "${BUILDDIR}"
    cd "${BUILDDIR}"
    
    client_cmake_flags=(-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
                        -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
        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
    make_install "${global}" "${priv_install}"