Commit Graph

80 Commits

Author SHA1 Message Date
Kovid Goyal ee88003c01 Use the same soname for the freetype library as webengine uses 2024-10-03 07:13:32 +05:30
Kovid Goyal 8fbb9b254b Linux installer: Check that freetype is new enough 2024-10-02 20:49:03 +05:30
Kovid Goyal cb1bfb98a0 Linux installer: Workaround for Python 3.13 breaking SSL
Fixes #2083284 [Calibre installation script fails on Fedora 41 arm64 with ssl error](https://bugs.launchpad.net/calibre/+bug/2083284)
2024-10-01 08:27:41 +05:30
Kovid Goyal 641386dca1 Use a newer toolchain to build Linux binaries
Qt 6.7.2 fails to build with gcc 9/glibc 2.31
2024-08-05 10:48:09 +05:30
Kovid Goyal 53b74283a4 sort imports in all python files 2024-03-30 13:02:22 +05:30
Kovid Goyal d447544e63 Revert "Bump the glibc version needed on linux"
This reverts commit 582122cc93.
Since we are going back to Qt 6.5 we dont need to build with newer
gcc
2023-12-08 09:10:12 +05:30
Kovid Goyal 582122cc93 Bump the glibc version needed on linux
Qt WebEngine 6.6 needs to be built with gcc that has -stdc++20 which
means we need to move to a ubuntu jammy image. The good part is this
harmonises ARM and Intel builds to both use jammy. The bad part is the
binaries now wont run on any distro released more than about a year ago.
Sigh.
2023-12-03 22:23:30 +05:30
Kovid Goyal bfa3f40279 typo in function name 2023-11-18 08:20:49 +05:30
Kovid Goyal 2d92d1009b Linux installer: Check that the user has libxcb-cursor.so.0 installed
If not quit early with an error message asking them to install it
2023-11-18 07:56:58 +05:30
Kovid Goyal b1aad38a4b Linux installer: Fix downloading of signatures for older versions
Fixes #2042748 [Unable to install previous version in isolated mode](https://bugs.launchpad.net/calibre/+bug/2042748)
2023-11-05 08:18:56 +05:30
Kovid Goyal d7c31f4a81 Automated fixes from ruff 2023-01-09 18:13:56 +05:30
Kovid Goyal cad8b4bb24 Linux installer: Nicer error message on ARM systems with glibc < 2.34 2022-11-04 20:31:55 +05:30
Kovid Goyal 32ed99b702 Linux installer: Also check for libOpenGL 2022-07-18 11:01:22 +05:30
Kovid Goyal 8478773194 Fix typo libopengl1 -> libopengl0 2022-07-15 07:41:41 +05:30
Kovid Goyal d413327e81 Linux installer: Check for libEGL as the QtGui module in Qt 6 links against it and many Linux servers dont have it installed 2022-07-14 23:57:15 +05:30
Kovid Goyal b93af62abf ... 2022-07-12 16:31:23 +05:30
Kovid Goyal 954cb38135 Linux installer: Fix glibc version check also being done when installing older versions 2022-07-12 16:09:50 +05:30
Kovid Goyal 5db39aa16e Drop 32-bit code paths 2022-07-06 19:19:39 +05:30
Kovid Goyal d92c5ccf87 Linux installer: Useful error message if glibc is too old 2022-07-06 19:19:36 +05:30
Hoai-Thu Vuong 73792ac787 fix missing space after semi colon on linux-installer.py 2021-01-05 11:29:15 +07:00
Kovid Goyal 9ff27782de Remove useless __future__ imports
Not needed on python3
2020-08-22 18:47:55 +05:30
Kovid Goyal 29cd8d64ea Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30
Kovid Goyal 1c66024316 Linux installer: Detect ARM 64bit as well as 32bit 2020-06-04 19:40:32 +05:30
Eli Schwartz 0163b537dc linux installer: fix python3 re.sub with mismatched str/bytes
This does not seem to have been a very commonly hit case, since it's
been broken for python3 since before 2014, but a user has just hit it
for the first time.

Fixes #1851873
2019-11-08 14:11:31 -05:00
Kovid Goyal 9536ffe8cd Merge branch 'pin-version' of https://github.com/widdix/calibre 2019-10-14 07:03:36 +05:30
Michael Wittig f93bf9379e fix 2019-10-13 19:15:32 +02:00
Michael Wittig 92c88b2637 Allow a user to specify the version that is installed 2019-10-13 18:48:46 +02:00
Eli Schwartz d50a6ddc1b use context managers to open files 2019-07-25 01:30:54 -04:00
Eli Schwartz 45ca4c7934 py3: merge multiline __future__ imports to not confuse 2to3 2019-05-27 00:41:14 -04:00
Kovid Goyal 1c22094803 Cleanup urllib imports 2019-05-02 07:25:03 +05:30
Kovid Goyal d6402a0fdd Use a non-deprecated technique for resuming partial downloads in the Linux installer. Fixes #1827289 [Deprecation warning in installation script.](https://bugs.launchpad.net/calibre/+bug/1827289) 2019-05-02 07:17:44 +05:30
Flaviu Tamas 01fbf09c0b Undo redundant imports & new-style raises
New-style rasies need to be redone in a py2-friendly way, and the
redudant imports are redudnant and can safely be removed
2018-09-10 12:11:29 +05:30
Flaviu Tamas 0889ee85ec Fix syntax errors
Command used:

