Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-10

Build scripts for Freepascal and Lazarus compilation from source

36 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank Church

I have posted an article and some code on some bash scripts I have developed to install FPC and Lazarus from source at
http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source .

Any comments and tips are well come.

Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101003/1da7ec33/attachment.html>

Reply by email

Frank Church
to Joshua Lim
Joshua Lim wrote
Hi Frank, do you have something for Win32? Thanks.

I don't have anything for Win32 yet, but it should be easy to convert. You only have to look out for the Windows gotchas. I will have tackle in the near future, but I wouldn't want to keep you wating.

Check Marco van de Voort's
buildfaq<http://www.stack.nl/%7Emarcov/buildfaq.pdf>, Chapter 2.4.
The wiki also has tips on compiling at
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

It is the type of article I don't like because you can learn a lot more from a good well commented script with sensibly named variables (insert smug emoticon here) ;).

There is some good information here too - Lazarus Support FAQ<http://www.lazarussupport.com/lazarus/Lazarus?section2=FAQ#How_do_I_compile_lazarus.3F>

I think it can be translated straight as is to Windows, with some minor adjustment of path names. The important thing is to specify the actual location of the fpc compiler, rather than use the system installed on especially if you are going beyond the basic fpc 2.2.4/ lazarus 0.9.28 combo. Once you get an fpc 2.4.0 working, you can go on to an fpc 2.5.1 and things will be match easier then.

Another important point is to make sure you have the fpc.cfg right for the compiler, which is why I always regenerate it for a compiler just before 'making' with it.

Frank Church wrote 19 lines
> > I have posted an article and some code on some bash scripts I have > developed to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source > . > > Any comments and tips are well come. > > -- > Frank Church > -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101003/4a177554/attachment.html>

Reply by email

Marcos Douglas
to Frank Church

2010/10/3 Frank Church :

Show quoted text 7 lines
[snip] The wiki also has tips on compiling at?http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 It is the type of article I don't like because you can learn a lot more from a? good well commented script with sensibly named variables (insert smug emoticon here) ;).

I did this wiki and it is working very well for win32.

Marcos Douglas

Reply by email

Joshua Lim
to Marcos Douglas

Hi Marcos,

Thanks, I managed to Google into this wiki on Sat, had a quick look, but couldn't proceed after this part, so decided to try another time again:

"See: http://www.freepascal.org/down-win32.html . You can find a list of mirrors at http://www.freepascal.org/sdown.html. Download FPC as one big file, unzip it and run the install.exe."

The download links don't work. I also can't find install.exe (using files i downloaded from http://www.freepascal.org/develop.var).

I will like to compile and install from latest source download from rather than from SVN. The objective is to get Lazarus to work with the latest version of FPC.

Rgds,
Joshua

Marcos Douglas wrote 22 lines
2010/10/3 Frank Church : > [snip] > The wiki also has tips on compiling > at http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 > > It is the type of article I don't like because you can learn a lot more from > a good well commented script with sensibly named variables (insert smug > emoticon here) ;). > I did this wiki and it is working very well for win32. Marcos Douglas -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Frank Church
to Marcos Douglas: 2010/10/3 Frank Church : I did this wiki and it is working very well for win32. Marcos…
Marcos Douglas wrote 14 lines
2010/10/3 Frank Church : > [snip] > The wiki also has tips on compiling > at http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 > > It is the type of article I don't like because you can learn a lot more from > a good well commented script with sensibly named variables (insert smug > emoticon here) ;). I did this wiki and it is working very well for win32.

I just want to say this, it is not directed at you as such, but it is a fault I find in many howtos and guides.
A lot of howtos do not focus on structure, they operate on a very low level of abstraction.

Howtos should be like functions or procedures. You state what the parameters or variables to the function are. The reader takes a look at the parameters to the function, and learns about the structure of that domain from the parameter names and the comments attached to them.

A lot of the time those comments are not even necessary.

The better parts of Lazarus and FPC are in subversion, and as the revisions constantly change it is important to label the builds properly and label the directories and settings locations properly which is why I created that script. It may appear to be overkill but I'd rather know where I am and what I am using at all times.

Symlinks can be used to point the system's ie the one in /usr/lib,/usr/bin etc. In this case you still know what builds are being used by examining the symlinks. Building some of the revisions often fails which is why labelling them is so important.

The reasons why Lazarus and FPC compilations fail, which is mostly due to incorrect fpc.cfg, lazarus executable, fpc/ppc386 executables, /fpcsrc directories, the settings etc are there reason why that script is the way it is. I spent hours unravelling them, and anyone who familiar with those issues will understand why I strove to get them right that way. I am also developing for Ubuntu 8.04, which is not up to date like later versions.

I will probably comment it further to help newcomers understand its structure, and I would like those more familiar with the Lazarus/FPC compilation process to correct any errors or misunderstandings on my part.

With respect to Win32 the buildfaq document has a sample batch which illustrates my point, but does not go far enough.

As an aside I think the noise level in howtos in the blogosphere and the internet in general is simply too high, and attention get's caught in trivia and boilerplate stuff.

Show quoted text 8 lines
Marcos Douglas -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101004/c4f30f9b/attachment-0001.html>

Reply by email

Kjow
to Joshua Lim: Hi Frank, do you have something for Win32? Thanks.

2010/10/3 Joshua Lim :

Show quoted text 12 lines
Hi Frank, do you have something for Win32? ?Thanks. Frank Church wrote: > > I have posted an article and some code on some bash scripts I have > developed to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source. > > Any comments and tips are well come. > > -- > Frank Church

I made a win 7 batch that install, compile, update everything, automatically. Double click on the file is the only action needed. I will translate it to linux/ubuntu.

It downloads the svn program, fpc 2.4.0 and latest fpc 2.5.1 (or 2.4.x trunk editing a line)/lazarus/GLScene sources...
Install fpc/lazarus on c:\develop\

Launching it at the start of PC you can choise if you want to update or exit (after 10sec it update automatically),

If there is an interest, I can add a page in the official Lazarus wiki.

It works well on both of my PC (desktop and notebook) with Win7, It should work with other windows system.

Regards,
Kjow

PS I want to make a "real" program, instead a batch. Multiplatform (Win+Linux), of course.

Reply by email

Frank Church
to Kjow
Kjow wrote 33 lines
2010/10/3 Joshua Lim : > Hi Frank, do you have something for Win32? Thanks. > > Frank Church wrote: >> >> I have posted an article and some code on some bash scripts I have >> developed to install FPC and Lazarus from source at >> http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source . >> >> Any comments and tips are well come. >> >> -- >> Frank Church I made a win 7 batch that install, compile, update everything, automatically. Double click on the file is the only action needed. I will translate it to linux/ubuntu. It downloads the svn program, fpc 2.4.0 and latest fpc 2.5.1 (or 2.4.x trunk editing a line)/lazarus/GLScene sources... Install fpc/lazarus on c:\develop\ Launching it at the start of PC you can choise if you want to update or exit (after 10sec it update automatically), If there is an interest, I can add a page in the official Lazarus wiki. It works well on both of my PC (desktop and notebook) with Win7, It should work with other windows system.

If you can make it fully configurable, so that c:\develop can be c:\%installdir%, specify which revision so that the download command will be "svn -r %revision% http://svn.freepascal.org/fpc/trunk fpc_%revision%" etc, it will be a lot more useful.

Show quoted text 12 lines
Regards, Kjow PS I want to make a "real" program, instead a batch. Multiplatform (Win+Linux), of course. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101004/1aa627a7/attachment.html>

Reply by email

Juha Manninen gmail
to Frank Church: I have posted an article and some code on some bash scripts I have developed to install…
Frank Church wrote 6 lines
I have posted an article and some code on some bash scripts I have developed to install FPC and Lazarus from source at http://devblog.brahmancreations.com/content/build-scripts-for-installing-fr eepascal-and-lazarus-from-source . Any comments and tips are well come.

Why are FPC and Lazarus installed in a hidden directory (${HOMEDIR}/.programs/...)?

I was playing with an idea of a graphical installer. To make the installation really easy and intuitive there should be a GUI. Besides Lazarus itself makes WYSIWYG GUI design easy. The installation should be brought to the same level.

The installer would know the OS and recognize the Distro if running on Linux.

Then it would find the best way to install FPC.
For windows it would download from SourceForge and install. For Mac something similar (Apple's developer tools must be installed first!). For Linux it would check the distro's own package repo and offer to install from there. Like:
"yum install fpc" for Fedora and Redhat
"zypper install fpc" for SuSe
"rpm -i fpc" for other RPM distros
"apt-get fpc" for Debian and Ununtu
Other distros are derived from those so it would cover almost everything. If not found in a repo then it would download a package and install it.

Then it would offer to install a binary version of Lazarus, or to download the sources of a selected Lazarus version and build it.

Installing many FPC and Lazarus versions and switching between them should be supported. There are now some technical problems that prevent it but those problems should be solved.

Download and building the sources of Lazarus resembles the Gentoo Linux style. It could actually be used for any program made with Lazarus.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101004/616c9bac/attachment-0001.html>

Reply by email

Kjow
to Frank Church: If you can make it fully configurable, so that c:\develop can be c:\%installdir%,…

2010/10/4 Frank Church :

If you can make it fully configurable, so that? c:\develop can be c:\%installdir%, specify which revision so that the download command will be "svn -r %revision% http://svn.freepascal.org/fpc/trunk fpc_%revision%" etc, it will be a lot more useful.

I will make fully configurable when I "translate" it to a real program, this batch is born to do what I need and batch scripting is not very powerfull to do this things (for me) :)

So, for the moment I don't think to improve it a lot more (maybe I'll include some suggestions), but for me the "killer feature" will be the real program. :)

