[MacPorts] #35790: strigi: error: no member named 'tm' in the global namespace

MacPorts noreply at macports.org
Fri Sep 14 07:00:58 PDT 2012


#35790: strigi: error: no member named 'tm' in the global namespace
-------------------------------------+---------------------------
  Reporter:  danmichaelo+macports@…  |      Owner:  clubjuggler@…
      Type:  defect                  |     Status:  new
  Priority:  Normal                  |  Milestone:
 Component:  ports                   |    Version:  2.1.2
Resolution:                          |   Keywords:  mountainlion
      Port:  strigi                  |
-------------------------------------+---------------------------

Comment (by pwadas@…):

 Solved!! I was succeeded to build strigi and then
 KDE/Krusader/Kate/Konsole with the following procedure I saved. Apologies
 for its length, I'm attaching a patch too, maybe someone better with
 Macports internals would be able to use it and join to upstream, I'm
 rather general unix and not really familiar with macports stuff yet. Here
 it goes ( strigi-patch.diff  attached to the ticket )
 ========================
 0. Eat your lunch/breakfast and prepare yourself a cup of coffee, as it'll
 be quite a long procedure upon us :)
 Macports strigi build error with MountainLion ( 10.8.1 ) and Xcode 4.4.1
 is related to
 missing time structures, which are contained in "/usr/include/time.h".
 Seems that it's not included by default
 anymore with newer version of Xcode or its famous Command Line Tools
 package. So we are going to fix it by hand,
 you may also try to use attached patch, as I was succeeded with building
 it after a few afternoons of fixing the code,
 I found myself finally with the following 25 steps procedure, presented
 without any
 warranty etc. etc., use it on your own responsibility if you are brave ;-)

 After you finish it successfully, you should be able to build KDE with
 macports and MountainLion/Xcode 4.4.1, and able to
 use konsole, kate, krusader and other KDE-based applications available in
 macports.

 And so we start:

 1. alias port command with sudo and debug/verbose switches
          machine:~ user$ alias port='sudo port -dv'

 2. kill kdelauncher and kdeinit4 processess if they're running
         ps ax | grep -i kde

 3. make sure you've installed Xcode 4.4.1 and its Command Line tools
         Xcode => Preferences => Downloads

 4. disable port autocleaning in macports.conf
       machine:~ user$ sudo edit /opt/local/etc/macports/macports.conf =>
 portautoclean    no )

 5. uninstall and clean existing kde installations and dependencies
       machine:~ user$ port uninstall krusader konsole kate kdepimlibs4
 kde4-baseapps kde4-runtime \
             kdelibs4 akonadi soprano strigi attica oxygen-icons prison
 shared-desktop-ontologies
       machine:~ user$ port clean all

 6. update/upgrade ports
        machine:~ user$ port selfupdate  ( and possibly "port upgrade
 outdated" ) - this may take a while

 7. proceed to install strigi ( strigi-0.7.5_4.darwin_12 ) package with

      machine:~ user$ port install strigi configure.compiler=apple-gcc-4.2

 It will probably fail with the following message:

 ----
 make: *** [all] Error 2
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build"
 && /usr/bin/make -j4 -w all
 Exit code: 2
 command execution failed
 ----

 …which is irrelevant, and similar information just before (scroll a few
 screens above):

 ---
 /opt/local/bin/cmake -E cmake_progress_report
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/CMakeFiles
 [ 42%] Building CXX object
 libstreamanalyzer/lib/CMakeFiles/streamanalyzerstatic.dir/analyzerloader.cpp.o
 cd
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/libstreamanalyzer/lib
 && /opt/local/bin/g++-apple-4.2   -D_REENTRANT -DHAVE_CONFIG_H
 -DMAKE_STREAMANALYZER_LIB -pipe -O2 -arch x86_64  -fvisibility=hidden  […]
 _opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/lib/analyzerloader.cpp
 In file included from //usr/include/c++/4.2.1/cwchar:52,
                  from //usr/include/c++/4.2.1/bits/postypes.h:46,
                  from //usr/include/c++/4.2.1/iosfwd:49,
                  from //usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                  from //usr/include/c++/4.2.1/bits/char_traits.h:46,
                  from //usr/include/c++/4.2.1/string:47,
                  from
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/include/strigi/analysisresult.h:23,
                  from
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/lib/analysisresult.cpp:25:
 //usr/include/c++/4.2.1/ctime:68: error: '::tm' has not been declared
 //usr/include/c++/4.2.1/ctime:70: error: '::clock' has not been declared
 //usr/include/c++/4.2.1/ctime:71: error: '::difftime' has not been
 declared
 //usr/include/c++/4.2.1/ctime:72: error: '::mktime' has not been declared
 //usr/include/c++/4.2.1/ctime:73: error: '::time' has not been declared
 //usr/include/c++/4.2.1/ctime:74: error: '::asctime' has not been declared
 //usr/include/c++/4.2.1/ctime:75: error: '::ctime' has not been declared
 //usr/include/c++/4.2.1/ctime:76: error: '::gmtime' has not been declared
 //usr/include/c++/4.2.1/ctime:77: error: '::localtime' has not been
 declared
 //usr/include/c++/4.2.1/ctime:78: error: '::strftime' has not been
 declared

 ---

 8) Keep in mind strigi package is now configured, and it fails during one
 of  compilation stages. Now cd to the following build directory

 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build

 and issue "make" ( or sudo make ) command - it will fail, but  should
 return you more detailed information about the problem, which will look
 like this:

         machine:~ user$ pwd
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build

 PATCH(optional): you can try sudo make clean now, and sudo copy "build"
 directory e.g. to /var/root/strigi-build-bak, then start from the
 beginning to reach here.

         machine:~ user$ make    ( or sudo make )

 ----
 [ 39%] Building CXX object
 libstreamanalyzer/lib/CMakeFiles/streamanalyzerstatic.dir/analysisresult.cpp.o
 cd
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/libstreamanalyzer/lib
 && /opt/local/bin/g++-apple-4.2   -D_REENTRANT -DHAVE_CONFIG_H
 -DMAKE_STREAMANALYZER_LIB -pipe -O2 -arch x86_64  -fvisibility=hidden
 -fvisibility-inlines-hidden -O3 -DNDEBUG -arch x86_64 -isysroot /
 -mmacosx-version-min=10.8
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreams/include
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/libstreams/include
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/include
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/libstreamanalyzer/include
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/lib
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/libstreamanalyzer/lib
 -I/opt/local/include -I/opt/local/include/libavcodec
 -I/opt/local/include/libavformat -I/opt/local/include/libavutil
 -I/opt/local/include/libswscale -I/opt/local/include/libxml2    -fPIC -o
 CMakeFiles/streamanalyzerstatic.dir/analysisresult.cpp.o -c
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/lib/analysisresult.cpp
 In file included from //usr/include/c++/4.2.1/cwchar:52,
                  from //usr/include/c++/4.2.1/bits/postypes.h:46,
                  from //usr/include/c++/4.2.1/iosfwd:49,
                  from //usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                  from //usr/include/c++/4.2.1/bits/char_traits.h:46,
                  from //usr/include/c++/4.2.1/string:47,
                  from
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/include/strigi/analysisresult.h:23,
                  from
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/lib/analysisresult.cpp:25:
 //usr/include/c++/4.2.1/ctime:68: error: '::tm' has not been declared
 //usr/include/c++/4.2.1/ctime:70: error: '::clock' has not been declared
 //usr/include/c++/4.2.1/ctime:71: error: '::difftime' has not been
 declared
 //usr/include/c++/4.2.1/ctime:72: error: '::mktime' has not been declared
 //usr/include/c++/4.2.1/ctime:73: error: '::time' has not been declared
 //usr/include/c++/4.2.1/ctime:74: error: '::asctime' has not been declared
 -------------

 9) So, as shown the problem currently is with

 strigi-0.7.5/libstreamanalyzer/lib/analysisresult.cpp

 file. If you look in it, you'll see it includes strigiconfig.h file.
 So:

 sudo vi libstreams/include/strigi/strigiconfig.h

 and add the line

 #include "/usr/include/time.h"

 right before

 #ifndef STRIGICONFIG_H
 #define STRIGICONFIG_H

 ----
 #include "/usr/include/time.h"
 #ifndef STRIGICONFIG_H
 #define STRIGICONFIG_H
 ----


 10) now try issuing "make" ( or "sudo make" ) command again
 machine:~ user$ pwd
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build
 machine:~ user$

 this time it fails with error in file

         work/strigi-0.7.5/libstreamanalyzer/lib/analyzerconfiguration.cpp

 Look in it - it includes file we're gonna edit

         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/include/strigi/analyzerconfiguration.h

 add #include "/usr/include/time.h" again, and issue make ( or sudo make )
 once more.

 11) Repeat the procedure of adding #include "/usr/include/time.h" with

         work/strigi-0.7.5/libstreamanalyzer/lib/filelister.cpp
         sudo vi
 ../../../strigi/work/strigi-0.7.5/libstreamanalyzer/include/strigi/filelister.h

 12) try again, proceed the same way with

         work/strigi-0.7.5/libstreamanalyzer/lib/pdf/pdfparser.cpp which
 includes
         sudo vi
 ../../../strigi/work/strigi-0.7.5/libstreams/include/strigi/streambase.h

 13)
 work/strigi-0.7.5/libstreamanalyzer/lib/endanalyzers/arendanalyzer.cpp
 which includes
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/include/strigi/streamendanalyzer.h

 14)
 work/strigi-0.7.5/libstreamanalyzer/lib/endanalyzers/sdfendanalyzer.cpp
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/include/strigi/analysisresult.h

 15)     work/strigi-0.7.5/libstreamanalyzer/lib/xmlparser/libxmlstream.cpp
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/lib/xmlparser/xmlstream.h

 16)     work/strigi-0.7.5/libstreamanalyzer/lib/xesamparser.cpp
         sudo vi ../strigi-0.7.5/libstreamanalyzer/lib/xesamparser.h
         sudo vi ../strigi-0.7.5/libstreamanalyzer/include/strigi/query.h

 ----

 ======================


 17) now, take a deep relaxing breath ;-)

 after xesamparser, it fails with

 work/strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp

 file, reporting syntax error and ByteIOContext call error in virtual
 signed char function, like this:

         --
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp:
 In member function 'virtual signed char
 FFMPEGEndAnalyzer::analyze(Strigi::AnalysisResult&,
 Strigi::InputStream*)':
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/
 libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp:307: error:
 'ByteIOContext' was not declared in this scope
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp:307:
 error: expected `;' before 'ByteIOCtx'
         ----

 So, edit ffmpegendanalyzer.cpp file:

         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp

 find line (should be line 302 or so ) with function definition

         ---
         signed char
         FFMPEGEndAnalyzer::analyze(AnalysisResult& ar, ::InputStream* in)
 {
         ----

 and get rid of errorneous call simply by clearing/deleting/removing lines
 the

 function down to "return 0"
 in //Tags section (!!!!)

         ---
         signed char
         FFMPEGEndAnalyzer::analyze(AnalysisResult& ar, ::InputStream* in)
 {
                 return 0;
         }
         --

 ======================


 18) Proceed with #include "/usr/include/time.h" like previously above,
 with time structure not found in

         less
 work/strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexwriter.cpp
 so      sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexwriter.h
 and     sudo vi
 ../strigi-0.7.5/libstreamanalyzer/include/strigi/indexwriter.h

 sudo make again..

 19)     the same line with the error in jsgzipcompressstream:
         less
 work/strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/jsgzipcompressstream.cpp
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/jsgzipcompressstream.h
         sudo vi ../strigi-0.7.5/libstreams/include/strigi/bufferedstream.h

 This time I also had to put our include into cpp file:

         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/jsgzipcompressstream.cpp


 20)
 work/strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/tcharutils.cpp
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/tcharutils.h

 21)
 work/strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/indexdump/indexdump.cpp
         sudo vi
 ../strigi-0.7.5/libstreamanalyzer/plugins/indexers/cluceneindexer/indexdump/indexdump.cpp
 ====

 ..and that should be the last one of our little "sudo vi" … "sudo make"
 odyssey.

 Now, important: Do not make "port clean" as it would remove all our
 changes, proceed with

 22)
 machine:~ user$ pwd
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build
 machine:~ user$ sudo make clean

 ------
 PATCH(optional): you can try creating a patch now, to get a patch similar
 as the one attached:

 sudo diff -uNr /var/root/strigi-build-bak
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work/build/
 > $HOME/strigi-patch.diff
 -----

 23) remember, don't do "port clean", instead do

 machine:~ user$ sudo chown -R macports:admin
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_strigi/strigi/work


 24) Finally, go back  to your home directory, and try port install strigi
 ( if you remember, port command is aliased with sudo port -dv )

 machine:~ user$ cd
 machine:~ user$ port install strigi
 […much stuff, compilation debug here..]
 DEBUG: Ignoring loadcommand containing @executable_path in
 /opt/local/libexec/llvm-3.2/bin/opt
 DEBUG: Ignoring loadcommand containing @executable_path in
 /opt/local/libexec/llvm-3.2/bin/clang
 DEBUG: Ignoring loadcommand containing @executable_path in
 /opt/local/libexec/ld64/ld
 --->  Scanning binaries for linking errors
 --->  No broken files found.
 machine:~ user$ sudo port list installed |grep strigi
 strigi                         @0.7.5          devel/strigi
 machine:~ user$


 If you did everything properly just like I did, strigi package build and
 installation should go fine now, and then you'll be able to proceed with

 25)  make sure dbus instance with launchctl is up and running

 machine:~ user$ port notes dbus

   # sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-
 system.plist
   # launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-
 session.plist

 machine:~ user$ port install unrar dpkg rpm arj p7zip soprano kdelibs4
 kde4-runtime konsole kate krusader

 TADAM!!!
 machine:~ user$  open -a /Applications/MacPorts/KDE4/kate.app/
 machine:~ user$  open -a /Applications/MacPorts/KDE4/krusader.app/
 machine:~ user$  open -a /Applications/MacPorts/KDE4/konsole.app

 Welcome back to KDE world, let me know if you are happy now as I am :)
 Regards,
 Piotr Wadas <pwadas at jewish.org.pl>

 PS. As I'm looking for a job in London (UK) now ( 14th Sept. 2012 ), if
 you know
 somebody looking for an employee able to fix such thing as above, feel
 free
 to recommend me, thanks in adv.

 Anf of course huge thanks for Macports team, I'm linux guy in general, so
 thank to you people I'm really
 happy to use my beloved linux stuff on my  new MBP, great job! :)

-- 
Ticket URL: <https://trac.macports.org/ticket/35790#comment:5>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list