Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem printer configuration via KDE settings
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4547

PostPosted: Sat Mar 31, 2012 6:36 am    Post subject: Reply with quote

Could you replace ${PORTDIR}/kde-base/pykde4/files/kpythonpluginfactorywrapper.c with the following file:
Code:
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define VERSION_LEN 10

#define FORMAT EPREFIX PLUGIN_DIR "/kpython%spluginfactory.so"

static void *handle;
static void *(*wrapped_qt_plugin_instance)();

static void get_python_version(char* out) {
   int pipefd[2];
   pipe(pipefd);
   pid_t cpid = fork();
   if (cpid == 0) {
      close(pipefd[1]);
      read(pipefd[0], out, VERSION_LEN);
   } else {
      close(pipefd[0]);
      close(1);
      dup2(pipefd[1], 1);
      close(pipefd[1]);
      close(0);
      char *args[] = { "eselect", "python", "show", "--ABI", "--python2", 0 };
      execv(EPREFIX "/usr/bin/eselect", args);
   }
}

__attribute__((constructor))
static void init() {
   char buf[VERSION_LEN + 1];
   memset(buf, 0, VERSION_LEN + 1);
   get_python_version(buf);
   char *s = buf;
   while(*s != '\0') {
      if(*s == '\n') {
         *s = '\0';
         break;
         }
      ++s;
   }
   int length = strlen(FORMAT) + strlen(buf) + 1;
   char *name = malloc(length + 1);
   snprintf(name, length, FORMAT, buf);
   handle = dlopen(name, RTLD_NOW);
   free(name);
   wrapped_qt_plugin_instance = dlsym(handle, "qt_plugin_instance");
}

__attribute__((destructor))
static void fini() {
   dlclose(handle);
}

void *qt_plugin_instance() {
   return wrapped_qt_plugin_instance();
}

and recompile pykde4.
Does that fix your problems?
Back to top
View user's profile Send private message
Lustmored
Apprentice
Apprentice


Joined: 28 May 2010
Posts: 206
Location: Poland

PostPosted: Sat Mar 31, 2012 11:50 am    Post subject: Reply with quote

For me it fixes problem :D
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Sat Mar 31, 2012 4:04 pm    Post subject: Reply with quote

where is this file?

I would like to replace it!
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4547

PostPosted: Sat Mar 31, 2012 4:08 pm    Post subject: Reply with quote

papapenguin wrote:
where is this file?

I would like to replace it!

In a standard installation, $PORTDIR == /usr/portage (it can be placed anywhere - here it is /var/paludis/repositories/gentoo)
So if your portage tree is in /usr/portage, the file to replace is
/usr/portage/kde-base/pykde4/files/kpythonpluginfactorywrapper.c
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Sat Mar 31, 2012 9:35 pm    Post subject: Reply with quote

thanks franzf, that seemed to work for me too...

now I can begin to find out why my printer doesn't work!
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Wed Apr 04, 2012 4:25 am    Post subject: Reply with quote

ok, this is getting to be aggravating...all I want is to use my printer...

so, I just had an upgrade of PyQT, to which I rebuilt python...

it seems that this changed the pykde4 kpythonpluginfactorywrapper.c wrapper again...so, I tried to edit it and recompile pykde4...

now I get
Code:
papapenguin ~ # emerge pykde4
Calculating dependencies... done!

>>> Verifying ebuild manifests

!!! Digest verification failed:
!!! /usr/portage/kde-base/pykde4/files/kpythonpluginfactorywrapper.c
!!! Reason: Filesize does not match recorded size
!!! Got: 1469
!!! Expected: 1167
papapenguin ~ #

_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4547

PostPosted: Wed Apr 04, 2012 6:17 am    Post subject: Reply with quote

You ran emerge --sync, that syncs your portage tree with the one from your sync-server. This reverts ALL changes you do to the tree.
The best solution would be to create a local overlay. If you chose /usr/local/portage as your overlay, create a directory /usr/local/portage/kde-base. Put your complete /usr/portage/kde-base/pykde4-directory inside there. Now modify the kpythonpluginfactorywrapper.c in the /usr/local/portage/kde-base/pykde4/files and run
Code:
ebuild /usr/local/portage/kde-base/pykde4/pykde4-4.7.4.ebuild manifest

Now syncing will not anymore revert your changes to pykde4.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Mon Apr 16, 2012 9:06 am    Post subject: Reply with quote

papapenguin

making a local overlay is fine; if you 'know what you're doing'. If it works off the bat for you the fine, but you may get further frustrated by meeting another list of portage rules that will be new to you.

If you made those changes and re-emerged pykde4 once, you must have used repoman manifest after changing the files/kpythonpluginfactory.c. I cannot fathom how you then upgraded and not figured you need simply replicate the steps, finalised by repoman manifest to 'register' the changes to portage.

Having upgraded, are you now switching from dealing with -4.7.4 to -4.8.1, or is it -4.8.2 depending upon whether you are running stable or testing????
_________________
idella4@aus
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Wed Apr 25, 2012 3:46 am    Post subject: Reply with quote

thanks franzf and idella4...I am using 4.8.2, and forgot to add the ebuild manifest to correct the patch...it's now allowing me into printer configuration, but my printer still isn't working...

idella4, the whole thing started because I was trying to mask some packages to eventually 'return to stable'...that didn't work at all because I had some upgraded libraries that wouldn't rebuild without all of their respected packages emerging...

...I think that some packages needed to be rebuilt based on dependencies, but weren't actually rebuilt on revdep-rebuild...but I'm not sure about that...which is where I began my troubles with printing and system settings...

...again, this is all speculation from a novice...
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum