Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Installation Support
- - By MrBeast [de] Date 2010-07-31 22:55 Edited 2010-07-31 23:01
I made some changes on the CMakeFile so OpenClonk can be installed via "make install".

Note: I changed the name of the clonk executable to clonk-bin to reserve the name for the actual command to run it. (In the CMakeFile I let create an shellscript which changes the directory to the right dir and then executes "clonk-bin")
Reply
Parent - - By MrBeast [de] Date 2010-08-02 14:33
No response, huh?
Reply
Parent - By Ringwaul [ca] Date 2010-08-02 15:26
I suppose the engine developers haven't yet reviewed it or so. :S

Installation sounds nifty though. Makes it look professional.
Reply
Parent - - By Asmageddon [pl] Date 2010-08-03 09:21
Well, as far as I heard using make install is a bad practice, as it tends to mess up system a little bit each time you do so....
Also this isn't really a wise thing to do with an (let's say)actively developed game....
Reply
Parent - By MrBeast [de] Date 2010-08-03 17:16
Not if you are knowing what are you doing, and also CMake installing procedures aren't bound to it.
Reply
Parent - - By Günther [de] Date 2010-08-03 11:53
I'd prefer to not change the name of the executable. That's just unnecessary churn.
Reply
Parent - - By MrBeast [de] Date 2010-08-03 15:10 Edited 2010-08-03 15:16
What to do instead?
Reply
Parent - By Günther [de] Date 2010-08-03 17:55
You could rename it during installation, or install it into /usr/libexec or /usr/lib.
Reply
Parent - - By MrBeast [de] Date 2010-08-03 17:12 Edited 2010-08-03 17:15
I've remade it now. Changes:
- The clonk binary doesn't change its name, write "runclonk" to run it from the correct working directory
- CPack support! CPack is an tool connected with CMake to generate RPMs, DEBs, Source Packages, Windows Installer and Mac Bundles. (It generally works now but I've not tested it fully yet)
Attachment: installCPack.bundle (434k)
Reply
Parent - By MrBeast [de] Date 2010-08-05 19:07
Some little changes. (Mostly I added an check if it's Unix and if not it uses an alternative minimal installation)
Attachment: install2.patch - You need to unbundle the bundle posted in the parent post before. (4k)
Reply
Parent - - By Newton [de] Date 2010-09-22 10:42
In the bundle, there are two seperate branches which conflict each other. I don't know anything about CPack so I have no idea what to merge how.

Can you also describe how to use CPack to generate these RPMs, DEBs, etc.? At least on the CM here, nobody has any experience with CPack. :-/
Parent - - By MrBeast [de] Date 2010-09-22 14:54 Edited 2010-09-22 14:59
Ow, sorry, I accidentally put the old version in the bundle, too.
"Installation Support V2 (Including CPack Support)" is the correct one, you can simply strip the other one.

to generate those packages simply write "cpack -G RPM" to generate an RPM, you can generate an DEB by replacing the RPM through DEB. Other possible values are NSIS (Windows Installer, however, you might want/should to add some additional info in the CMakeLists.txt, see link) plus STGZ, TBZ2, TGZ, TZ and ZIP (all simple archives with different compression.)
Reply
Parent - - By Newton [de] Date 2010-09-22 16:45
You mean, if I'd be running linux and have cpack installed, I can build and generate RPM/DEB/NSIS all automatically by running cpack -G RPM in the planet directory?

But how is it possible to create a nullsoft installer - where do I get the windows binaries from under linux then?
Parent - - By MrBeast [de] Date 2010-09-22 17:04 Edited 2010-09-22 17:16
Dunno, havn't tried yet. However I am sure you can run CPack under Windows the same way (via "cmd").

P.S.: If you didn't know: CPack is part of CMake, so if you have CMake you have also CPack
Reply
Parent - By Newton [de] Date 2010-09-22 23:54
Oh, no, I didn't know that.
Parent - - By Clonk-Karl [de] Date 2011-01-04 21:54
I have rebased your patch to default in my bitbucket repository: https://bitbucket.org/ck/openclonk/

In a followup patch, I changed the following:
* Pack game data after installation
* Remove the icons and install from src/res/oc.ico instead, so that if we update the icon ony day we install the new icon automatically
* Remove the runclonk script, instead add support for loading from a different path into the engine (as an extra patch)

I am going to push this in a few days if nobody points out obvious or potential problems with the engine changes.
Reply
Parent - - By Günther [de] Date 2011-01-05 01:45
Regarding https://bitbucket.org/ck/openclonk/changeset/a737cb66a5be:
- Just remove all unused code, don't comment it out.
- I Clonk, we use simple global variables for singletons. Reloc.Paths is a lot simpler to read and understand than C4RelocImpl::Instance().Paths. It also saves a few lines of code.
- C4GroupSet does something similar. Have you checked whether C4Reloc could share code with it?
Looks good otherwise. Thanks for working on this.
Reply
Parent - - By Clonk-Karl [de] Date 2011-01-05 14:04

> I Clonk, we use simple global variables for singletons. Reloc.Paths is a lot simpler to read and understand than C4RelocImpl::Instance().Paths. It also saves a few lines of code.


The reason I did it this way is to make sure that the class gets instantiated after C4Config has been loaded. If it was a global variable I guess some Init() function would need to be called explicitely.

> C4GroupSet does something similar. Have you checked whether C4Reloc could share code with it?


Not so easily at least, because C4GroupSets operates on open C4Groups, and C4Reloc can be used to find any files at a system path. The relation between the two is rather so that there could be a method in C4Reloc which adds all groups of the same name into a C4GroupSet and returns that; for example to load languages from Language.c4g from both UserDataPath and SystemDataPath.
Reply
Parent - - By Günther [de] Date 2011-01-05 20:21

> The reason I did it this way is to make sure that the class gets instantiated after C4Config has been loaded. If it was a global variable I guess some Init() function would need to be called explicitely.


Wow, that's incredibly subtle. Do you know how the compiler arranges for the static variable to be initialized? I thought all static variables were initialized before main(), regardless of whether they were in a function or global. Hm, looking at the patch again... Er, are you sure that it isn't the call to ClearPaths in C4Application::DoInit that's responsible for making it work, with empty paths before that point?
Reply
Parent - - By Clonk-Karl [de] Date 2011-01-05 21:05

> Wow, that's incredibly subtle. Do you know how the compiler arranges for the static variable to be initialized?


According to this it basically inserts a boolean "initialized" flag.

> Er, are you sure that it isn't the call to ClearPaths in C4Application::DoInit that's responsible for making it work, with empty paths before that point?


Yes, I am certain. It is guaranteed that static (non-POD) variables are initialized when the function is first called (section 6.7.4 in the C++ standard). Well, I am not strictly opposed to changing it to be a simple global variable instead; just thought it was cleaner this way.
Reply
Parent - - By Günther [de] Date 2011-01-06 01:11
Cleaner is in the eye of the beholder. ;-) I'd argue that not using that obscure edge case of C++ and fewer lines of code are cleaner. But it it's more work than simply switching the singleton style to the common one, then it's probably not worth the effort.
Reply
Parent - By Clonk-Karl [de] Date 2011-01-07 21:04
I have changed it to be a global variable and call Init() on it at an appropriate place, and then pushed it to openclonk.org.
Reply
Parent - - By Newton [de] Date 2011-01-05 02:34
On that note: Perhaps we should think of a way to keep track of patches that are supplied by contributors but have not been applied yet. Right now, I guess it's just individual people like (mainly) you and Günther who remember (,review and finally apply) them. If I'd be asked, I could not answer whether there are still some more patches lying around the forum (other than the multipointer X support by aapo) that have not been applied yet.

Normally, I am not the guy who reviews and finally applies community patches so I don't really know much about the situation and if the situation we have now is satisfactory. Your opinions?
Parent - - By Günther [de] Date 2011-01-05 03:16
Well, we have the bugtracker. You're right, patches tend to get lost in the forum. On that note ;-) - Can we configure the bug report form to have fewer controls? Reproducibility, Severity, Priority and Assign To are not worth the time of the typical bug reporter or patch submitter, and I'm not sure about Select Profile.
Reply
Parent - By Newton [de] Date 2011-01-05 15:22
There are not so many configuration options in mantis but I'll look what I can do.
Up Topic Development / Developer's Corner / Installation Support

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill