Syntext Forums - Serna Enterprise XML Editor, Serna Free XML Editor
(#1 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default Debian packaging experience - 11-09-2009, 11:35 AM

Hi,

I’m looking into packaging Serna for Debian. Not sure how far I’ll get, but I’ll be posting my experiences here, mostly as notes for myself:

At first, I’m trying to simply get it to build.
  1. I started by checking out the current SVN,
  2. copying the files antlr-2.7.1.tar.gz DITA-OT1.4_fullpackage_bin.tar.gz docbook-xsl-1.68.1.tar.bz2 and qtpropertybrowser-2.5-opensource.tar.gz into 3rd/packages.
  3. Because I use git-svn, I had to create the directories 3rd/bin, 3rd/lib and 3rd/jade/lib
  4. I can now, in 3rd and with the right dependencies installed, run ./configure syspkgonly && ./checked_build.sh
  5. This fails in jade. I remove the flag "--no-verify" to ltconfig in antlr/2.7.1/antlr-2.7.1/lib/cpp/configure and try again (This needs to be investigated more). Now it works.
  6. In build/, I try ./configure syspkg && make.
  7. This fails due to some precision loss problems on amd64. I fix this by running
    Code:
    sed -e 's/typedef unsigned int size_type/typedef (void *) size_type/' -i $(fgrep -l size_type -r ../sfworks/ ../serna/)
    and undoing the effect in the file ../sfworks/common/FlexString.h again.
  8. Now, a template definitions is overlapping. This needs to be fixed in sfworks/common/IterTraits.h.
  9. In sfworks/common/impl/ThreadMutex.cxx, an && defined(__amd64__) has to be added.
  10. In a few places, I changed a cast to (int) to (long int).

At this point, I’m stuck: It seems that the bison used on Debian (version 2.4.1) is too new and too strict, and does not allow refering to $1.asString() in some places in sfworks/xpath/impl3/xpathParser.y and sfworks/xslt/impl/xsltParser.y. It works somewhat when using $<asString()>1 instead, but then I get this error message, and I don’t know how to continue:
Code:
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx: In member function ‘int Xslt::XsltTokenizer::getToken(Xpath::TokenValue*)’:
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:63: error: ‘LITERAL’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:63: error: ‘OPSLASH’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:64: error: ‘OP2SLASH’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:64: error: ‘AXISNAME’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:65: error: ‘NTEST_NODE’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:65: error: ‘NTEST_COMMENT’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:66: error: ‘NTEST_TEXT’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:66: error: ‘NTEST_PI’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:67: error: ‘NCNAME’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:67: error: ‘OPUNION’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:68: error: ‘OPDCOLON’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/sfworks/xslt/impl/Tokenizer.cxx:70: error: ‘FUNCTIONNAME’ was not declared in this scope
I have put my repository up on git.nomeata.de Git - serna.git/summary, where my changes can be found. I’d be grateful for any hints about the bison problem!
Reply With Quote
(#2 (permalink))
Old
kondor's Avatar
линукс-покемон
 
Posts: 48
Join Date: Apr 2009
Default 11-09-2009, 06:53 PM

The problem is the ``conflict'' of two generated .hpp header files:
Code:
xpath/xpathParser.hpp
xslt/xsltParser.hpp
xslt/impl/Tokenizer.cxx uses (includes) both of them, but they have the same include guard:
Code:
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
as well the same name for generated enum: yytokentype. So when xpath/xpathParser.hpp is included, the second will never be included because of the include guard.

If the following changed are made in the xslt/xsltParser.hpp:
Code:
s/YYTOKENTYPE/xslt_YYTOKENTYPE/g
s/yytokentype/xslt_yytokentype/g
then build successfully continues.

Hope this helps.

tested on Ubuntu 9.10 with bison 2.4.1


Get the latest updates on Syntext Blog
Reply With Quote
(#3 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default 11-10-2009, 09:51 AM

Thanks. I fixed it differently, without having to modify generated files, using the following patch:

Code:
diff --git a/sfworks/xslt/impl/Tokenizer.cxx b/sfworks/xslt/impl/Tokenizer.cxx
index eb91f52..fa34d6b 100644
--- a/sfworks/xslt/impl/Tokenizer.cxx
+++ b/sfworks/xslt/impl/Tokenizer.cxx
@@ -33,7 +33,10 @@
 #include "xslt/xsltParser.hpp"
 #ifdef USE_XPATH3
 # include "xpath/impl3/Tokenizer.h"
+#undef YYTOKENTYPE
+#define yytokentype xpath_tokentype
 # include "xpath/xpathParser.hpp"
+#undef yytokentype
 # include "xpath/impl3/ExprImpl.h"
 #else
 # include "xpath/impl/Tokenizer.h"
After fixing some more casts to (int), I’m now stuck with this problem:
Code:
make[2]: Entering directory `/home/jojo/debian/official/serna/serna-free/build/serna/pyapi'
/home/jojo/debian/official/serna/serna-free/3rd/bin/sip -c. -w -j1 -I /usr/share/sip/PyQt4 -x TYPE_STRUCT -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t Qt_4_5_0 -x Py_v3 -g /home/jojo/debian/official/serna/serna-free/serna/pyapi/SernaApiCore.sip
g++ -c -pipe -g -Wno-uninitialized -DQT_SHARED  -Wall -W -O2 -D_REENTRANT -fPIC -DNDEBUG -DNOCVSID -DOALLOC_TYPE=4 -DMULTI_THREADED -D__STDC_VERSION__=199901L -DQT_DLL -DTRACE_ON -DQT3_SUPPORT -DQT_THREAD_SUPPORT -I"/home/jojo/debian/official/serna/serna-free/sfworks/common/sysdep/i386-linux-g++" -I"/home/jojo/debian/official/serna/serna-free/serna/pyapi/.." -I"/home/jojo/debian/official/serna/serna-free/build/sfworks" -I"/home/jojo/debian/official/serna/serna-free/build/serna" -I"/home/jojo/debian/official/serna/serna-free/sfworks" -I"/usr/include/qt4" -I"/usr/include/qt4/QtCore" -I"/usr/include/qt4/QtGui" -I"/home/jojo/debian/official/serna/serna-free/3rd/jade" -I"/usr/include/python2.5" -o obj/sipSernaApiCorepart0.o sipSernaApiCorepart0.cpp
/home/jojo/debian/official/serna/serna-free/serna/pyapi/common/SString.sip: In function ‘int convertTo_SString(PyObject*, void**, int*, PyObject*)’:
/home/jojo/debian/official/serna/serna-free/serna/pyapi/common/SString.sip:385: error: ‘sipIsSubClassInstance’ was not declared in this scope
/home/jojo/debian/official/serna/serna-free/serna/pyapi/common/SString.sip:418: error: ‘sipConvertToCpp’ was not declared in this scope
make[2]: *** [obj/sipSernaApiCorepart0.o] Fehler 1
On debian, I have sip 4.9, and according to Potential Incompatibilities with Earlier Versions &mdash; SIP v4.9.1 Reference Guide, these two functions (which are deprecated since 4.4) were removed. Does anyone here know enough about sip to provide me a patch?
Reply With Quote
(#4 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default 11-10-2009, 09:54 AM

Hmm, the code in question is protected by #ifdef SIP_FEATURE_TYPE_STRUCT, but I have no idea where this macro could or should be defined or detected.
Reply With Quote
(#5 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default 11-10-2009, 02:04 PM

Ok, if I remove the "-x TYPE_STRUCT" option passed to sip4, it compiles. Not sure what other effects that has.
Reply With Quote
(#6 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default 11-10-2009, 02:58 PM

Next problem: No instances of Sp::Vector for the right types. I had to modify 3rd/jade/libsp/parser_inst.m4 and manually run "m4 ../libsp/instmac.m4 parser_inst.m4 > parser_inst.cxx", because the file parser_inst.cxx, although theoretically an auto-built file, was not auto-built. I hope that it will be possible to use the system-wide installation of jade and libsp, and ditch the 3rd-party stuff here.
Reply With Quote
(#7 (permalink))
Old
Junior Member
 
Posts: 7
Join Date: Nov 2009
Default 11-10-2009, 03:09 PM

Great, it built for the first time, and actually starts. It spits out a warning about a missing spell-checker, but I’m ignoring that for now.

Now lets see if this can be repeated :-)
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.1
vBulletin Skin developed by: vBStyles.com