Regards,
Kjow

Reply by email

Kjow
to Juha Manninen gmail: Make it Win+Linux+Mac. Then make it an open source project and I promise to participate.…

2010/10/4 Juha Manninen (gmail) :

Show quoted text 10 lines
On Monday 04 October 2010 12:51:25 Kjow wrote: > PS I want to make a "real" program, instead a batch. Multiplatform > (Win+Linux), of course. Make it Win+Linux+Mac. Then make it an open source project and I promise to participate. See my other mail. Regards, Juha

I don't have a Mac, so I don't know how it works/what I need to do... however when I will have a little time I'll start to develop it :)

Regards,
Kjow

PS I don't understand if my actual win-batch-script is needed/requested :)

Reply by email

Frank Church
to Kjow: 2010/10/4 Frank Church : I will make fully configurable when I "translate" it to a real…
Kjow wrote 17 lines
2010/10/4 Frank Church : > If you can make it fully configurable, so that c:\develop can be > c:\%installdir%, specify which revision so that the download command will be > "svn -r %revision% http://svn.freepascal.org/fpc/trunk fpc_%revision%" etc, > it will be a lot more useful. I will make fully configurable when I "translate" it to a real program, this batch is born to do what I need and batch scripting is not very powerfull to do this things (for me) :) So, for the moment I don't think to improve it a lot more (maybe I'll include some suggestions), but for me the "killer feature" will be the real program. :)

Batch or bash programs are real programs. I'd say use a batch file or some other script, and create a GUI interface to it. This GUI business is rather over done. You could try Pascal Script, thus have your Pascal cat and eat as well

With my bash script all you simply specify the variables at the top and run it. Building a different revision is a simple matter of changing $FPC_REVISION or $LAZARUS_REVISION and Bob's your uncle. None of the existing stuff gets touched. The only shortcoming as I see it now is I have omitted to restore the $SYSTEM_FPC_COMPILER's original fpc.cfg to the home directory as .fpc.cfg, when I rebuild the compiler with its self.

.

Show quoted text 9 lines
Regards, Kjow -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101004/0bd8f34e/attachment.html>

Reply by email

Frank Church
to Juha Manninen gmail: Why are FPC and Lazarus installed in a hidden directory (${HOMEDIR}/.programs/...)? I was…

2010/10/4 Juha Manninen (gmail)

Show quoted text 18 lines
On Sunday 03 October 2010 12:25:50 Frank Church wrote: > I have posted an article and some code on some bash scripts I have > developed to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-fr > eepascal-and-lazarus-from-source . > > Any comments and tips are well come. Why are FPC and Lazarus installed in a hidden directory (${HOMEDIR}/ .programs/...)?

There is no real reason for that, I have created a visible symlink to it now. It is just that Linux creates too many visible folders in $HOME and I wanted it to be invisible. I realized the folly soon after and created the symlink rather than rename it and break a whole lot of existing stuff.

Show quoted text 52 lines
I was playing with an idea of a graphical installer. To make the installation really easy and intuitive there should be a GUI. Besides Lazarus itself makes WYSIWYG GUI design easy. The installation should be brought to the same level. The installer would know the OS and recognize the Distro if running on Linux. Then it would find the best way to install FPC. For windows it would download from SourceForge and install. For Mac something similar (Apple's developer tools must be installed first!). For Linux it would check the distro's own package repo and offer to install from there. Like: "yum install fpc" for Fedora and Redhat "zypper install fpc" for SuSe "rpm -i fpc" for other RPM distros "apt-get fpc" for Debian and Ununtu Other distros are derived from those so it would cover almost everything. If not found in a repo then it would download a package and install it. Then it would offer to install a binary version of Lazarus, or to download the sources of a selected Lazarus version and build it. Installing many FPC and Lazarus versions and switching between them should be supported. There are now some technical problems that prevent it but those problems should be solved. Download and building the sources of Lazarus resembles the Gentoo Linux style. It could actually be used for any program made with Lazarus. Juha -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101004/f169c9da/attachment-0001.html>

Reply by email

Juha Manninen gmail
to Juha Manninen gmail: Why are FPC and Lazarus installed in a hidden directory (${HOMEDIR}/.programs/...)? I was…

One more thing:

The multi-platform installer would be completed with a multi-platform-aware web-site, similar with some commercial product download pages. Example: http://www.teamviewer.com/index.aspx

It recognizes the client's platform somehow using Javascript (I guess) and offers the right package to download. Cool!

Then we would be as close to a one-click install as possible. The user would :
1. Click the download link on web-site and get the right installer.
2. Open the installer.
3. Click "Install" button. FPC + Lazarus get installed using default settings.

Juha

Reply by email

Juha Manninen gmail
to Frank Church: Batch or bash programs are real programs. I'd say use a batch file or some other script,…
Frank Church wrote 11 lines
Batch or bash programs are real programs. I'd say use a batch file or some other script, and create a GUI interface to it. This GUI business is rather over done. You could try Pascal Script, thus have your Pascal cat and eat as well With my bash script all you simply specify the variables at the top and run it. Building a different revision is a simple matter of changing $FPC_REVISION or $LAZARUS_REVISION and Bob's your uncle. None of the existing stuff gets touched. The only shortcoming as I see it now is I have omitted to restore the $SYSTEM_FPC_COMPILER's original fpc.cfg to the home directory as .fpc.cfg, when I rebuild the compiler with its self.

Batch or bash programs are real but SMALL and SIMPLE programs. They are not suited for bigger programs containing "if...then" structures and loops. They become hard to maintain very quickly. A bash script works best as a glue between other programs.

For your install script it suits well. However, your script assumes many things and is not suitable for a new potential Lazarus user. For example when installing FPC, you assume there is already FPC 2.4.0 installed. What if there isn't? How does your script react?
It also assumes the sources are already downloaded. What if they are not? Then you can uncomment the line:
svn checkout -r ${FPC_REVISION} ${FPC_REPOSITORY}
to download sources. What if Subversion is not installed? What does your script do?
What about distro specific differences? And so on...

This script is suited for a "guru" user who knows exactly what must be done. That is how most bash scripts are.

What I (and I guess Kjow) have in mind is an installation program for a person who goes to Lazarus web-page for the first time and wants to try it. He doesn't even need to know that FPC needs to be installed before Lazarus. The installer should take care of all details.

Juha

P.S.
"Scripting language" term is used loosely for "dynamic languages" like Perl, Python and Ruby, although they are suited for structured programming better than bash.
My comments were about bash only.

Reply by email

Marcos Douglas
to Joshua Lim: Thanks, I managed to Google into this wiki on Sat, had a quick look, but couldn't proceed…
Joshua Lim wrote 8 lines
[snip] "See: http://www.freepascal.org/down-win32.html . You can find a list of mirrors at http://www.freepascal.org/sdown.html. Download FPC as one big file, unzip it and run the install.exe." The download links don't work. ?I also can't find install.exe (using files i downloaded from http://www.freepascal.org/develop.var).

This part is old. I did not do that.
Just see from this link:
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

Marcos Douglas

Reply by email

Kjow
to Juha Manninen gmail: Batch or bash programs are real but SMALL and SIMPLE programs. They are not suited for…

2010/10/4 Juha Manninen (gmail) :

What I (and I guess Kjow) have in mind is an installation program for a person who goes to Lazarus web-page for the first time and wants to try it. He doesn't even need to know that FPC needs to be installed before Lazarus. The installer should take care of all details.

Yes it is and my script already do this ;)

My script already permits to choose the destination folder, but you need to edit the first declaration by hand.
Now I'm adding a page in the lazarus wiki to publish it, so everyone can test it.

The "binary version" will come later, my time is not very much.

I have an older revision of the one-click script for Linux and it works well enough... In this page I can publish it also. By linux nature it requires a little more work, like start it from console. Furthermore, it is splitted in two script:

1st for fisrt installation
2nd for next updates.

Finally, linux script enable Lazarus/fpc to cross-compile for arm-linux. (In other words these are the scripts I published here some time ago: http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM) There are some correction to do (I never found time), but it works.

Do you know If I can upload zip file to Lazarus wiki? I can't remember...

Reply by email

Marcos Douglas
to Kjow: 2010/10/3 Joshua Lim : I made a win 7 batch that install, compile, update everything,…
Kjow wrote 29 lines
2010/10/3 Joshua Lim : > Hi Frank, do you have something for Win32? ?Thanks. > > Frank Church wrote: >> >> I have posted an article and some code on some bash scripts I have >> developed to install FPC and Lazarus from source at >> http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source. >> >> Any comments and tips are well come. >> >> -- >> Frank Church I made a win 7 batch that install, compile, update everything, automatically. Double click on the file is the only action needed. I will translate it to linux/ubuntu. It downloads the svn program, fpc 2.4.0 and latest fpc 2.5.1 (or 2.4.x trunk editing a line)/lazarus/GLScene sources... Install fpc/lazarus on c:\develop\ Launching it at the start of PC you can choise if you want to update or exit (after 10sec it update automatically), If there is an interest, I can add a page in the official Lazarus wiki. It works well on both of my PC (desktop and notebook) with Win7, It should work with other windows system.

I think is good and I have interest... but you saw this link? http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

This tutorial uses BAT files and it works too.
When I maded this tutorial, I wanted to do more simple I could.

When I did this tutorial, I wanted to do it in the simplest way possible. So I didn't put the commands for SVN and also did it in pieces (to make it easier to understand).

Maybe you could post your method on the wiki so that we could evaluate the pros and cons ... What do you think?

Marcos Douglas

Reply by email

Marcos Douglas
to Juha Manninen gmail: One more thing: The multi-platform installer would be completed with a…
Juha Manninen wrote 14 lines
One more thing: The multi-platform installer would be completed with a multi-platform-aware web-site, similar with some commercial product download pages. Example: ?http://www.teamviewer.com/index.aspx It recognizes the client's platform somehow using Javascript (I guess) and offers the right package to download. Cool! Then we would be as close to a one-click install as possible. The user would : 1. Click the download link on web-site and get the right installer. 2. Open the installer. 3. Click "Install" button. FPC + Lazarus get installed using default settings.

You talk about installer to FPC and Lazarus from SVN? The installer to Windows works very well (but I do not use it)...

Or you talk about the "universal installer" multiplataform? But it will use the sources from SVN?

Marcos Douglas

Reply by email

Kjow
to Marcos Douglas: I think is good and I have interest... but you saw this link?…

2010/10/4 Marcos Douglas :

Show quoted text 12 lines
I think is good and I have interest... but you saw this link? http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 This tutorial uses BAT files and it works too. When I maded this tutorial, I wanted to do more simple I could. When I did this tutorial, I wanted to do it in the simplest way possible. So I didn't put the commands for SVN and also did it in pieces (to make it easier to understand). Maybe you could post your method on the wiki so that we could evaluate the pros and cons ... What do you think?

Seeing the link, many things are very similar (obviously); however I'm making a new wiki page where I will put my method (win+linux -> 1+2 scripts).

My goal is to have a minimal interaction with the end-users (like I am), but if they want they can open, read/understand and personalize. So, at first I'm publishing only the scripts, and hereafter I will do a binary-multiplatform program that will make the same things, but more professionally :p

Regards,
Kjow

Reply by email

Marcos Douglas
to Kjow
Kjow wrote 17 lines
2010/10/4 Marcos Douglas : > I think is good and I have interest... but you saw this link? > http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 > > This tutorial uses BAT files and it works too. > When I maded this tutorial, I wanted to do more simple I could. > > When I did this tutorial, I wanted to do it in the simplest way > possible. So I didn't put the commands for SVN and also did it in > pieces (to make it easier to understand). > > Maybe you could post your method on the wiki so that we could evaluate > the pros and cons ... What do you think? Seeing the link, many things are very similar (obviously); however I'm making a new wiki page where I will put my method (win+linux -> 1+2 scripts).

Well, I am not an expert in BAT files and this was my first contribuition to FreePascal ;-) but if you have a script with interaction, is much better.
I would like to see your script.

