-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Package Request] python-firetv #2320
Comments
That log doesn't seem to indicate that anything went wrong with compiling |
Okay, I wasn't sure because when I try and compile swig it complains about pcre. Here is the output from my attempt to compile swig. Here is my make file for swig. Other dependencies for python-firetv are python-dev and libssl-dev. I was looking for source files for those packages and couldn't seem to find those. How should I handle those requirements when I get to that point? |
You might have to tell swig where to find the pcre config file. The location is probably different than swig expects. For example, there may be a config arg you can pass on to swig. As for the python-dev and libssl-dev requirements, that naming convention (the |
I was able to compile swig with config arguments = --without-pcre. Whether that will work for fire-tv or not remains to be seen. So I tried to proceed with the build. I took the homeassistant spk as a template since I know it's a python package too. When I proceeded the first obstacle I found was that cross/openssl fails to compile because openssl-1.0.2g no longer is available. I changed the version in that make file to point to the current version 1.0.2h. That got me past that point. But then I found that python doesn't compile. Here is the ouput I got when trying to compile python. |
That comes up more often...compile native packages separately, before anything else. |
Thanks for pointing me to Mercurial. That worked as a good template for firetv. This is what I did with the make file. Things seemed to go okay when compiling. "If you want the HTTP server component installed as a script, use: pip install firetv[firetv-server]" |
So-called Btw, if you're not doing so already, I would suggest to get firetv from PyPI: https://pypi.python.org/pypi/firetv/1.0.2. Official releases via PyPI are preferred over source installs. |
So I should do something like "WHEELS = src/requirements.txt" and in that lay out the python modules required by firetv including firetv[firetv-server]==1.0.2? |
Sounds about right, yes. Seeing as we've never needed to use extras in spksrc, it's potentially possible that pip doesn't recognize the wheel as valid, but there's only one way to find out ;) |
Okay things seem to be working. Except for the libssl-dev dependencies, I think. It seems that's why it's failing here |
m2crypto is already part of the Python SPK: https://github.com/SynoCommunity/spksrc/blob/master/spk/python/Makefile#L10. If that works, you can skip the dependency. During install, you'll need to add |
That didn't work. Here is the install.sh file. After I install the spk onto my syno and I try to run firetv-server from the command line I get the following message: root@dsm:~# /usr/local/firetv/env/bin/firetv-server Also I am wondering what these lines are for from the mercurial install.sh file:
Update: Here is a screenshot of what the site-packages folder's contents are after installing on my syno. It seems just the ones that are specified in the requirements.txt file get installed, nothing else. |
Maybe the virtualenv isn't setup correctly, because otherwise, there's no reason that M2Crypto isn't available for import. Check if M2Crypto is listed as installed inside the virtualenv by running a The lines do exactly what the comment above says: it creates a symlink for the Mercurial binary in |
This is what is listed when I exec pip freeze: root@dsm:~# /usr/local/firetv/env/bin/pip freeze Here is my install.sh file. Any ideas why the virtualenv isn't being set up properly? Update: Here is the make file for the firetv spk. Here is my requirements.txt located in src/requirements.txt |
I'd have started troubleshooting by recreating the virtualenv. Just follow the relevant bits in the installer, but run the commands manually. Check if Python provided by the Python SPK has M2Crypto installed: that's where the one in the virtualenv comes from. Same as before, just a different location: |
I think my python installation was borked, perhaps because I was trying to install the fire-tv module with the synocummunity python package. Anyway uninstalling and reinstalling took away the problem of the missing mcrypto. Now I am seeing this happen when trying to run firetv-server: root@dsm:/volume1/@appstore/firetv# firetv-server I've tried compiling the spk both with "DEPENDS = cross/libusb" and without. Any idea how to get past this obstacle? Thanks again for all your help throughout this process! |
Well, clearly firetv is looking for a file called
|
It is part of the build process but it isn't getting included in the package. I have a PLIST, but unfortunately it still isn't getting included in the package. This is what my PLIST file looks like: lnk:lib/libusb-1.0.so The plist file that gets created during compile looks like: Any ideas why none of these files are being included in the package? Here is the portion of the build process that deals with libusb. |
This is not enough info. Put your branch on Github, so I can see how you're putting things together. |
I put my branch up. |
Two things:
|
Great! We're getting close to success. So now the necessary files are being included with the package. I did get a warning at the end of the build process "make: warning: Clock skew detected. Your build may be incomplete." Also, there is still a problem with firetv not being able to find libusb-1.0.so but I was able to get it to run by your suggestion of using "env LD_LIBRARY_PATH=/usr/local/firetv/lib firetv-server -d [IP-of-FireTV-Device:Port]" I think the next step of making this an actual package that I could contribute to spksrc would be to design a very simple UI to run the package from the Package Center in dsm with the ability to specify the IP and port of the fire tv device. After that people who install the package will be able to control their firetv devices with http commands. Do you have any suggestions to point me towards accomplishing this? The command to run the program would be what I mentioned above. The ip & port of the fire tv device should come from user input. |
Clock skew can be caused if you're building in a VM: time(-sync) is responsible for this. As for the UI: if you're talking about an actual UI to manage the package (as Debian-Chroot has, for example), then that's a lot of work to implement. I don't think Synology provides any documentation, and our current UI's are still based on the old visuals (and it looks like all packages using one are broken on DSM6) so we can't help there. If you're talking about a wizard which is run during package installation, that's doable. Assuming setting the IP and port is a one-time thing during package installation, then I suggest you go with that. |
I guess a wizard is what I had in mind. However, after giving it some thought I think it would be better to just have the package run without any parameters given upon install. All that really needs to be done to get it running is this command: env LD_LIBRARY_PATH=/usr/local/firetv/lib firetv-server I guess what I need to do is set it up the installer to create a user named firetv-server and have it execute that command to get it running. Is that something that can be done now with dsm 6.0? That's what I'm running and if I can't get the user to be created by the installer then I won't be able to test my work. |
See #2345. We can't create DSM6 users via the installer, Synology provides some other means. |
Yea I definitely would like to make it compatible with both dsm 5 and 6. I was just curious if it would be too difficult for me to proceed with my plans of setting up the firetv package to install a user and run as said user if I am running dsm 6.0 seeing as if I can't get the package to work on 6.0, I wouldn't be able to test it. |
So after testing this for a while, I am not so sure about setting up the spk as a run-able package with a wizard. I found that having firetv-server running in the background waiting for commands was unreliable for me. Sometimes it would become unresponsive perhaps due to network disruption or power disruption from the firetv device. I ended up writing a script to start the server, add the firetv device that I want to control, send the commands to effect the control I want and the kill the firetv server. So perhaps it's just better to leave the package the way it is and leave it something for scripting and command line usage. I will try to polish around the edges and submit a pull request soon. Thanks again for your help |
@Dr-Bean So I found where the location for "libusb-1.0.so" is defined. It is or can be defined in line 169 of "/usr/local/firetv/env/lib/python2.7/site-packages/libusb1.py". The line looks like this:
I can run "firetv-server" without having to use "env LD_LIBRARY_PATH=" if I change it to :
Do you know of a way to patch that file libusb1.py on install or someway to fix this so users can just execute firetv-server without having to define LD_LIBRARY_PATH? Or if LD_LIBRARY_PATH is the only way, is there someplace that it can be defined on install so users don't have to define it every time they want to run firetv-server? I'm just trying to clean this up a little before submitting a PR. Thanks |
While it's possible to patch the file via spksrc, it's probably better and easier to use e.g. a shell script that runs firetv. The libusb module's method of searching isn't really setup for anything else. Quick 'n' dirty, let's say you create a
...which you call with |
Ok thats about what I've been doing so far with my script:
Quick n' Dirty. I ended up using another device to add the firetv's through json. So instead of setting a default device I just run it without setting a default. |
I would really like to get this python package working on Synology. Could anyone offer some help or a hint to point me in the right direction to get this project started. I have a virtual machine set up to build it. I just haven't worked with a python package in spkrsrc before. Here is the link to the source. Thanks in advanced for any help
firetv-python provides a webserver from which you can control your amazon fire tv with commands from a browser. This is handy if you want to integrate fire tv with other smart home devices.
Update: I started by trying to build the dependency swig which in turn had a dependency pcre. So I tried to compile pcre and didn't have success with that. Here is the output from that attempted build.
The text was updated successfully, but these errors were encountered: