<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>334702</bug_id>
          
          <creation_ts>2014-05-13 11:34:02 +0000</creation_ts>
          <short_desc>kglobalaccel and konqueror have linker errors on Mac OS X</short_desc>
          <delta_ts>2014-06-11 04:57:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kdelibs</product>
          <component>shortcuts</component>
          <version>4.13.0</version>
          <rep_platform>MacPorts</rep_platform>
          <op_sys>macOS</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>HI</priority>
          <bug_severity>grave</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Ian Wadham">iandw.au</reporter>
          <assigned_to name="kdelibs bugs">kdelibs-bugs-null</assigned_to>
          <cc>mk-lists</cc>
    
    <cc>niederstrasser</cc>
    
    <cc>rakuco</cc>
          
          <cf_commitlink>http://commits.kde.org/kdelibs/bdb672c5af44f5715a5bdf81193b9021ecd9f07a</cf_commitlink>
          <cf_versionfixedin>4.13.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1448062</commentid>
    <comment_count>0</comment_count>
    <who name="Ian Wadham">iandw.au</who>
    <bug_when>2014-05-13 11:34:02 +0000</bug_when>
    <thetext>Using kdesrc-build on Mac OS X I got the following errors when building kde-runtime.
    Linking CXX executable kglobalaccel
    Undefined symbols for architecture x86_64:
    &quot;GlobalShortcutsRegistry::keyPressed(int)&quot;, referenced from:
       hotKeyEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in
                kglobalaccel_mac.o
       KGlobalAccelImpl::keyPressed(int) in kglobalaccel_mac.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

There seems to be a problem in the CMakeLists.txt for kde-runtime/kglobalaccel or perhaps in the kde4_add_kdeinit_executable() macro as it functions on Mac OS X.

MacPorts has a workaround for this problem, but it consists in editing a list of *.o files from the CMakeFiles/kdeinit_kglobalaccel.dir into the link.txt file in CMakeFiles/kglobalaccel.dir, sometime during the build.

After my kdesrc-build run crashed the two directories contained different lists of *.o files. CMakeFiles/kdeinit_kglobalaccel.dir contained [globalshortcutcontext.o globalshortcutsregistry.o kdeinit_kglobalaccel_automoc.o kglobalaccel_mac.o component.o kglobalacceld.o globalshortcut.o main.o],

but CMakeFiles/kglobalaccel.dir contained only [kglobalaccel_automoc.o kglobalaccel_dummy.o 
kglobalaccel_mac.o] and the last of these failed to link.

Can you give me a patch or a workaround at the CMakeLists.txt level or macro level so that I
can continue to build KDE software from source, using kdesrc-build? This is part of a project to investigate, fix, test code for a much wider range of bugs in KDE software that occur on OS X.



Reproducible: Always

Steps to Reproduce:
Attempt to build kde-runtime from source on Mac OS X.
Actual Results:  
Build failed with linker errors in target kglobalaccel, object file kglobalaccel_mac.o.

Expected Results:  
Build without errors.

I am a KDE developer working on Mac OS X. I wish to build development versions of KDE libraries, utilities and apps, with full debug information, and the option to patch and test source code.  MacPorts is more oriented towards building release-type object-code for end-users.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448455</commentid>
    <comment_count>1</comment_count>
    <who name="Ian Wadham">iandw.au</who>
    <bug_when>2014-05-15 04:00:56 +0000</bug_when>
    <thetext>The following problem occurs when using kdesrc-build on Mac OSX to build kde4-baseapps and is perhaps related to the above:
    Linking CXX executable konqueror.app/Contents/MacOS/konqueror
    Undefined symbols for architecture x86_64:
      &quot;KonqMisc::konqFilteredURL(KonqMainWindow*, QString const&amp;, QString const&amp;)&quot;,
          referenced from: _kdemain in konqmain.o
      &quot;KonqMisc::createBrowserWindowFromProfile(QString const&amp;, QString const&amp;, KUrl const&amp;,
         KonqOpenURLRequest const&amp;, bool)&quot;, referenced from: _kdemain in konqmain.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [konqueror/src/konqueror.app/Contents/MacOS/konqueror] Error 1
    make[1]: *** [konqueror/src/CMakeFiles/konqueror.dir/all] Error 2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448528</commentid>
    <comment_count>2</comment_count>
      <attachid>86646</attachid>
    <who name="Raphael Kubo da Costa">rakuco</who>
    <bug_when>2014-05-15 10:45:52 +0000</bug_when>
    <thetext>Created attachment 86646
Proposed patch

Ian, can you apply this patch to kdelibs, rebuild/reinstall it and then try building kde-runtime and kde-baseapps again?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448545</commentid>
    <comment_count>3</comment_count>
    <who name="Ian Wadham">iandw.au</who>
    <bug_when>2014-05-15 12:20:59 +0000</bug_when>
    <thetext>You are a genius, Raphael! That patch went in without a hitch and I have now successfully re-built kdelibs, kde-runtime and kde-baseapps. The MacPorts guys will be pleased too.