Show quoted text 5 lines
My goal is to have a minimal interaction with the end-users (like I am), but if they want they can open, read/understand and personalize. So, at first I'm publishing only the scripts, and hereafter I will do a binary-multiplatform program that will make the same things, but more professionally :p

If the installer will use the sources of SVN, then I have much interest in this project!

Marcos Douglas

Reply by email

Kjow
to Marcos Douglas

2010/10/4 Marcos Douglas :

Well, I am not an expert in BAT files and this was my first contribuition to FreePascal ?;-) but if you have a script with interaction, is much better. I would like to see your script.

I'll publish a new mail in the mailing list when done :)

If the installer will use the sources of SVN, then I have much interest in this project!

Of course :)
What I want to do is a binary version of my script, see my script, watch what it does and immagine it with a GUI and the possibilities of personalization (timings, paths, etc)

Do you know if exists a component for lazarus that permits to download from svn? If not, I will use external svn like the script.

regards,
Kjow

Reply by email

Marcos Douglas
to Kjow
Kjow wrote 7 lines
2010/10/4 Marcos Douglas : > Well, I am not an expert in BAT files and this was my first > contribuition to FreePascal ?;-) but if you have a script with > interaction, is much better. > I would like to see your script. I'll publish a new mail in the mailing list when done :)

OK.

