Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Can plXPCOM be revived?

by RHainsworth (Acolyte)
on Feb 25, 2007 at 14:06 UTC ( #601998=perlquestion: print w/ replies, xml ) Need Help??
RHainsworth has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone got the perl bindings to XPCOM to work recently?

Background: XULRunner can now run XUL applications independently of Firefox, meaning that XUL can be used as a toolkit for widgets. I have toyed with XUL and liked it - it does what I want. The java bindings allow actions triggered by the XUL widgets to use java for scripting. It would seem a perl binding would allow the same for perl, eg., mouseover on a button would call a perl sub.

In an article on XULRunner, Axel Hect said it would run with any language that had XPCOM bindings, including perl. However, the plXPCOM project is now listed as inactive. So where can I go for help, if not here? Python's bindings exist (pyXPCOM) and apparently work, but I dont want to learn python to use XUL.

I have looked at other modules: XUL node, WxPerl, Perl-Tk, Gtk2 bindings. They all fail in some way (here's not the place to say why).

Problem: I cant get plXPCOM to compile with XULRunner on ubuntu linux with perl 5.8.8. Can anyone help? Various output is given below. Thanks in advance.

Trying to compile plXPCOM (taken from CVS repository) with xulrunner My .mozconfig is &lt;start&gt; # This file specifies the build flags for XULRunner. . $topsrcdir/xulrunner/config/mozconfig mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@ ac_add_options --enable-extensions=default,perl ac_add_options --disable-javaxpcom &lt;end&gt; The "disable java" option was because I was getting no jvi.h although +Sun's JRE is installed. I run linux/ubuntu edgy. From gcc -v: Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran, +objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zli +b --libexecdir=/usr/lib --without-included-gettext --enable-threads=p +osix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enabl +e-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checkin +g=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) Mozilla source is from: xulrunner-1.8.0.4-source.tar.bz2 Perl: v5.8.8 built for i486-linux-gnu-thread-multi The make ended with: /usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -typemap /usr/share +/perl/5.8/ExtUtils/typemap -typemap typemap Components.xs > Componen +ts.xsc && mv Components.xsc Components.c Please specify prototyping behavior for Components.xs (see perlxs manu +al) c++ -c -I../../../dist/include/system_wrappers -include ../../../con +fig/gcc_hidden.h -DOSTYPE=\"Linux2.6\" -DOSARCH=\"Linux\" -DBUILD_ID= +0000000000 -I../../../dist/include/xpcom -I../../../dist/include/str +ing -I../../../dist/include/perlxpcom -I../../../dist/include -I../.. +/../dist/include -I../../../dist/include/nspr -I../../../dist/sdk/ +include -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpoi +nter-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-p +rivacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar - +pthread -pipe -DNDEBUG -DTRIMMED -O -DMOZILLA_CLIENT -include ../. +./../mozilla-config.h -D_GNU_SOURCE -O2 -DVERSION=\"0.81\" -DXS_VE +RSION=\"0.81\" -fPIC "-I/usr/lib/perl/5.8/CORE" Components.c In file included from ../../../dist/include/string/nsAString.h:68, from ../../../dist/include/string/nsSubstring.h:43, from ../../../dist/include/string/nsString.h:44, from ../perlXPUtil.h:46, from Components.xs:39: ../../../dist/include/string/nsTAString.h:41:2: error: #error Cannot u +se internal string classes without MOZILLA_INTERNAL_API defined. Use +the frozen header nsStringAPI.h instead. In file included from ../../../dist/include/string/nsAString.h:74, from ../../../dist/include/string/nsSubstring.h:43, from ../../../dist/include/string/nsString.h:44, from ../perlXPUtil.h:46, from Components.xs:39: ../../../dist/include/string/nsTAString.h:41:2: error: #error Cannot u +se internal string classes without MOZILLA_INTERNAL_API defined. Use +the frozen header nsStringAPI.h instead. ../../../dist/include/xpcom/xptinfo.h: In member function ‘const nsXPT +CMiniVariant* nsXPTConstant::GetValue() const’: ../../../dist/include/xpcom/xptinfo.h:258: warning: type-punning to in +complete type might break strict-aliasing rules Components.xs: In function ‘void XS_Components_Classes(PerlInterpreter +*, CV*)’: Components.xs:99: error: ‘nsComponentManager’ has not been declared Components.xs:111: error: ‘nsComponentManager’ has not been declared Components.xs:114: warning: dereferencing type-punned pointer will bre +ak strict-aliasing rules Components.xs: In function ‘void XS_Components_ClassesByID(PerlInterpr +eter*, CV*)’: Components.xs:138: error: ‘nsComponentManager’ has not been declared Components.xs:141: warning: dereferencing type-punned pointer will bre +ak strict-aliasing rules Components.xs: In function ‘void XS_Components_GetService(PerlInterpre +ter*, CV*)’: Components.xs:190: error: ‘nsComponentManager’ has not been declared Components.xs:221: error: ‘nsServiceManager’ has not been declared Components.xs: In function ‘void XS_Components_Constructor(PerlInterpr +eter*, CV*)’: Components.xs:240: error: ‘nsComponentManager’ has not been declared Components.xs:250: error: ‘nsComponentManager’ has not been declared Components.xs:250: warning: dereferencing type-punned pointer will bre +ak strict-aliasing rules Components.xs: In function ‘void XS_Components_Manager(PerlInterpreter +*, CV*)’: Components.xs:267: error: ‘NS_GetGlobalComponentManager’ was not decla +red in this scope Components.xs:272: error: no matching function for call to ‘perlXPUtil +::makeXPObject(int, nsIID*, nsIComponentManager*&)’ ../perlXPUtil.h:100: note: candidates are: static SV* perlXPUtil::make +XPObject(nsCID*, nsIID*, nsISupports*) Components.xs: In function ‘void XS_Components_WrapObject(PerlInterpre +ter*, CV*)’: Components.xs:291: error: ‘do_CreateInstance’ was not declared in this + scope Components.xs:297: warning: dereferencing type-punned pointer will bre +ak strict-aliasing rules Components.c: In function ‘void XS_rawISupports_DESTROY(PerlInterprete +r*, CV*)’: Components.c:401: warning: unused variable ‘THIS’ Components.c: In function ‘void XS_XPCOM__nsISupports_DESTROY(PerlInte +rpreter*, CV*)’: Components.c:980: warning: unused variable ‘THIS’ nsISupports.xs: In function ‘void XS_XPCOM__nsISupports_QueryInterface +(PerlInterpreter*, CV*)’: nsISupports.xs:91: warning: dereferencing type-punned pointer will bre +ak strict-aliasing rules nsISupports.xs: In function ‘void XS_XPCOM__nsISupports_callXPCOMMetho +d(PerlInterpreter*, CV*)’: nsISupports.xs:700: warning: deleting ‘void*’ is undefined nsISupports.xs:709: warning: deleting ‘void*’ is undefined nsISupports.xs:840: warning: deleting ‘void*’ is undefined nsISupports.xs:130: warning: unused variable ‘t_ctou’ ../../../dist/include/xpcom/nsISupportsUtils.h: In static member funct +ion ‘static const nsIID& nsCOMTypeInfo<T>::GetIID() [with T = nsIComp +onentManager]’: Components.xs:264: instantiated from here ../../../dist/include/xpcom/nsISupportsUtils.h:202: error: incomplete +type ‘nsIComponentManager’ used in nested name specifier /usr/lib/perl/5.8/CORE/reentr.inc: At global scope: /usr/lib/perl/5.8/CORE/reentr.inc:155: warning: ‘group* Perl_reentr_ge +tgrent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:233: warning: ‘group* Perl_reentr_ge +tgrgid(gid_t)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:291: warning: ‘group* Perl_reentr_ge +tgrnam(const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:438: warning: ‘hostent* Perl_reentr_ +gethostbyaddr(const void*, socklen_t, int)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:459: warning: ‘hostent* Perl_reentr_ +gethostbyname(const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:500: warning: ‘hostent* Perl_reentr_ +gethostent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:578: warning: ‘char* Perl_reentr_get +login()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:713: warning: ‘netent* Perl_reentr_g +etnetbyaddr(uint32_t, int)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:734: warning: ‘netent* Perl_reentr_g +etnetbyname(const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:792: warning: ‘netent* Perl_reentr_g +etnetent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:870: warning: ‘protoent* Perl_reentr +_getprotobyname(const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:911: warning: ‘protoent* Perl_reentr +_getprotobynumber(int)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:952: warning: ‘protoent* Perl_reentr +_getprotoent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1010: warning: ‘passwd* Perl_reentr_ +getpwent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1088: warning: ‘passwd* Perl_reentr_ +getpwnam(const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1146: warning: ‘passwd* Perl_reentr_ +getpwuid(uid_t)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1204: warning: ‘servent* Perl_reentr +_getservbyname(const char*, const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1245: warning: ‘servent* Perl_reentr +_getservbyport(int, const char*)’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1286: warning: ‘servent* Perl_reentr +_getservent()’ defined but not used /usr/lib/perl/5.8/CORE/reentr.inc:1344: warning: ‘spwd* Perl_reentr_ge +tspnam(const char*)’ defined but not used make[5]: *** [Components.o] Error 1 &lt;snip&gt;

Comment on Can plXPCOM be revived?
Download Code
Re: Can plXPCOM be revived?
by syphilis (Canon) on Feb 25, 2007 at 15:16 UTC
    Concentrate on the "error" messages. Don't be too concerned with the "warning" messages (to begin with, at least).

    To avoid the first "error" message that you see, try inserting "DEFINE => ' -DMOZILLA_INTERNAL_API'," into the WriteMakefile() section of the Makefile.PL ... and see how things pan out from there.

    Cheers,
    Rob
Re: Can plXPCOM be revived?
by Anonymous Monk on Feb 25, 2007 at 17:48 UTC
    Python's bindings exist (pyXPCOM) and apparently work, but I dont want to learn python to use XUL.
    PyPerl + PyXPCOM ~ PlXPCOM
Re: Can plXPCOM be revived?
by bsdz (Friar) on Feb 26, 2007 at 13:18 UTC
Re: Can plXPCOM be revived?
by james2vegas (Chaplain) on Aug 07, 2009 at 23:15 UTC
    Difficult to tell which is more unmaintained, plXPCOM or PyPerl at this point. Surprised ActiveState still supports ActivePerl, really. You would think now that PyXPCOM has made a special Mozilla project thanks to the efforts of Python fan Benjamin Smedberg (when he's not rewriting make in Python) and been blessed with a maintainer from ActiveState, you'd think the Perl-friendly ActiveState would have thought about plXPCOM too, but alas, not.
Re: Can plXPCOM be revived?
by sortiz (Initiate) on Aug 17, 2010 at 23:45 UTC
    In the last few months I've been resurrecting the code, both sides are now working, the "Perl calls XPCOM" side (XPCOM.pm) is almost finished, the other side (to write a component in perl) requires some more work. A lot of testing needed, any one interested? Drop me a note.

      Any progress since 2010? Anything published? On http://plxpcom.mozdev.org/, the latest "news" is from 2005, and I can't find any XPCOM module on CPAN.

      A Perl XPCOM interface would be really helpful to control VirtualBox on non-Windows platforms. The "raw web service" has some bad smell, and adding SOAP does not really help. ;-)

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://601998]
Approved by Joost
Front-paged by astaines
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2014-08-22 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (153 votes), past polls