Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 09-13-2015, 01:27 PM   #1
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Port to Synology

I've been using Calibre to manage books for a while now. Love it. When I go on the road, however, I miss it. Loading all the periodicals into the library is nice but if I'm on the road, I miss seeing the covers, interacting with the system, etc.

The Big Hairy Audacious Goal (BHAG) in this thread is to port Calibre to run natively on the Synology drive and then run the content server to publish books to the mobile devices.

I'm trying to lay out the steps I'll have to follow to port Calibre to run on a Synology drive (Linux distribution of something with Intel x86 architecture). I figure from there, I can access the drive remotely and interact with the full library.

I built a development machine - Debian 7 (Wheezy) (and yes, I know that Jessie is the latest but this was simpler for VMware Fusion), loaded the Spark source (spksrc) development libraries to compile for Synology, and built a few makefiles. Took me overnight to do it, but not too bad. I think I'm ready to get dirty.

In full disclosure - I'm a product manager in a software company. I'm not a developer. This might not work. I'm will to learn and take care of the dependencies. I don't really know my way around Linux or vi, but I figure I can sort this out. Or learn a lot trying.

What I could use from the world at large is guidance. I saw the proviso from Kovid that running from the source code is not recommended and not supported. I get it. I don't think standard linux distributions will work here so to get this working I'd have to port. As to what the interface will look like in the end, I have no idea.

Comments? Recommendations? (look, if you think this is not doable, say so. but you have to say why you think that).

Oh, I almost forgot - I have COPS running on the Synology drive. I have OPDS feeds working. Nice app but not very visual. I prefer visual searching.

Regards,
Matt
matthewc100 is offline   Reply With Quote
Old 09-13-2015, 01:53 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If the synology is x86, the binary calibre distribution should work out of the box. If it is ARM then I believe there are several existin builds of calibre for ARM, including in some ARM enabled linux distros.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-13-2015, 02:29 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
binary distribution. The only real requirements are a recent enough glibc and i686/x86_64 architecture.

If your Synology runs ARM, you will need to install from source as Kovid doesn't distribute ARM binaries, but it should work just fine.

You will need to install the dependencies as listed on the calibre linux page. calibre officially supports compiling from source -- as in, it should work, but if you have problems with your distro provided calibre, you will need to prove the problem exists with the binary install or it is assumed the distro is the problem.

See the INSTALL file in the source code for compilation instructions.
See here for an example build script (Arch Linux PKGBUILD) that does the right things. It is pretty self-descriptive.


ArchLinuxArm at least offers a pre-built calibre for ARM, but you'd need to install ArchLinuxArm on the NAS, probably in a chroot (all those dependencies ). Raspbian (debian for Raspberry Pi) also has calibre, but they are usually quite out of date. Debian armel probably has it too, with the same proviso.


This is work, but might pay off big time: setup a calibre development environment, run armel in a VM, and spin off a frozen build of calibre for ARM. It would install with minimal, bundled dependencies, unlike going to the effort of a chroot.
You could distribute it as an unofficial solution for all those Synology owners, as this has come up before.

Last edited by eschwartz; 09-13-2015 at 02:44 PM.
eschwartz is offline   Reply With Quote
Old 09-13-2015, 03:23 PM   #4
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Binary distribution

Thank you, Kovid.

Quote:
Originally Posted by kovidgoyal View Post
If the synology is x86, the binary calibre distribution should work out of the box. If it is ARM then I believe there are several existin builds of calibre for ARM, including in some ARM enabled linux distros.
@kovid, when you mention the "binary distribution", I'm guessing you don't mean the linux install build. Which distribution are we talking about? Or more specifically, the distribution located where? I can start with that.
matthewc100 is offline   Reply With Quote
Old 09-13-2015, 03:38 PM   #5
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Synology Architectures

@eschwartz,
As it turns out, Synology drives use both. Fortunately, mine is x86. If I can figure out how to make this work for my drive, we can modify the process and do a build for ARM-based systems.

I'm at a quandry as to where the distribution is located that Kovid mentioned. Do you guys mean the standard tarball distribution? I found that.

Matt
matthewc100 is offline   Reply With Quote
Advert
Old 09-13-2015, 03:48 PM   #6
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Oh, I think I get it now. Install the Linux distribution in my VM, terminal into the /src directory, start hacking away. In fact, not much needs to be changed, so rebuild using that source and included libraries into Spark.