Show quoted text 10 lines
> If the installer will use the sources of SVN, then I have much > interest in this project! Of course :) What I want to do is a binary version of my script, see my script, watch what it does and immagine it with a GUI and the possibilities of personalization (timings, paths, etc) Do you know if exists a component for lazarus that permits to download from svn? If not, I will use external svn like the script.

I don't know...
I think is better use external SVN program (they are finished and works fine).

Marcos Douglas

Reply by email

Vincent Snijders
to Marcos Douglas

2010/10/4 Marcos Douglas :

Show quoted text 5 lines
> Do you know if exists a component for lazarus that permits to download from svn? > If not, I will use external svn like the script. I don't know... I think is better use external SVN program (they are finished and works fine).

Like here:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/lazsvnpkg/?root=lazarus and
http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/components/svn/

Vincent

Reply by email

Marco van de Voort
to Frank Church: I don't have anything for Win32 yet, but it should be easy to convert. You only have to…
Frank Church wrote 18 lines
On 3 October 2010 13:23, Joshua Lim wrote: > Hi Frank, do you have something for Win32? Thanks. > > I don't have anything for Win32 yet, but it should be easy to convert. You only have to look out for the Windows gotchas. I will have tackle in the near future, but I wouldn't want to keep you wating. Check Marco van de Voort's buildfaq<http://www.stack.nl/%7Emarcov/buildfaq.pdf>, Chapter 2.4. The wiki also has tips on compiling at http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 It is the type of article I don't like because you can learn a lot more from a good well commented script with sensibly named variables (insert smug emoticon here) ;).

That you didn't like reading it is clear, because when you would have read it more attentively, I wouldn't be getting just a

Error expanding embedded variable.

when I tried to run your script :-)

Reply by email

Marco van de Voort
to Juha Manninen gmail: Batch or bash programs are real but SMALL and SIMPLE programs. They are not suited for…
Juha Manninen wrote
P.S. "Scripting language" term is used loosely for "dynamic languages" like Perl, Python and Ruby,

Dynamic typic and scripting are not related. Scripting usually points towards a more interpretive way of execution. You can have statically typed scripting and dynamic compilation, and with all the JIT experimentation with the above (Parrot, J and Iron variants), shell script is maybe more "scripting" than any of the above.

although they are suited for structured programming better than bash.

Bash has been called (shell)scripting for 4 decades now. Probably longer than the three above exist combined

Reply by email

Juha Manninen gmail
to Marco van de Voort
Marco van de Voort wrote
Bash has been called (shell)scripting for 4 decades now. Probably longer than the three above exist combined

Yes.
However, at least 10 years ago, a Perl program was typically called "Perl script", no matter how complicated it was. A C or Pascal program, even a simple one, was called a "program".
Maybe it has changed now and they are all rightfully called programs. And yes, shell scripts should still be called "script".

Juha

Reply by email

Juha Manninen gmail
to Marcos Douglas: On Mon, Oct 4, 2010 at 7:44 AM, Juha Manninen (gmail) You talk about installer to FPC and…
Marcos Douglas wrote 5 lines
You talk about installer to FPC and Lazarus from SVN? The installer to Windows works very well (but I do not use it)... Or you talk about the "universal installer" multiplataform? But it will use the sources from SVN?

It would be a multiplatform universal installer, yes. FPC can't be installed only from source, there must be the initial binary version installed first.
After that both FPC and Lazarus could be installed from source.

The windows installation package works well but only for the released version which is soon a year old.
I different release policy in the future would improve that situation of course.

Juha

Reply by email

Frank Church
to Marco van de Voort: That you didn't like reading it is clear, because when you would have read it more…
Marco van de Voort wrote 32 lines
On Sun, Oct 03, 2010 at 02:30:11PM +0100, Frank Church wrote: > On 3 October 2010 13:23, Joshua Lim wrote: > > > Hi Frank, do you have something for Win32? Thanks. > > > > > I don't have anything for Win32 yet, but it should be easy to convert. You > only have to look out for the Windows gotchas. I will have tackle in the > near future, but I wouldn't want to keep you wating. > > Check Marco van de Voort's > buildfaq<http://www.stack.nl/%7Emarcov/buildfaq.pdf>, > Chapter 2.4. > The wiki also has tips on compiling at > http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 > > It is the type of article I don't like because you can learn a lot more from > a good well commented script with sensibly named variables (insert smug > emoticon here) ;). That you didn't like reading it is clear, because when you would have read it more attentively, I wouldn't be getting just a Error expanding embedded variable. when I tried to run your script :-)

This may be because since creating the article I have made changes directly online to the web page to make it easier to understand, rather than running the new changes and copying it back to the article.

Show quoted text 6 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101005/54c4f1e9/attachment.html>

Reply by email

