Author Topic: Best way to update C::B on Linux from SVN  (Read 7046 times)

Offline Keeper

  • Multiple posting newcomer
  • *
  • Posts: 16
Best way to update C::B on Linux from SVN
« on: January 08, 2010, 06:03:42 pm »
I am using the nightly builds from the SVN.  I'm wondering what's the best way to update my installation?  I actually delete my build directory, reconfigure ( with a bash script ), and then recompile it.  Would it be best if I
Code
make clean
 make distclean
 make clean-bin
 make clean-zipfiles
first?  Or is it ok if I just install over the old one?

I've thought about changing the prefix to be in it's own dir so I can just wipe it out and start over, but thought I'd ask here first.

Thanks,
Keeper

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best way to update C::B on Linux from SVN
« Reply #1 on: January 08, 2010, 06:22:20 pm »
I've thought about changing the prefix to be in it's own dir so I can just wipe it out and start over, but thought I'd ask here first.
That's a good thing in any case.

You should delete the precompiled header-files (src/include/*.gch) manually and run ./bootstrap and ./configure [...].
Code
make clean
[/b] is normally not needed.

To run the bootstrap-script is not necessary in the most cases, but if one of the automake-files has changed and you don't do that, you will run in an error.

Offline Keeper

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Best way to update C::B on Linux from SVN
« Reply #2 on: January 08, 2010, 09:41:22 pm »
Ok, well I did install it to /usr/local

But I am going to change it to /usr/local/cb

that way I can delete it and rebuild at any point and know I've got a clean slate.

stefanos_

  • Guest
Re: Best way to update C::B on Linux from SVN
« Reply #3 on: May 15, 2010, 10:46:57 pm »
@jens: Hey mate, since you are using GNU / Linux, you might help me a bit.

I use GNU / Linux Fedora 12 (and soon 13), and I would like to do everything I do under Windows at work.

I update Code::Blocks using svn (either through RapidSVN or command line itself), open it with Code::Blocks stable edition; if everything works OK, I run update.bat and everything synchronizes smoothly.

Now about GNU / Linux. I have opened update script (for GNU / Linux systems) to see the differences from Windows batch file and saw that it does not do exactly the same things as update.bat.

I find it irritating all the time to run commands like

  • ./boostrap
  • ./configure --with-contrib-plugins=all
  • make
  • su -c 'make install'

whereas I have available CodeBlocks-unix.cbp and ContribPlugins-unix.workspace, and I compile everything just fine. What I did this time was to run the whole process as I usually do, and run afterwards ./update script. I can see that it has generated a run.sh script and by running it, it gives me the chance to test my application. What about an update command so I may avoid the previous painful procedure?

Shouldn't update script do exactly the same thing like update.bat?

Please advice.
« Last Edit: May 15, 2010, 10:49:01 pm by stefanos_ »

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Best way to update C::B on Linux from SVN
« Reply #4 on: May 19, 2010, 10:47:08 am »
Quote
I use GNU / Linux Fedora 12 (and soon 13)
Code
    * ./boostrap
    * ./configure --with-contrib-plugins=all
    * make
    * su -c 'make install'
Be courageous, with Fedora 13, it will be harder :
Code
    * ./boostrap
    * ./configure --with-contrib-plugins=[all plugins separated with commas, omitting codesnippets, because else you have to patch it]
    * make
    * su -c 'make install'

By the way, why dont you write a script in your home to handle that ? put all that in build_and_install_codeblocks_for_me.sh which could look like that :
Code
svn checkout http://svn.berlios.de/svnroot/repos/codeblocks/trunk
cd trunk
./boostrap
./configure --with-contrib-plugins=[all plugins separated with commas, omitting codesnippets, because else you have to patch codesnippets]
make
su -c 'make install'
It should'nt be a more convenient way ?
Kernel Extremist - PedroM power ©

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best way to update C::B on Linux from SVN
« Reply #5 on: May 19, 2010, 11:15:57 am »
Be courageous, with Fedora 13, it will be harder :
Code
    * ./boostrap
    * ./configure --with-contrib-plugins=[all plugins separated with commas, omitting codesnippets, because else you have to patch it]
    * make
    * su -c 'make install'

Try
Code
 ./configure --with-contrib-plugins=all,-codesnippets
Not absolutely sure about the comma (I'm forced to work on windows at the moment).

Code
./configure --help
should show you the correct syntax.

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Best way to update C::B on Linux from SVN
« Reply #6 on: May 19, 2010, 11:37:30 am »
Thank you, I am performing tests.
Kernel Extremist - PedroM power ©

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Best way to update C::B on Linux from SVN
« Reply #7 on: May 19, 2010, 01:11:11 pm »
Ok, this script works fine, your tip is good !
Code
#/bin/sh
svn checkout http://svn.berlios.de/svnroot/repos/codeblocks/trunk
cd trunk
./bootstrap
make clean
./configure --with-contrib-plugins=all,-codesnippets
make
su -c 'make install'
Thanks to you, I have now revision 6261 with the new logo 8)
Kernel Extremist - PedroM power ©

stefanos_

  • Guest
Re: Best way to update C::B on Linux from SVN
« Reply #8 on: May 24, 2010, 11:21:06 pm »
Hello guys and thanks for your replies. I don't think I have clarified my problem.

I think it would more appropriate if I would recall:

Under Windows, usually what I do is to download the latest SVN available revision code and open it with a stable Code::Blocks. I compile CodeBlocks.cbp and as soon as is finished, I close the current project and open ContribPlugins.workspace, choosing to compile workspace (so I may compile all plugins at once).

After it finished, I run the update.bat, and the necessary files are getting copied from devel directory to output after they get stripped.

Now, I can see that an update file exists for GNU / Linux environment(s) as well, but it does not behave exactly the same I would say. The reason I am saying this is because I run the same procedure as above for my Fedora, with the only difference, the update procedure. It didn't create the copies as I was expecting it to do so. Instead, I found a run.sh file and I had to execute it to test the changes.

After got disappointed, I had to go back to the traditional method, i.e. ./bootstrap, make, su -c 'make install' to make everything work.

Is it necessary to be like this? The Windows method is more convenient I would say.

Thanks again.
« Last Edit: June 28, 2010, 10:35:11 am by stefanos_ »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Best way to update C::B on Linux from SVN
« Reply #9 on: May 24, 2010, 11:43:22 pm »
After got disappointed, I had to go back to the traditional method, i.e. ./bootstrap, make, su -c 'make install' to make everything work.
What is the problem with this method?
1. It is faster, because you don't leave the console
2. It installs C::B in the system path => everything works as expected (desktop and menu shortcuts)

The ./update script is used when you compile from .cbp files and it works fine... (I've just tested it)
The thing is that on unixes the dynamic linker (the one loading the dlls (.so on linux)) doesn't look in the current directory at all (if you don't tell it to do so) (this is for security).

p.s. keep in mind that linux is not windows and some things are done differently -> most of the time executables are placed in the system folders
p.p.s. what is your distro, there is a chance that you can find an automatic way to build the C::B package (.ebuild for gentoo, -src.deb for debian, -src.rpm redhad/suse/centos, PKGBUILD for archlinux)
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best way to update C::B on Linux from SVN
« Reply #10 on: May 24, 2010, 11:44:27 pm »
What's the problem with calling run.sh ?
You should be able to run it from a file-explorer too (I use Thunar from xfce4).

The wrapper script is needed to make C::B find it's libraries on linux.
Alternatively you can add the output-directory to LD_LIBRARY_PATH in the startup-script of your user-account or add it to
Code
/etc/ld.so.conf
[/b] or create a *.conf-file in /etc.ld.so.conf.d/ (if it exists) and run ldconfig as root as described in: http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Linux_%28applies_to_all_distros%29#Resolving_issues.
Both alternatives might interfere with other ("normally") installed vesrions of C::B, because they permanently change the search-path for the libraries.

stefanos_

  • Guest
Re: Best way to update C::B on Linux from SVN
« Reply #11 on: May 25, 2010, 12:24:34 pm »
@jens: I did not say that I dislike using run.sh. All I simply said is, should not update.bat and update scripts behave the same?

What I tend to do with Windows version, is to simply synchronize my svn code with the trunk, open the .cbp and .workspace (windows version of course), compile both of them, and if everything works fine (accordingly to my needs of course), I run the update.bat file to use the latest revision.

All I want is the same procedure for Fedora; to open my Linux .cbp and .workspace files, compile them and run the update script to "upgrade" from an old svn revision to either the latest available one, or the one I manually choose.

I hope I made it clearer now, because I thought my initial question was clear and easy to comprehend.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best way to update C::B on Linux from SVN
« Reply #12 on: May 25, 2010, 12:57:59 pm »
So I don't see your problem, because it behaves exactly like on windows.

The only difference is that you have to use run.sh instead of codeblocks.exe.