Jump to content


Photo

file .so for enigam2


  • Please log in to reply
54 replies to this topic

Re: file .so for enigam2 #41 athoik

  • PLi® Core member
  • 6,178 posts

+212
Excellent

Posted 13 October 2017 - 22:45

Here's another one: https://github.com/O...fb8a736939f171f

The lines removed, used to build a python .so plugin callable by enigma2.
Wavefield T90: 0.8W - 5E - 7E - 13E - 16E - 19E - 23E - 26E - 28E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: file .so for enigam2 #42 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted 14 October 2017 - 19:35

hello, i saw your link, i am seeing many links but none of these links that says how to create a file.so for enigma2, i wanted to ask maybe is something that can not be said how to do it? I do not understand this thing



Re: file .so for enigam2 #43 athoik

  • PLi® Core member
  • 6,178 posts

+212
Excellent

Posted 14 October 2017 - 19:39

Do you know how to make normal e2 plugins?

Do you know how to compile your own OpenPLi from sources?

If the answer is NO - NO there is no point for further discussions.
Wavefield T90: 0.8W - 5E - 7E - 13E - 16E - 19E - 23E - 26E - 28E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: file .so for enigam2 #44 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted 14 October 2017 - 19:44

yes i  know how to make normal e2 plugins



Re: file .so for enigam2 #45 athoik

  • PLi® Core member
  • 6,178 posts

+212
Excellent

Posted 14 October 2017 - 19:48

So that's a YES - NO I guess..

Then you need to learn how to compile your image.

Revert the commit I point to you (bitrateviewer) and build image with that included.

If you succeed, then you can start making changes to that plugin, and gradually that will make your plugin, with that as a base.
Wavefield T90: 0.8W - 5E - 7E - 13E - 16E - 19E - 23E - 26E - 28E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: file .so for enigam2 #46 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted 14 October 2017 - 19:50

ok thanks :)



Re: file .so for enigam2 #47 MiLo

  • PLi® Core member
  • 13,504 posts

+281
Excellent

Posted 15 October 2017 - 19:21

Obfuscating is futile anyway. Don't bother.


And not just for technical reasons...

You can obfuscate your code all you like at home. Just don't expect your plugin to be accepted anywhere. And if no one can download and install your plugin, it's kinda pointless to obfuscate it, right?
Real musicians never die - they just decompose

Re: file .so for enigam2 #48 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted 15 October 2017 - 23:11

hello, no this is a plugin that I did just for some people and i do not want any of those who will have the plugin can read the source code, for this I want to obscure the code!

Re: file .so for enigam2 #49 MiLo

  • PLi® Core member
  • 13,504 posts

+281
Excellent

Posted 16 October 2017 - 17:19

Which is exactly what the GPL license is preventing you from doing!

You're distributing an Enigma2 extension, and thus must abide by the E2 license.

 

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.


Real musicians never die - they just decompose

Re: file .so for enigam2 #50 gutemine

  • Senior Member
  • 777 posts

+57
Good

Posted 16 October 2017 - 20:53

You are thinking way too complicated ... as usual :D

 

Look at the swig Tutorial http://www.swig.org/tutorial.html

 

With this example and if you compile the example.c directly on the box with a locally installed Debian Jessie like I normally do (so that you don't need any x-compile magic) it takes less then 5 min to have a working so module to be imported and tested ... disbelievers may check with attached files (sources and *.so for mipsel and armhf so files natively compiled).

 

Off course it doesn't call any enigma2 routines, but it works nicely also when loaded from enigma2 python code ;)

but for the thing the OP wants to achieve this approach would be more than ... sufficient ...

 

gutemine

Attached Files


Edited by gutemine, 16 October 2017 - 20:58.


Re: file .so for enigam2 #51 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted 17 October 2017 - 17:10

hello, I've seen your examples and that's what I want to get

I tried to do the instructions in the guide, with the various commands in the "make" folder

in the end i get the file.so but when i go into enigma2, i have the error (i can not open the file.so)

i have Debian 9 



Re: file .so for enigam2 #52 gutemine

  • Senior Member
  • 777 posts

+57
Good

Posted 17 October 2017 - 20:35

when you load from enigma2 you have to use the correct import path starting from /usr/lib/enigma2/python with dots instead of /, something like:

 

from Components.Sources.StaticText import StaticText

 

which could mean:

 

from Plugins.Extensions.MyExample import example (where example is the module name specified in example.i)

 

If you want to avoid this you can put the so file in another path like /mypath and extend the python search patch and then use python importlib load with code like this:

 

if os.path.exists("/mypath/my_example.so"):                                                     
        import sys                                                              
        sys.path.append("/mypath")                                             
        import importlib                                                        
        try:                                                                    
                dreamplus=importlib.import_module("example")                  
        except:                                                                 
                pass     

 

BUT all this would tell you your favourite search engine ... and keep in mind the *.so has to be compiled for mipsel or armhf depending on the box you have - an intel *.so from your PC will fail miserably to load - no mattter what you do ...


Edited by gutemine, 17 October 2017 - 20:38.


Re: file .so for enigam2 #53 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted Today, 09:08

Hello, thanks for the answer, let's see if I understand it well

 

the file.so, should be put into enigma2 box like this: 
.usr.lib.enigma2.python.Plugins.Extensions

 

but this is only to be done after you compile it for mipsel, cross compiler for mipsel!

otherwise if compiled simply with gcc in my pc whit debian 9 does not work



Re: file .so for enigam2 #54 gutemine

  • Senior Member
  • 777 posts

+57
Good

Posted Today, 11:49

Yes, you may try with the so files from my example tar.gz as they are compiled with mipsel or armhf, and you will see that they work if you import and call the method within a python plugin instead of the test.py example

Edited by gutemine, Today, 11:50.


Re: file .so for enigam2 #55 hacksat

  • Senior Member
  • 31 posts

0
Neutral

Posted Today, 18:57

thanks, 

what do you use to do the cross compiler? 

i'm trying various libraries but they give me all the mistake

fatal error: sh4-linux-gnu/python2.7/pyconfig.h

fatal error: mipsel-linux-gnu/python2.7/pyconfig.h etc


Edited by hacksat, Today, 18:58.





3 user(s) are reading this topic

2 members, 1 guests, 0 anonymous users