Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: federix on February 05, 2016, 04:19:20 pm

Title: Build for Mac OS X - offer to help and request for help
Post by: federix on February 05, 2016, 04:19:20 pm
Hi all,

I'd be interested in building Code::Blocks for Mac OS X and sharing the results with the community here, but I have incurred in one issue (so far) while building

directorymonitor.cpp:27:10: fatal error: 'fam.h' file not found
#include <fam.h> //USES EITHER GAMIN OR FAM (IDENTICAL FILE MONITORING APIS)

Have I missed a requirement? Also, I was reading on the web that FAM is old and unmaintained. Are you using Gamin instead? Do you I have to install it on Mac OS X? Anybody know how? I did a quick search and it does not seem trivial...

Thanks

Fed
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: federix on February 05, 2016, 06:04:04 pm
Ok, so I managed to move forward in the compile process by leaving out a couple of plugins...

-FileManager,-NassiShneiderman

The FileManager one just needs an implementation of the DirectoryMonitor.cpp file that uses FS Events API from Mac OS X. Also, I think it may be a good idea to write an abstraction of that class to use iNotify instead of FAM/Gamin, so that then FS Events API and the Windows directory notification (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx) can be easily implemented on top of that abstraction.

For the NassiShneiderman plugin, I have no idea tbh  ;D

Unfortunately though I got this problem that I cannot move forward from