Frank Church
to Marcos Douglas: Well, I am not an expert in BAT files and this was my first contribuition to FreePascal …
Marcos Douglas wrote 36 lines
On Mon, Oct 4, 2010 at 9:51 AM, Kjow wrote: > 2010/10/4 Marcos Douglas : >> I think is good and I have interest... but you saw this link? >> http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 >> >> This tutorial uses BAT files and it works too. >> When I maded this tutorial, I wanted to do more simple I could. >> >> When I did this tutorial, I wanted to do it in the simplest way >> possible. So I didn't put the commands for SVN and also did it in >> pieces (to make it easier to understand). >> >> Maybe you could post your method on the wiki so that we could evaluate >> the pros and cons ... What do you think? > > Seeing the link, many things are very similar (obviously); however I'm > making a new wiki page where I will put my method (win+linux -> 1+2 > scripts). Well, I am not an expert in BAT files and this was my first contribuition to FreePascal ;-) but if you have a script with interaction, is much better. I would like to see your script. > My goal is to have a minimal interaction with the end-users (like I > am), but if they want they can open, read/understand and personalize. > So, at first I'm publishing only the scripts, and hereafter I will do > a binary-multiplatform program that will make the same things, but > more professionally :p If the installer will use the sources of SVN, then I have much interest in this project!

One thing to note about svn is it is the bleeding edge. Compiling from svn may fail. How does the new user know which revision they are using? If some bugs creep into the packages and the new user has to recompile where will the knowledge of what revisions are okay come from?

Compiling directly from svn without knowing which revisions are safe may only cause more confusion as errors will be hard to track down. Unless the Lazarus community keeps track of stable builds, and getting the installer to download only those, this approach will only cause problems for new users.

You only have to read the forums and mailing list to see how a lot of users are afraid to upgrade from source because the methods described in the wikis and faqs overwrite their existing installations.

I designed the script is with that issue in mind. The user can symlink to a 'safe' build if it proves 'stable' long enough for their purposes.

Show quoted text 8 lines
Marcos Douglas -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101005/daaf7e04/attachment.html>

Reply by email

Marcos Douglas
to Juha Manninen gmail: It would be a multiplatform universal installer, yes. FPC can't be installed only from…
Juha Manninen wrote 16 lines
On Monday 04 October 2010 15:26:47 Marcos Douglas wrote: > You talk about installer to FPC and Lazarus from SVN? > The installer to Windows works very well (but I do not use it)... > > Or you talk about the "universal installer" multiplataform? But it > will use the sources from SVN? It would be a multiplatform universal installer, yes. FPC can't be installed only from source, there must be the initial binary version installed first. After that both FPC and Lazarus could be installed from source. The windows installation package works well but only for the released version which is soon a year old. I different release policy in the future would improve that situation of course.

Yes, we need the original binary to build, but they are here: http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_4/install/binw32/

And the compiler is here:
ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/ppc386-win32.zip

The bellow talk about these files:

[1] http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

Marcos Douglas

Reply by email

Juha Manninen gmail
to Marcos Douglas
Marcos Douglas wrote
Yes, we need the original binary to build, but they are here: http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_4/install/binw32/

For Windows yes.
There is also an "installation script for Unixy platforms". I am confused with all these scripts.
http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_4/install/install.sh

Show quoted text 8 lines
And the compiler is here: ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/ppc386-win32.zip The bellow talk about these files: [1] http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalli ng_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

There are compilers for other platforms, too. So no other binaries are needed?

A project for this installer should be opened to some repository. Who would do it? All the scripts can also be collected under this project, and then a GUI installer.

Juha

Reply by email

Marco van de Voort
to Frank Church: This may be because since creating the article I have made changes directly online to the…
Frank Church wrote
This may be because since creating the article I have made changes directly online to the web page to make it easier to understand, rather than running the new changes and copying it back to the article.

No, it is because you execute "make" and not "gmake" (make is BSD make on Unix). See e.g. the install scripts how to handle this. (check uname to create a testable something for BSD)

The other typical linuxism is assume /bin/sh is bash, but I don't know for sure if there are bashisms in this script.

The solution is to always execute the shell as

#!/usr/bin/env bash

both aspects are afaik mentioned (and demonstrated) in the buildfaq

Reply by email

Frank Church
to Frank Church: I have posted an article and some code on some bash scripts I have developed to install…
Frank Church wrote 9 lines
I have posted an article and some code on some bash scripts I have developed to install FPC and Lazarus from source at http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source . Any comments and tips are well come.

Today I have add a few notes and comments to the script to help those new to FPC/Lazarus compilation and some of the Linux tools involved to understand what is going on.

Regards

Show quoted text 6 lines
-- Frank Church ======================= http://devblog.brahmancreations.com
Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101007/ea6734d1/attachment-0001.html>

Reply by email