Got it. (If i don't have it, let me know).
Matt
matthewc100 is offline   Reply With Quote
Old 09-13-2015, 03:53 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The standard installer for any generic linux desktop, located at http://calibre-ebook.com/download_linux

Since as you say your Synology is an Intel i686 version, just pretend it is a headless desktop and install calibre as normal.

If you want to build calibre from source, even on i686, then feel free to indulge in that hobby horse. I do.

But it isn't *necessary* unless you intend to run calibre on an ARM processor.


It really is as simple as: no one has compiled the standalone version for ARM, and trying to install the version compiled for Intel i686 on an ARM processor is a fool's endeavor, no less than installing 64-bit code on an i686 processor.
A Synology is more or less a standard linux computer with a custom distro and no monitor attached.

Last edited by eschwartz; 09-13-2015 at 04:19 PM.
eschwartz is offline   Reply With Quote
Old 09-13-2015, 03:58 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Someone told me that they installed calibre on a synology nas using the new "docker" feature.

I confess that I don't know what the rules might be. The site https://hub.docker.com/r/aptalca/docker-rdp-calibre/ might be of interest, as might https://lime-technology.com/forum/in...?topic=39413.0.
chaley is offline   Reply With Quote
Old 09-13-2015, 05:26 PM   #9
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Distributions

got a little side-tracked - tried to install GitEye and it bombed for some reason.

Git's running on a 'calibre development directory', environment variable is set, profile is updated so I don't forget to do it again, I guess it's time to start pushing buttons.

@eschwartz - yep, the synology drive is just a headless linux box. I think they make a special distribution for it - a number of commands are not present by default (like rsync) - I figure I can run the application unmonitored, then tie in as needed. Not sure how I will get all the fetch script configurations copied over but one thing at a time. Recall the object here is to use their build package (spksrc), which will prove out the ARM path to be followed as well.

The good thing about the synology community is that I can make a build and they can help me verify that it works on their x86's as well - just doing a git publish request to their community and they chew on it from there. If I get this to build, I should be largely okay. I can futz with the ARM version later, since I can't test that.

@Chaley, I love the docker concept but I think i will set that aside for now. I suspect that's more than I can chew on right now. I will take a look at the forums, they might be able to add some insight and color onto this topic.

Matt

Last edited by matthewc100; 09-13-2015 at 05:29 PM. Reason: spksrc update
matthewc100 is offline   Reply With Quote
Old 09-13-2015, 05:45 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Cool, if you want to create a SPKSRC then go for it!

I myself have spent a while futzing around to get calibre to build properly without patching, inside a PKGBUILD for easy Arch User Repository distribution (and finally fixing the ugl(ier) hacks used in the distro calibre). This despite having a perfectly good non-packaged version running...

Last edited by eschwartz; 09-13-2015 at 05:48 PM.
eschwartz is offline   Reply With Quote
Old 09-13-2015, 05:49 PM   #11
matthewc100
Junior Member
matthewc100 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: California
Device: iPad Retina, Android phone, others
Docker

@chaley,

Well, I may have spoken too soon. Perhaps the docker is already built. funny, the spksrc team wants a 32-bit stable platform (so that's what I built) and Docker only supports 64-bit. Ah, life's little ironies…
matthewc100 is offline   Reply With Quote
Old 01-26-2016, 06:25 PM   #12
MrCaringi
Venezuelan
MrCaringi began at the beginning.
 
MrCaringi's Avatar
 
Posts: 52
Karma: 10
Join Date: Jan 2014
Location: now Living in Mexico City
Device: PW2 (B0D4 Series)
Very insteresting thread,

I bought a DS214play two months ago, and this sound like a very good use for this box...
... so, what ports do I need for publishing this page? ( I have some problems with my internet provider)
MrCaringi is offline   Reply With Quote
Old 01-26-2016, 09:02 PM   #13
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
I'm all for a little bit of hacking for fun. Personally I have a QNAP NAS which runs calibre2opds beautifully. I also have a Calibre Development Environment which I play with but I haven't yet built from source and probably won't unless I have a real reason to.

I am failing to understand one thing. Given you box is x86, it has been suggested in this thread that you simply use the usual x86 linux install script. I think eschwartz even provided a link. However, there is no mention of you having tried this. It really is as simple as accessing your NAS via ssh. Then, from the command line:

Code:
sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
This is taken from the Calibre download page link for a linux binary, If all goes well it will install Calibre in /opt/calibre and create the necessary symlinks. You don't have to worry about the dependencies since they are all packaged with the installer. It really may be that easy, in which case your Headless Calibre will be running on your Synology within minutes.

Good luck.
darryl is offline   Reply With Quote
Old 01-26-2016, 11:50 PM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by MrCaringi View Post
Very insteresting thread,

I bought a DS214play two months ago, and this sound like a very good use for this box...
... so, what ports do I need for publishing this page? ( I have some problems with my internet provider)
Ummm, see post #3???

If your box runs on an x86 processor, use the standard https://calibre-ebook.com/download_linux just like you would on a desktop PC running linux.

If your box runs on an ARM processor, you will just need to install the dependencies and calibre itself, by hand.
As I said above, the instructions are clearly delineated on the webpage and in the source code.
eschwartz is offline   Reply With Quote
Old 01-27-2016, 01:15 PM   #15
MrCaringi
Venezuelan
MrCaringi began at the beginning.
 
MrCaringi's Avatar
 
Posts: 52
Karma: 10
Join Date: Jan 2014
Location: now Living in Mexico City
Device: PW2 (B0D4 Series)
@darryl
@eschwartz

Thanks for writting! Ill do it this weekend!, I'll post the results!
MrCaringi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW1 lost PADs for serial port, but found signals near USB port uniqdom Kindle Developer's Corner 1 04-29-2015 08:45 AM
Marvin on Synology NAS mizio66 Marvin 2 03-18-2014 12:55 PM
Calibre with Synology NAS Johan1974 Devices 7 10-17-2013 05:24 PM
Calibre in Synology server kriken Related Tools 7 10-24-2012 02:58 PM


All times are GMT -4. The time now is 01:53 PM.


MobileRead.com is a privately owned, operated and funded community.