Code
Making all in wxspellchecker
depbase=`echo ../HunspellInterface.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
if /bin/sh ../../../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../../../src/include  -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__   -I./include -I./.. -I../../../../../src/sdk/wxscintilla/include -ansi -DTIXML_USE_STL  -O2 -ffast-math -DCB_AUTOCONF -std=c++11 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -DHUNSPELL_STATIC -MT ../HunspellInterface.lo -MD -MP -MF "$depbase.Tpo" -c -o ../HunspellInterface.lo ../HunspellInterface.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../../../../src/include -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -I./include -I./.. -I../../../../../src/sdk/wxscintilla/include -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -std=c++11 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -DHUNSPELL_STATIC -MT ../HunspellInterface.lo -MD -MP -MF ../.deps/HunspellInterface.Tpo -c ../HunspellInterface.cpp  -fno-common -DPIC -o ../.libs/HunspellInterface.o
../HunspellInterface.cpp:19:10: fatal error: 'hunspell/hunspell.hxx' file not found
#include "hunspell/hunspell.hxx"
         ^

Can't see why it cannot find the include for hunspell.hxx, it's definitely there. Could it be a ./configure issue?

Thx
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: federix on February 05, 2016, 06:16:25 pm
For this file

CodeBlocks/src/plugins/contrib/SpellChecker/HunspellInterface.cpp

it seems like the following include path is missing

-I../hunspell/src

from the g++ command to make it work...

Weird!

F
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: Easior Lars on February 05, 2016, 11:47:58 pm
For NassiShneiderman and SpellChecker plugins, you could brew install pkg-config, boost and hunspell by homebrew. Anyway, there are more discussions on how to build CB on Mac OS at http://forums.codeblocks.org/index.php/topic,20882.0.html.
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: dkulp on February 06, 2016, 01:58:50 am

For my command line builds, I'm doing:

Code
export CXXFLAGS="-stdlib=libc++ -std=c++11 -mmacosx-version-min=10.7"
  export OBJCXXFLAGS="-stdlib=libc++ -std=c++11"
  export CPPFLAGS="-mmacosx-version-min=10.7"

  export LDFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7 -Wl,-headerpad_max_install_names"
  export CXX=clang++
  export CXXCPP="clang++ -E"
  export CC=clang
  export CPP="clang -E"

./configure --prefix=/Users/dkulp/Applications/codeblocks --with-contrib-plugins=all,-FileManager,-NassiShneiderman,-spellchecker

The maxosx-version-min is needed to run on the older OSX's.   The headerpad is needed to be able to repackage some of the plugins in the .app.
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: federix on February 06, 2016, 12:18:11 pm
For NassiShneiderman and SpellChecker plugins, you could brew install pkg-config, boost and hunspell by homebrew. Anyway, there are more discussions on how to build CB on Mac OS at http://forums.codeblocks.org/index.php/topic,20882.0.html.

Thanks for this - just to be clear then, the hunspell.h file in Code::Blocks source is not what we are looking for to build? Because there is a header file by that name in the source, but you're suggesting I should install the hunspell package from homebrew...
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: Easior Lars on February 06, 2016, 01:22:41 pm
Thanks for this - just to be clear then, the hunspell.h file in Code::Blocks source is not what we are looking for to build? Because there is a header file by that name in the source, but you're suggesting I should install the hunspell package from homebrew...
In fact, there is a complete copy of hunspell source in CB source tree. I think that it is used to build CB on MS Windows platform to resolve the dependence problem on hunspell. I don't like that way.
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: MortenMacFly on February 06, 2016, 03:17:14 pm
I think that it is used to build CB on MS Windows platform to resolve the dependence problem on hunspell. I don't like that way.
Yes, that's for Windows only. We don't have a packaging system on windows, so that's the best you can do, unless you want to put binary 3rd party libs into the SVN source tree. Which is what we want to avoid.

So for Unix, please use the dev packages of your distro. Same applied for the Mac with homebrew...
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 07, 2016, 08:23:19 pm
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: MortenMacFly on November 07, 2016, 09:39:53 pm
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank
Wherever you want, but please choose a trustworthy platform. Then post the link here.

Gesendet von meinem Nexus 6P mit Tapatalk

Title: Re: Build for Mac OS X - offer to help and request for help
Post by: Xaviou on November 08, 2016, 09:53:07 pm
Hi
Hi!
I have build Code::Blocks 16.01 for Mac OS X with clang++ -std=c++11 -mmacosx-version-min=10.11,
and using wx3.0.2 (Mac OS X, unicode) - 64 bit.

Where can I upload my build for testing?

Best regards,
frankofrank
I'm interested in testing your build : is it possible ?

And I'm also interested by your build process (in case you agree to share it).

Regards
Xav'
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 09, 2016, 08:38:21 pm
Ok,

I want to help, so this is my first attempt at compiling:

https://goo.gl/dmpyBH


the build process was a little tricky :)

1) configure with options:
CXX=clang++  CXXFLAGS="-mmacosx-version-min=10.11   -std=gnu++11    -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0   -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__"  CC=clang   ./configure     --with-platform=macosx  --with-contrib-plugins=all,-FileManager,-NassiShneiderman,-spellchecker --enable-debug  --enable-source-formatter  --enable-class-wizard  --enable-code-completion  --enable-compiler  --enable-debugger  --enable-mime-handler --enable-open-files-list --enable-occurrences-highlighting     --with-wx-prefix=/usr/local/Cellar/wxmac/3.0.2_2

2) make  --> build codeblocks and libcodeblocks.dylib, but plugins was built in .so - there is a bug in libtool !

3) I have built plugins in .dylib using CodeBlocks_wx30_64.workspace in c::b 13.12 (with some changes)

4) I created CodeBlocks.app using mac_pack (with some changes)

regards
frankofrank




Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 12, 2016, 10:12:57 am
Hi!

This is my second attempt, with plugins=all,-FileManager,-NassiShneiderman

https://goo.gl/TWxmuP

steps are easy:

1) configure
CXX=clang++  CXXFLAGS="-mmacosx-version-min=10.11   -std=gnu++11    -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__"  CC=clang   CB_HUNSPELL_LIBS=-lhunspell-1.4    ./configure  --prefix=`pwd`/src/output  --with-platform=macosx  --with-contrib-plugins=all,-FileManager,-NassiShneiderman  --enable-source-formatter  --enable-class-wizard  --enable-code-completion  --enable-compiler  --enable-debugger  --enable-mime-handler  --enable-open-files-list  --enable-occurrences-highlighting    --with-wx-prefix=/usr/local/Cellar/wxmac/3.0.2_2

2) make

3) make install

4) copy all files from ./src/output to CodeBlocks.app


So, how can I put some changes to svn? Do I need permission to do that?

Regards,
frankofrank
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: oBFusCATed on November 12, 2016, 01:24:02 pm
http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)

You can post it here or on the tickets page.
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: ollydbg on November 12, 2016, 03:14:25 pm
Do I need permission to do that?
Hi, frankofrank, your contribution is great! I see a lot of Mac users around me, but they don't have a suitable C::B on their Mac system.
You can submit patches, and the C::B devs have rights to apply your patches to our SVN.  :)
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 13, 2016, 12:53:03 am
Ok,
for compatibility with version 13.12 where plugins are stored in
CodeBlocks.app/Contents/Resources/share/codeblocks/plugins

I suggest:

svn diff
Index: sdk/configmanager.cpp
===================================================================
--- sdk/configmanager.cpp   (revision 10921)
+++ sdk/configmanager.cpp   (working copy)
@@ -1503,19 +1503,23 @@
 #ifdef CB_AUTOCONF
     if (plugin_path_global.IsEmpty())
     {
-        if (platform::windows || platform::macosx)
+        if (platform::windows)
             ConfigManager::plugin_path_global = data_path_global;
+        else if (platform::macosx)
+            ConfigManager::plugin_path_global = data_path_global + _T("/plugins");
         else
         {


Regards,
frankofrank
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 16, 2016, 12:42:12 pm
Quote
You can submit patches, and the C::B devs have rights to apply your patches to our SVN.  :)

Ok, check my patches for tickets: #275 #425

Regards
frankofrank
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: Xaviou on November 18, 2016, 05:19:27 pm
Hi

I've downloaded your builds, but they both failed to be launched :
Quote
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/CodeBlocks.app

Tested on a MacBook Pro with OS X El Capitan (10.11.6)

Regards
Xav'
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: frankofrank on November 18, 2016, 10:30:03 pm
Are You using Safari? Try with Firefox, because You must first save .zip file,
and then extract CodeBlocks.app directory.

You can try my build rev10921: goo.gl/o7zjR8

Regards
frankofrank
Title: Re: Build for Mac OS X - offer to help and request for help
Post by: Xaviou on November 18, 2016, 11:15:50 pm
Are You using Safari? Try with Firefox, because You must first save .zip file,
and then extract CodeBlocks.app directory.
Chrome.
And this is exactly what I've done with the 2 builds :
You can try my build rev10921: goo.gl/o7zjR8
This one seems to work. I'll make further test, to be sure, but I can open it.
Many thanks for your work.

What about making a dmg file instead of a zip archive?
It would be more "OS X Friendly"  ;)

Again : thank you very much.

Regards
Xav'