12-10-2016, 09:50 PM | #1 |
Enthusiast
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
|
Calibre on Ubuntu on Windows (WSL)
Although not apparent at first glance, this picture is calibre running on the Windows Subsystem for Linux.
Why?: Because you can No really why?: Shit and giggles Theoretical whys: - test if your plugin works on linux - use linux-only plugins (although as of this moment there is only one such plugin - recoll - and it should not be linux-only since recoll is also available on the windows platform). - (very theoretical) I have a feeling that visual studio ptvsd will work better connecting to a linux remote debugger than it does with the source code on a local windows only environment. (more to come on that later if I manage it). Environment: - Windows 14965+ ______________________________ / Distributor ID: Ubuntu Description: \ | Ubuntu 16.04.1 LTS Release: 16.04 | \ Codename: xenial / ------------------------------------- How to do it. Windows side: - install VcXsrv (or Xming, but I used VcXrv) Bash side: - X11 forwarding Code:
echo "export DISPLAY=:0.0" >> ~/.bashrc Code:
sudo sed -i 's$<listen>.*</listen>$<listen>tcp:host=localhost,port=0</listen>$' /etc/dbus-1/session.conf sudo apt-get -y update sudo apt-get -y upgrade sudo apt-get install -y calibre - monotonic patch for some reason, kovid's monotonic implementation crashes in this environment. replace it with pipy's own monotonic lib. Code:
sudo mv /usr/lib/calibre/calibre/utils/monotonic.py /usr/lib/calibre/calibre/utils/monotonic.bak sudo mv /usr/lib/calibre/calibre/utils/monotonic.pyc /usr/lib/calibre/calibre/utils/monotonic.bakc sudo wget https://raw.githubusercontent.com/atdt/monotonic/master/monotonic.py sudo mv monotonic.py /usr/lib/calibre/calibre/utils/monotonic.py There shouldn't be anything not obvious missing. I chose not to go into the obvious stuff like install xpdf to be able to view pdf files, etc. *edited* Forgot a part. I can totally picture Kovid's face twisting in disgust at this "patch". In /home/wsl/calibre/src/calibre/gui2/__init__.py, comment out line 1159 #fcntl.fcntl(fd, fcntl.F_SETFD, flags | cloexec_flag | os.O_NONBLOCK) be warned that this tiny comment is bound to have huge effects on everything from filelocking to leaking file descriptors, to making your harddrive explode (not really). Last edited by botmtl; 12-14-2016 at 07:43 PM. |
12-10-2016, 10:00 PM | #2 |
creator of calibre
Posts: 44,306
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Cute -- although the thing I'd be most worried about is filesystem operations. calibre pushes filesystems hard and its quite likely that the filesystem semantics of WSL do not fully match those of linux. So you could end up with data loss/corruption in your calibre library.
Also note that ctypes based implementations of monotonic are *much* slower than native ones, which is why I dont use them. |
Advert | |
|
12-14-2016, 06:45 PM | #3 | |
Enthusiast
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
|
Quote:
I think Microsoft is on to something with wsl. And thankfully they are not google, they won't drop the project in beta and say "oh well, that's that". |
|
12-14-2016, 07:16 PM | #4 | |
null operator (he/him)
Posts: 20,906
Karma: 27620686
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
12-15-2016, 12:07 PM | #5 | |
Enthusiast
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
|
Quote:
Contrast that to google. Let's recap just a few of their dropped projects (this list is by no means complete) :
|
|
Advert | |
|
12-15-2016, 02:05 PM | #6 | |
Resident Curmudgeon
Posts: 75,810
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The one thing MS dropped that caused the most outrage & sadness is when they killed off Clippy. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF to TXT, Windows vs Ubuntu? | jayr | Conversion | 5 | 05-10-2016 09:02 PM |
Ubuntu userland running on Windows 10 | kacir | News | 22 | 04-10-2016 08:45 AM |
Ubuntu Headless, Windows 8.1 and database malformation (Cygwin?) | Kouwezakkie | Devices | 2 | 03-01-2015 01:56 PM |
news works in windows but not in ubuntu | butitsmyname | Calibre | 1 | 12-09-2010 01:29 PM |
Seriously thoughtful Should I switch to Ubuntu, or stay with Windows XP? | frabjous | Lounge | 197 | 06-15-2009 05:21 AM |