Jump to content


Photo

file .so for enigam2


  • Please log in to reply
64 replies to this topic

Re: file .so for enigam2 #41 athoik

  • PLi® Core member
  • 8,458 posts

+327
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 - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 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
  • 57 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
  • 8,458 posts

+327
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 - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 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
  • 57 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
  • 8,458 posts

+327
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 - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 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
  • 57 posts

0
Neutral

Posted 14 October 2017 - 19:50

ok thanks :)



Re: file .so for enigam2 #47 MiLo

  • PLi® Core member
  • 14,055 posts

+298
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
  • 57 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
  • 14,055 posts

+298
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 Lost in Space

  • Senior Member
  • 876 posts

+69
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
  • 57 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 Lost in Space

  • Senior Member
  • 876 posts

+69
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
  • 57 posts

0
Neutral

Posted 19 October 2017 - 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 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 19 October 2017 - 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, 19 October 2017 - 11:50.


Re: file .so for enigam2 #55 hacksat

  • Senior Member
  • 57 posts

0
Neutral

Posted 19 October 2017 - 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, 19 October 2017 - 18:58.


Re: file .so for enigam2 #56 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 19 October 2017 - 19:22

If you have a build environment ready, you can execute devshell recipe and then you will be able to crosscompile "simple" applications using $CC ...

The devshell will make your like easy.


Also the trick by compiling things using debian mipsel will work too! I did it that once using debian mips under qemu...

But again devshell and proper recipe, build everything, it makes your like easy, once you get it.

Edited by athoik, 19 October 2017 - 19:23.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: file .so for enigam2 #57 hacksat

  • Senior Member
  • 57 posts

0
Neutral

Posted 19 October 2017 - 20:32

hello, 
the shell works fine, I understand its operation.
the "make" shell compiles the platform I'm in, (debian)  :(


Re: file .so for enigam2 #58 hacksat

  • Senior Member
  • 57 posts

0
Neutral

Posted 20 October 2017 - 13:28

knows how to have a compiler that works?

I tried to install all the necessary synaptic packages but in the end the result is always the first mistake



Re: file .so for enigam2 #59 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 20 October 2017 - 16:02

The one that openeembedded builds work just fine!
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: file .so for enigam2 #60 hacksat

  • Senior Member
  • 57 posts

0
Neutral

Posted 20 October 2017 - 17:04

I tried with gcc-5-mips-linux-gnu but it does not work, this you've indicated to me you have never heard, have you ever compiled direct from ubuntu or debian?




4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users