Author Topic: FortranProject plugin building via autotools in Linux  (Read 720 times)

Offline grem

  • Multiple posting newcomer
  • *
  • Posts: 10
FortranProject plugin building via autotools in Linux
« on: February 26, 2018, 11:13:40 am »
Hello, all!

Recently I start to use FortranProject plugin (in windows binary) and little later was surprised that in Linux (I also use Gentoo)
the building the Code::Blocks  with "--with-contrib-plugins=all" doesn't build mentioned plugin.
So I tried to write patch for Code::Blocks autotools files that allows also to build this plugin too.

I wrote it within Gentoo codeblocks-17.12 package update (codeblocks-17.12.ebuild) and at the moment it could be found on my github.
The only thing is that after it's applying autoconf and automake must be reruned as the "configure.ac" file will be modified.

I tested this patch for FortranProject that supplied with codeblocks 17.12 source code. After codeblocks and plugins building the COde::Blocks launches
and plugin works successfully (even with automake-1.15 while other codeblocks sources makefiles were generated with automake-1.13).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10961
    • Travis build status
Re: FortranProject plugin building via autotools in Linux
« Reply #1 on: February 26, 2018, 01:38:56 pm »
1. Please post a patch to the sf.net ticket page. Here it will be forgotten.
2. FortranProject is a separate external repo. So probably it is better idea to make it a separate installation/package with its own autotools. Here you can see how to setup autotools for cb plugin https://github.com/obfuscated/cb_editor_navigation
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline grem

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: FortranProject plugin building via autotools in Linux
« Reply #2 on: February 26, 2018, 02:29:23 pm »
1. Please post a patch to the sf.net ticket page. Here it will be forgotten.

Thank you for reply!
I also shall post patch at sf codeblocks tickets page later.

2. FortranProject is a separate external repo. So probably it is better idea to make it a separate installation/package with its own autotools. Here you can see how to setup autotools for cb plugin https://github.com/obfuscated/cb_editor_navigation

The problem is that FortranProject plugin sources are already presented in "codeblocks_17.12.tar.xz" release source-archive (under /src/plugins/contrib)
that is avalable at Code::Blocks download page.
And also it was presented early in the "codeblocks_16.01.tar.gz" release source-archive.

So patch is for official Code::Blocks tarball and it not only adds "FortranProject" Makefile.am files
and also modifies "src/plugins/contrib/Makefile.am" and "configure.ac" of codeblocks sources itself.

The patch is written in a way that corresponds the others plugins "Makefile.am" and has similar structure.

I hope it will be usefull for official tarballs that contains all plugins and allows to build also FortranProject plugin for Linux systems
when "--with-contrib-plugins=all" or "--with-contrib-plugins=FortranProject" is set. Or could be disabled when "--with-contrib-plugins=all,-FortanProject"  is set.
« Last Edit: February 26, 2018, 02:45:55 pm by grem »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10961
    • Travis build status
Re: FortranProject plugin building via autotools in Linux
« Reply #3 on: February 26, 2018, 08:50:41 pm »
Ok, but patches cannot be applied against released source code. They can only be applied against current trunk/master branches.

There are several problems with your patch (random order):
1. FortranProject cannot be part of "all" because the source code is not present in git clones of the svn repo. So adding it to "all" will break the build for all people using git.
2. Testing the patch with git based repo is not easy, because the code is not present in git.
3. Modifying files in  src/plugins/contrib/FortranProject is not possible, because these are files in another repository. This repository is managed by another project.

@Morten: It would be good if you can post why the fortran project repo has been made as external repo...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline grem

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: FortranProject plugin building via autotools in Linux
« Reply #4 on: February 27, 2018, 09:31:35 am »
I created Code::Blocks ticket today.

Ok, but patches cannot be applied against released source code. They can only be applied against current trunk/master branches.

Yes, it's a problem. I don't know how release-tarballs of Code::Blocks are formed and when FortranProject sources are added/merged to/with it.
So the patch really could be applied only to release-tarball and as I can see release-17.12 branch actually doesn't contain this plugin folder.

It's pity that only windows binaries offers this plugin, so I proposed this patch for linux release tarball when it forms.

There are several problems with your patch (random order):
1. FortranProject cannot be part of "all" because the source code is not present in git clones of the svn repo. So adding it to "all" will break the build for all people using git.
2. Testing the patch with git based repo is not easy, because the code is not present in git.
3. Modifying files in  src/plugins/contrib/FortranProject is not possible, because these are files in another repository. This repository is managed by another project.

@Morten: It would be good if you can post why the fortran project repo has been made as external repo...

Offline grem

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: FortranProject plugin building via autotools in Linux
« Reply #5 on: May 29, 2018, 10:34:03 am »
There are several problems with your patch (random order):
1. FortranProject cannot be part of "all" because the source code is not present in git clones of the svn repo. So adding it to "all" will break the build for all people using git.

I just run "svn checkout https://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code" and besides codeblocks trunk it downloads also FortranProject directory (and some others external sources). Is this behaviour of svn repo always was presented? But the .zip snapshot doesn't contain external sources.

Anyway the current patch is outdated due to changes that allows now to build FortranProject as separate package. I should rework the patch to check the presence of FortranProject directory and if exist than conditional patch it's autotools scripts to be able build it as part of contrib plugins.