Thierry B.
to Frank Church

Frank Church a ?crit :

Show quoted text 19 lines
On 3 October 2010 10:25, Frank Church < <mailto:>> wrote: I have posted an article and some code on some bash scripts I have developed to install FPC and Lazarus from source at http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source. Any comments and tips are well come. Today I have add a few notes and comments to the script to help those new to FPC/Lazarus compilation and some of the Linux tools involved to understand what is going on. Regards

Here is for example the scrip I use on Windows. I use TortoiseSVN command line tools :

@echo on
set BASEDRV=c:
set FPCNEWVERSION=2.5.1
set FPCOLDVERSION=2.4.3
set BASEINSTALL=%BASEDRV%\programs\fpc
set FPCBASEDIR=%BASEINSTALL%\%FPCNEWVERSION%
set SRCDIR=%BASEINSTALL%\fpsrc\%FPCNEWVERSION%
set PPCNAME=ppc386
set FPCTARGET=i386-win32
set FPCSTART=%BASEINSTALL%\%FPCOLDVERSION%\bin\%FPCTARGET%\%PPCNAME% set LOGDIR=%BASEDRV%\programs
set INSTALLDIR=%FPCBASEDIR%
set BINUTILSDIR=C:\programs\Binutils

@REM opts.
@REM set OPTS=-gl -dSAX_HTML_DEBUG -dUSE_MINGW_GDB set OPTS=-gl
@REM set COMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%OPTS%" GINSTALL=myinst.exe
set COMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%OPTS%"

@REM Lazarus variables
set LAZSRCDIR=%BASEDRV%\programs\lazarus_FPC_svn
@REM OPTSLAZ=-g- -O2 -CX -XX -WG
set OPTSLAZ=
set COMMONOPTSLAZ=OPT="%OPTSLAZ%"
set LAZCONFDIR=%USERPROFILE%\Local Settings\Application Data\lazarus

@rem === invariant part ===

%BASEDRV%

del %LOGDIR%\build_fpc_log.txt
del %LOGDIR%\install_fpc_log.txt
del %LOGDIR%\install_laz_log.txt

@REM DPC sources svnupdate
TortoiseProc.exe /command:update /path:"%SRCDIR%\" /closeonend:1

@REM some files may be modified after build. I do a revert for this @REM but this need to answer TortoiseProc.exe message box. TortoiseProc.exe /command:revert /path:"%SRCDIR%\" /closeonend:1

cd %SRCDIR%
Path=%BINUTILSDIR%;%Path%

@REM ********* Build FPC ***************
make clean all %COMMONOPTS% FPC=%FPCSTART% 1> %LOGDIR%\build_fpc_log.txt 2>&1

REM clean previous build
rmdir /S /Q %FPCBASEDIR%\doc
rmdir /S /Q %FPCBASEDIR%\examples
rmdir /S /Q %FPCBASEDIR%\msg
rmdir /S /Q %FPCBASEDIR%\units
rmdir /S /Q %FPCBASEDIR%\bin

@REM Add GNU tools and fpc.cfg to /bin/i386-win32
TortoiseProc.exe /command:update /path:"%BINUTILSDIR%\" /closeonend:1 tortoiseproc.exe /command:dropexport /droptarget:"%FPCBASEDIR%\bin" /path:"%BINUTILSDIR%"
cd %FPCBASEDIR%\bin
rename Binutils %FPCTARGET%
cd %SRCDIR%
copy %BASEINSTALL%\fpc.cfg %FPCBASEDIR%\bin\%FPCTARGET%\fpc.cfg

@REM **** INSTALL FPC **************
make install %COMMONOPTS% INSTALL_PREFIX=%INSTALLDIR% FPC=%SRCDIR%\compiler\%PPCNAME% 1> %LOGDIR%\install_fpc_log.txt 2>&1 make clean >NUL

@REM ********** INSTALL LAZARUS *********************************

@REM svn update de LAZARUS
TortoiseProc.exe /command:update /path:"%LAZSRCDIR%\" /closeonend:1

@REM some files may be modified after build. I do a revert for this @REM but this need to answer TortoiseProc.exe message box. TortoiseProc.exe /command:revert /path:"%LAZSRCDIR%\" /closeonend:1

@REM Delete previous UNITS directory s
rmdir /S /Q %LAZSRCDIR%\units

@REM ****** Compil/install LAZARUS *********************

cd %LAZSRCDIR%
make clean all %COMMONOPTSLAZ% FPC=%INSTALLDIR%\bin\%FPCTARGET%\fpc.exe 1> %LOGDIR%\install_laz_log.txt 2>&1

REM delete previous config dir.
rmdir /S /Q "%LAZCONFDIR%"

PAUSE

Reply by email