File indexing completed on 2024-05-12 04:17:32
0001 #!/bin/bash 0002 0003 # Script to install dependencies under Ubuntu Linux to compile digiKam. 0004 # This script must be run as sudo 0005 # *Ubuntu* compatible version >= 18.04 0006 # 0007 # SPDX-FileCopyrightText: 2021 by TRAN Quoc Hung <quochungtran1999 at gmail dot com> 0008 # SPDX-FileCopyrightText: 2021 by Surya K M <suryakm_is20 dot rvitm@rvei dot edu dot in> 0009 # SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 # 0011 # SPDX-License-Identifier: BSD-3-Clause 0012 # 0013 0014 # Check OS name and version. 0015 0016 OS_NAME=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | sed 's/\"//' | sed 's/\"//' | tr '[:upper:]' '[:lower:]') 0017 OS_ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/') 0018 OS_VERSION=$(awk '/DISTRIB_RELEASE=/' /etc/*-release | sed 's/DISTRIB_RELEASE=//' | sed 's/[.]0/./') 0019 0020 echo $OS_NAME 0021 echo $OS_ARCH 0022 echo $OS_VERSION 0023 0024 if [[ "$OS_NAME" != "ubuntu" ]] ; then 0025 echo "Not running Linux ubuntu..." 0026 exit -1 0027 fi 0028 0029 echo "Check the list of dependencies in the online doc API : https://www.digikam.org/api/index.html#externaldeps" 0030 echo "-------------------------------------------------------------------" 0031 0032 # for downloading package information from all configured sources.' 0033 0034 sudo apt-get update 0035 sudo apt-get upgrade 0036 sudo apt install software-properties-common 0037 0038 # benefit from a higher version of certain software , update the key 0039 0040 sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com 0041 sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" 0042 0043 # To fix GPP key error with some reporsitories 0044 # See: https://www.skyminds.net/linux-resoudre-les-erreurs-communes-de-cle-gpg-dans-apt/ 0045 0046 sudo apt-get update 2>&1 | \ 0047 sed -ne 's?^.*NO_PUBKEY ??p' | \ 0048 xargs -r -- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0049 0050 # Install dependencies to Checkout Source Code 0051 0052 sudo apt-get install -y git 0053 0054 echo "-------------------------------------------------------------------" 0055 0056 sudo apt-get install -y perl 0057 0058 echo "-------------------------------------------------------------------" 0059 0060 # Install required dependencies to Compile And Link Source Code 0061 0062 required_packages=("cmake" # To Compile Source Code 0063 "ninja-build" # To Compile Source Code 0064 "build-essential" # To Compile Source Code 0065 "extra-cmake-modules" 0066 "qtbase5-dev" 0067 ) 0068 0069 for pkg in ${required_packages[@]}; do 0070 0071 sudo apt-get install -y ${pkg} 0072 0073 current_version=$(dpkg-query --showformat='${Version}' --show ${pkg}) 0074 0075 case "${pkg}" in 0076 "cmake") 0077 required_version=3.3.2 0078 ;; 0079 "extra-cmake-modules") 0080 required_version=5.5.0 0081 ;; 0082 "build-essential") 0083 required_version=7.2.0 0084 ;; 0085 "libqt5core5a") 0086 required_version=5.9.0 0087 ;; 0088 "libkf5config-dev") 0089 required_version=5.5.0 0090 ;; 0091 "libopencv-dev") 0092 required_version=3.3.0 0093 ;; 0094 "libpthread-stubs0-dev") 0095 required_version=2.0.0 0096 ;; 0097 "libtiff-dev") 0098 required_version=4.0.0 0099 ;; 0100 "libpng-dev") 0101 required_version=1.6.0 0102 ;; 0103 "libjpeg-dev") 0104 required_version=6b 0105 ;; 0106 "libboost-all-dev") 0107 required_version=1.55.0 0108 ;; 0109 "liblcms2-dev") 0110 required_version=2.0.0 0111 ;; 0112 "libexpat1-dev") 0113 required_version=2.1.0 0114 ;; 0115 "libexiv2-dev") 0116 required_version=0.27.0 0117 ;; 0118 esac 0119 0120 echo $current_version 0121 0122 if $(dpkg --compare-versions "$current_version" "lt" "$required_version"); then 0123 echo "less than $required_version"; 0124 echo "please upgrade newer version or another packages"; 0125 else 0126 echo "greater than $required_version ............. accepted"; 0127 fi 0128 0129 echo "-------------------------------------------------------------------" 0130 0131 done 0132 0133 # install Python 3.7 0134 sudo add-apt-repository ppa:deadsnakes/ppa 0135 sudo apt install -y python3.7 0136 ln -s /usr/bin/python3 /usr/bin/python3.7 0137 0138 # Install optional dependencies to Compile And Link Source Code 0139 0140 optional_packages=("ruby" # For i18n extraction 0141 "subversion" # For i18n extraction 0142 "keychain" # For git-ssh 0143 "ssh-askpass" # For git-ssh 0144 "lzip" # For CI/CD 0145 "gzip" # For CI/CD 0146 "unzip" # For CI/CD 0147 "unrar" # For CI/CD 0148 "autoconf" # For MXE build 0149 "automake" # For MXE build 0150 "autopoint" # For MXE build 0151 "bash" # For MXE build 0152 "bison" # For MXE build 0153 "bzip2" # For MXE build 0154 "flex" # For MXE build 0155 "gcc-mingw-w64" # For MXE build 0156 "g++" # For MXE build 0157 "g++-multilib" # For MXE build 0158 "gettext" # For MXE build 0159 "git" # For MXE build 0160 "gperf" # For MXE build 0161 "icoutils" # For MXE build 0162 "intltool" # For MXE build 0163 "libc6-dev-i386" # For MXE build 0164 "libgdk-pixbuf2.0-dev" # For MXE build 0165 "gtk-doc-tools" # For MXE build 0166 "libltdl-dev" # For MXE build 0167 "libgl-dev" # For MXE build 0168 "libssl-dev" # For MXE build 0169 "libtool" # For MXE build 0170 "libtool-bin" # For MXE build 0171 "libxml-parser-perl" # For MXE build 0172 "lzip" # For MXE build 0173 "make" # For MXE build 0174 "openssl" # For MXE build 0175 "p7zip-full" # For MXE build 0176 "patch" # For MXE build 0177 "perl" # For MXE build 0178 "python3" # For MXE build 0179 "python3-mako" # For MXE build 0180 "python3-pkg-resources" # For MXE build 0181 "python-mako" # For MXE build 0182 "python-pkg-resources" # For MXE build 0183 "python-is-python3" # For MXE build 0184 "ruby" # For MXE build 0185 "scons" # For MXE build 0186 "sed" # For MXE build 0187 "unzip" # For MXE build 0188 "wget" # For MXE build 0189 "xz-utils" # For MXE build 0190 "ccache" # For compiling 0191 "bison" # For Qt build (>= 2.5.0) 0192 "flex" # For compiling (>= 2.5.0) 0193 "curl" # For CI/CD 0194 "wget" # For CI/CD 0195 "coreutils" # For CI/CD 0196 #TODO add new optional packages 0197 ) 0198 0199 0200 for pkg in ${optional_packages[@]}; do 0201 sudo apt-get install -y ${pkg} 0202 echo "-------------------------------------------------------------------" 0203 done 0204