futurize --no-diffs -f libfuturize.fixes.fix_print_with_import -f lib2to3.fixes.fix_throw -f lib2to3.fixes.fix_numliterals -f lib2to3.fixes.fix_except -f lib2to3.fixes.fix_exec -f lib2to3.fixes.fix_raise -f lib2to3.fixes.fix_tuple_params -f lib2to3.fixes.fix_ne -j20 -w -n setup recipes src manual setup.py recipes/*.recipe

And manual adjustments of print((...)) -> print(...)
2018-09-10 12:11:28 +05:30
Joel Goguen 1c25ba0042 Exclude execute from umask
If the umask is set up to exlude execute, the installer will set up
calibre to be unreadable by any user other than the installing user.
When installing as `root`, a starting umask of `0o077` results in the
installer choosing a new umask of `0o033`, which means the calibre
install directory (and child directories) are installed with permissions
`0o744`, so only the installing user can actually use the resulting
calibre install.

To test, start with a system umask of `0o077` and run the installer
script as root:

```
% sudo sh ./setup/linux-installer.sh
Using python executable: /usr/bin/python3
WARNING: Your current umask disallows reading of files by some users, this can cause system breakage when running the installer because of bugs in common system utilities.
Should the installer (f)ix the umask, (i)gnore it or (a)bort [f/i/a Default is abort]: f
umask changed to: 022
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-3.26.1-x86_64.txz
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
	Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
	Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
	Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
	Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
	Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
	Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
	Symlinking /opt/calibre/calibre to /usr/bin/calibre
	Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
	Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
	Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
	Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
	Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
	Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
	Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
	Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
	Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
	Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
	Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
	Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/site-functions/_calibre
Installing bash completion to: /usr/share/bash-completion/completions/calibre
Setting up desktop integration...
Creating un-installer: /usr/bin/calibre-uninstall
Run "calibre" to start calibre
```

And the resulting directory:
```
% ls -ld /opt/calibre
drwxr-xr-x. 5 root root 4.0K Jun 22 10:53 /opt/calibre/
```

Also verify the Python version, starting with no `/opt/calibre` and a system umask of `0o077`:
```
% sudo python3 ./setup/linux-installer.py
WARNING: Your current umask disallows reading of files by some users, this can cause system breakage when running the installer because of bugs in common system utilities.
Should the installer (f)ix the umask, (i)gnore it or (a)bort [f/i/a Default is abort]: f
umask changed to: 022
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-3.26.1-x86_64.txz
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
	Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
	Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
	Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
	Symlinking /opt/calibre/calibre to /usr/bin/calibre
	Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
	Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
	Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
	Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
	Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
	Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
	Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
	Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
	Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
	Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
	Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
	Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
	Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
	Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
	Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/site-functions/_calibre
Installing bash completion to: /usr/share/bash-completion/completions/calibre
Setting up desktop integration...
Creating un-installer: /usr/bin/calibre-uninstall
Run "calibre" to start calibre

% ls -ld /opt/calibre
drwxr-xr-x. 5 root root 4.0K Jun 22 10:55 /opt/calibre/
```

After each, verify calibre starts as a non-root user.
2018-06-22 10:49:26 -07:00
Kovid Goyal 73029303d6 Dont use a set literal in the installer since there are apparently people still running linux installations with python 2.6 2018-06-09 07:05:03 +05:30
Kovid Goyal db936049cd Add a shell script wrapper for the linux installer
Needed because Ubuntu 18.04 has decided, in its infinite wisdom to
have no default python executable, which makes it impossible to run
polyglot python scripts.
2018-04-28 10:05:18 +05:30
Kovid Goyal 9679a1c4f3 pep8 2018-04-28 08:52:46 +05:30
Kovid Goyal 2373a38005 Linux installer: Fix umask question not working with the recommended install command because stdin is a pipe 2018-04-14 15:44:02 +05:30
Kovid Goyal 631ca6393e Linux installer: A nicer error message if the user tries to run the installer on an ARM machine 2017-12-04 12:32:36 +05:30
Kovid Goyal 3e2276db36 Do not check umask for isolated installs 2017-02-27 01:32:34 +05:30
Kovid Goyal abbf258cfa Linux installer: Check that the umask is suitable before running the installer.
This prevents system breakage because of bugs in xdg-mime when the user
has set their umask to prevent reading of files by other users on the
system. See https://www.mobileread.com/forums/showthread.php?t=277803
2017-02-27 01:30:29 +05:30
Kovid Goyal b4abd1f1b3 pep8 2017-02-27 01:23:28 +05:30
Kovid Goyal 9b41e0c98f Reduce number of Downloading prints when the installer output is redirected to a file 2016-03-29 21:08:02 +05:30
Kovid Goyal 3eaf62de5b Yet another fix for python ssl distro compatibility
Apparently CentOS 7 just decided to backport the SSL patches from 2.7.9
to 2.7.5! Sigh.

I have no idea if this change will cause installation to stop working on
old Debian/Ubuntu. I love linux.

Fixes #1551800 [Automatic Linux install fails with SSL error](https://bugs.launchpad.net/calibre/+bug/1551800)
2016-03-01 22:22:58 +05:30
Kovid Goyal e71c1a4888 Change to using main server download URL for the linux installer 2016-01-09 10:53:50 +05:30
Kovid Goyal 5e8402c5ef Allow the linux installer to work even if the installation location is a symlink 2016-01-03 14:33:27 +05:30
Kovid Goyal 2b3a1ea10c Update CA root certificate to use a SHA256 signature 2015-12-23 11:29:43 +05:30
Kovid Goyal b44951a46c Do not run the post-installer through a shell 2015-11-22 07:31:02 +05:30
Kovid Goyal 27e4bd5b81 Simplify the main() function 2015-11-22 07:25:27 +05:30
Kovid Goyal 4abd16a4a5 Fix #396 (Fix UnicodeDecodeError in linux installer script) 2015-05-05 17:52:36 +05:30