X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=geeqie-install-debian.sh;h=30997a9eb6261e98051f167479a856fd4b9579c1;hp=baf97d2ccf205d4a3f35def6f2aac6ca6840396c;hb=refs%2Fheads%2Fmaster;hpb=7099c38736b97970194f90d1bc3130c27e0a3f6b diff --git a/geeqie-install-debian.sh b/geeqie-install-debian.sh index baf97d2c..88fde4da 100755 --- a/geeqie-install-debian.sh +++ b/geeqie-install-debian.sh @@ -8,7 +8,7 @@ ## Dialogs allow the user to install additional features. ## -version="2022-07-17" +version="2024-01-22" description=' Geeqie is an image viewer. This script will download, compile, and install Geeqie on Debian-based systems. @@ -29,20 +29,22 @@ Command line options are: essential_array="git build-essential libglib2.0-0 -intltool libtool meson +ninja-build yelp-tools help2man doclifter" -# Optional for both GTK2 and GTK3 +# Optional for GTK3 optional_array="LCMS (for color management) liblcms2-dev exiv2 (for exif handling) libgexiv2-dev +evince (for print preview) +evince lua (for --remote commands) -liblua5.1-0-dev +liblua5.3-dev libffmpegthumbnailer (for mpeg thumbnails) libffmpegthumbnailer-dev libtiff (for tiff support) @@ -82,17 +84,15 @@ libomp-dev libarchive (for compressed files e.g. zip, including timezone) libarchive-dev libgspell (for spelling checks) -libgspell-1-dev" - -# Optional for GTK3 only -optional_gtk3_array="libchamplain gtk (for GPS maps) +libgspell-1-dev +libchamplain gtk (for GPS maps) libchamplain-gtk-0.12-dev libchamplain (for GPS maps) libchamplain-0.12-dev libpoppler (for pdf file preview) libpoppler-glib-dev -libgspell (for spelling checks) -libgspell-1-dev" +libjxl (for viewing .jxl images) +libjxl-dev" #################################################################### # Get System Info @@ -158,8 +158,8 @@ systemProfile() then DIST="${DIST}[$(tr "\n" ' ' < /etc/UnitedLinux-release | sed s/VERSION.*//)]" fi - OS=$(lowercase $OS) - DistroBasedOn=$(lowercase $DistroBasedOn) + OS=$(lowercase "$OS") + DistroBasedOn=$(lowercase "$DistroBasedOn") readonly OS readonly DIST readonly DistroBasedOn @@ -173,19 +173,12 @@ systemProfile() install_essential() { - i=0 - for file in $essential_array do - if [ $((i % 2)) -ne 0 ] + if package_query "$file" then - if package_query "$file" - then - package_install "$file" - fi + package_install "$file" fi - - i=$((i + 1)) done if [ "$1" = "GTK3" ] @@ -253,7 +246,7 @@ package_query() status=0 fi fi - return $status + return "$status" } package_install() @@ -352,7 +345,7 @@ do esac done -if [ "$LIST" ] +if [ -n "$LIST" ] then printf '%b\n' "Essential libraries:" for file in $essential_array @@ -367,13 +360,6 @@ then printf '%b\n' "$file" done - printf '\n' - printf '%b\n' "Optional for GTK3:" - for file in $optional_gtk3_array - do - printf '%b\n' "$file" - done - exit fi @@ -402,38 +388,24 @@ else fi # Use GTK3 as default -gtk2_installed=FALSE gtk3_installed=TRUE if [ "$mode" = "install" ] then - message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will download, compile, and install Geeqie source\ncode and its dependencies.\n\nA sub-folder named \"geeqie\" will be created in the\nfolder this script is run from, and the source code\nwill be downloaded to that sub-folder.\n\nIn this dialog you must select whether to compile\nfor GTK2 or GTK3.\nIf you want to use GPS maps or pdf preview,\nyou must choose GTK3.\nThe GTK2 version has a slightly different\nlook-and-feel compared to the GTK3 version,\nbut otherwise has the same features.\nYou may easily switch between the two after\ninstallation.\n\nIn subsequent dialogs you may choose which\noptional features to install." + message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will download, compile, and install Geeqie source\ncode and its dependencies.\n\nA sub-folder named \"geeqie\" will be created in the\nfolder this script is run from, and the source code\nwill be downloaded to that sub-folder.\n\nIn subsequent dialogs you may choose which\noptional features to install." title="Install Geeqie and dependencies" install_option=TRUE else - message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will update the Geeqie source code and its\ndependencies, and will compile and install Geeqie.\n\nYou may also switch the installed version from\nGTK2 to GTK3 and vice versa.\n\nIn this dialog you must select whether to compile\nfor GTK2 or GTK3.\nIf you want to use GPS maps or pdf preview,\nyou must choose GTK3.\nThe GTK2 version has a slightly different\nlook-and-feel compared to the GTK3 version,\nbut otherwise has the same features.\n\nIn subsequent dialogs you may choose which\noptional features to install." + message="This script is for use on Ubuntu and other\nDebian-based installations.\nIt will update the Geeqie source code and its\ndependencies, and will compile and install Geeqie.\n\nIn subsequent dialogs you may choose which\noptional features to install." title="Update Geeqie and re-install" install_option=FALSE - - # When updating, use previous installation as default - if [ -f config.log ] - then - if grep gtk-2.0 config.log > /dev/null - then - gtk2_installed=TRUE - gtk3_installed=FALSE - else - gtk2_installed=FALSE - gtk3_installed=TRUE - fi - fi fi -# Ask whether to install GTK2 or GTK3 or uninstall +# Ask whether to install GTK3 or uninstall -if ! gtk_version=$(zenity --title="$title" --width=370 --text="$message" --list --radiolist --column "" --column "" "$gtk3_installed" "GTK3 (required for GPS maps and pdf preview)" "$gtk2_installed" "GTK2" FALSE "Uninstall" --cancel-label="Cancel" --ok-label="OK" --hide-header 2> /dev/null) +if ! gtk_version=$(zenity --title="$title" --width=370 --text="$message" --list --radiolist --column "" --column "" "$gtk3_installed" "Install" FALSE "Uninstall" --cancel-label="Cancel" --ok-label="OK" --hide-header 2> /dev/null) then exit fi @@ -447,12 +419,11 @@ then exit 1 fi" > "$install_pass_script" chmod +x "$install_pass_script" -export SUDO_ASKPASS=$install_pass_script +export SUDO_ASKPASS="$install_pass_script" if [ "$gtk_version" = "Uninstall" ] then uninstall - exit fi # Put the install log in tmp, to avoid writing to PWD during a new install @@ -483,31 +454,7 @@ do i=$((i + 1)) done -# If GTK3 required, get the GTK3 options not yet installed -if [ -z "${gtk_version%%GTK3*}" ] -then - i=0 - for file in $optional_gtk3_array - do - if [ $((i % 2)) -eq 0 ] - then - package_title="$file" - else - if package_query "$file" - then - if [ -z "$option_string" ] - then - option_string="${install_option:+${install_option}}\n${file}\n${file}" - else - option_string="${option_string:+${option_string}}\n$install_option\n${package_title}\n${file}" - fi - fi - fi - i=$((i + 1)) - done -fi - -kill $zen_pid 2> /dev/null +kill "$zen_pid" 2> /dev/null # Ask the user which options to install if [ -n "$option_string" ] @@ -541,7 +488,7 @@ printf '%b\n' "#Getting new sources from server..." > "$zen_pipe" if [ "$mode" = "install" ] then - if ! git clone git://geeqie.org/geeqie.git >> "$install_log" 2>&1 + if ! git clone http://git.geeqie.org/git/geeqie.git >> "$install_log" 2>&1 then git_error=$(tail -n5 "$install_log" 2>&1) zenity --title="$title" --width=370 --height=400 --error --text="Git error:\n\n$git_error" 2> /dev/null @@ -565,7 +512,7 @@ fi printf '%b\n' "20" > "$zen_pipe" printf '%b\n' "#Cleaning installed version..." > "$zen_pipe" -if [ $mode = "install" ] +if [ "$mode" = "install" ] then cd geeqie || exit 1 else @@ -575,7 +522,7 @@ fi printf '%b\n' "30" > "$zen_pipe" printf '%b\n' "#Checkout required version..." > "$zen_pipe" -if [ "$BACK" ] +if [ -n "$BACK" ] then if ! git checkout master~"$BACK" >> "$install_log" 2>&1 then @@ -583,7 +530,7 @@ then zenity --title="$title" --width=370 --height=400 --error --text="Git error:\n\n$git_error" 2> /dev/null exit_install fi -elif [ "$COMMIT" ] +elif [ -n "$COMMIT" ] then if ! git checkout "$COMMIT" >> "$install_log" 2>&1 @@ -592,14 +539,13 @@ then zenity --title="$title" --width=370 --height=400 --error --text="Git error:\n\n$git_error" 2> /dev/null exit_install fi -elif [ "$TAG" ] +elif [ -n "$TAG" ] then if ! git checkout "$TAG" >> "$install_log" 2>&1 then git_error=$(tail -n5 "$install_log" 2>&1) zenity --title="$title" --width=370 --height=400 --error --text="Git error:\n\n$git_error" 2> /dev/null exit_install - exit fi fi @@ -614,10 +560,10 @@ then ninja -C build install else meson setup build - meson configure build -Dgtk3=false + meson configure --no-pager build printf '%b\n' "90 " > "$zen_pipe" printf '%b\n' "#Installing Geeqie..." > "$zen_pipe" - ninja -C build install + sudo --askpass meson install -C build fi rm "$install_pass_script"