Thank you very much.  Will you be putting it in master and KDE/4.13?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448560</commentid>
    <comment_count>4</comment_count>
    <who name="Raphael Kubo da Costa">rakuco</who>
    <bug_when>2014-05-15 13:27:02 +0000</bug_when>
    <thetext>Yes. Thanks for testing!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448561</commentid>
    <comment_count>5</comment_count>
    <who name="Raphael Kubo da Costa">rakuco</who>
    <bug_when>2014-05-15 13:33:57 +0000</bug_when>
    <thetext>Git commit bdb672c5af44f5715a5bdf81193b9021ecd9f07a by Raphael Kubo da Costa.
Committed on 15/05/2014 at 13:30.
Pushed by rkcosta into branch &apos;KDE/4.13&apos;.

KDE4_ADD_KDEINIT_EXECUTABLE: Check the right variable for Mac.

Fix a regression introduced by 52ee7642, which copy-pasted some code
from the Windows block. It caused the executable created with this macro
to unconditionally build and depend on the last source file passed to
it, even though it&apos;s only supposed to be part of the kdeinit_$TARGET
target.
FIXED-IN:	4.13.2

M  +2    -2    cmake/modules/KDE4Macros.cmake

http://commits.kde.org/kdelibs/bdb672c5af44f5715a5bdf81193b9021ecd9f07a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448772</commentid>
    <comment_count>6</comment_count>
    <who name="Marko Käning">mk-lists</who>
    <bug_when>2014-05-16 07:03:39 +0000</bug_when>
    <thetext>Backported to KDE libraries version 4.12.4 for current MacPorts tree in http://quickgit.kde.org/?p=macports-kde.git&amp;a=commitdiff&amp;h=49a61a2fd7399d2a49927e328b55709cfca5b49c</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>86646</attachid>
            <date>2014-05-15 10:45:52 +0000</date>
            <delta_ts>2014-05-15 10:45:52 +0000</delta_ts>
            <desc>Proposed patch</desc>
            <filename>kdelibs-mac-macro.patch</filename>
            <type>text/plain</type>
            <size>763</size>
            <attacher name="Raphael Kubo da Costa">rakuco</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL2NtYWtlL21vZHVsZXMvS0RFNE1hY3Jvcy5jbWFrZSBiL2NtYWtlL21vZHVs
ZXMvS0RFNE1hY3Jvcy5jbWFrZQppbmRleCBmNTE5MTgxLi5iZGU3Y2ZlIDEwMDY0NAotLS0gYS9j
bWFrZS9tb2R1bGVzL0tERTRNYWNyb3MuY21ha2UKKysrIGIvY21ha2UvbW9kdWxlcy9LREU0TWFj
cm9zLmNtYWtlCkBAIC04MjksOSArODI5LDkgQEAgbWFjcm8gKEtERTRfQUREX0tERUlOSVRfRVhF
Q1VUQUJMRSBfdGFyZ2V0X05BTUUgKQogCiAgICAgICBpZiAoUV9XU19NQUMpCiAJICAgICAgbGlz
dChGSU5EIF9TUkNTICouaWNucyBfaWNvbl9wb3NpdGlvbikKLQkgICAgICBpZihOT1QgX3Jlc19w
b3NpdGlvbiBFUVVBTCAtMSkKKwkgICAgICBpZihOT1QgX2ljb25fcG9zaXRpb24gRVFVQUwgLTEp
CiAJCSAgICAgIGxpc3QoR0VUIF9TUkNTICR7X2ljb25fcG9zaXRpb259IF9yZXNvdXJjZWZpbGUp
Ci0JICAgICAgZW5kaWYoTk9UIF9yZXNfcG9zaXRpb24gRVFVQUwgLTEpCisJICAgICAgZW5kaWYo
Tk9UIF9pY29uX3Bvc2l0aW9uIEVRVUFMIC0xKQogICAgICAgZW5kaWYgKFFfV1NfTUFDKQogICAg
ICAga2RlNF9hZGRfZXhlY3V0YWJsZSgke190YXJnZXRfTkFNRX0gIiR7X25vZ3VpfSIgJHtDTUFL
RV9DVVJSRU5UX0JJTkFSWV9ESVJ9LyR7X3RhcmdldF9OQU1FfV9kdW1teS5jcHAgJHtfcmVzb3Vy
Y2VmaWxlfSkKICAgICAgIHRhcmdldF9saW5rX2xpYnJhcmllcygke190YXJnZXRfTkFNRX0ga2Rl
aW5pdF8ke190YXJnZXRfTkFNRX0pCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>