Lazarus with RPi 3 lazarus / 1-Linux ---------------------------------------------------------------------- krolikbest · 2016-10-27 18:40 Hi i try to install fpc and lazarus on Raspberry Pi 3 (system Raspbian). Could someone to explain me how to do it? On the Wiki I've found only for RPi 1 or 2, and making sudo ... get error , even stop working Raspbian Thx in advance, Martin ---------------------------------------------------------------------- Leledumbo · 2016-10-27 21:55 Should not differ between Pi version, the underlying Raspbian OS is the same for all boards. You need to get your hands better on Raspbian first as: Quotemaking sudo ... get error , even stop working Raspbianis a sign you don't know the OS well enough to work on it. ---------------------------------------------------------------------- krolikbest · 2016-10-28 07:19 I know i don't know (OS of course), but want to port some of my programs i've written for windows to RPi3. instead of public whipping, i need some explanation hoto install Martin ---------------------------------------------------------------------- DonAlfredo · 2016-10-28 07:41 You could try cross-compiling first. And for this cross-compiling, you could use a NewPascal install. See: https://github.com/newpascal/newpascal/releases/tag/np_sc-v1.0.34 And also (very important) look at this message-thread: http://forum.lazarus.freepascal.org/index.php/topic,27211.msg226806.ht ml#msg226806 If you have a form, you will need this into the beginning of your Lazarus lpr-file: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF LINUX}  {$IFDEF FPC_CROSSCOMPILING}    {$linklib libc_nonshared.a}    {$IFDEF CPUARM} // this is for Raspberry Pi and similars      // if we have a GUI (form), uncomment      {$linklib GLESv2}    {$ENDIF}  {$ENDIF}{$ENDIF} ---------------------------------------------------------------------- Thaddy · 2016-10-28 07:43 There is a version on getlazarus.org that I use myself sometimes (if I need 3.0/1.7 instead of trunk) on a RPi3. Works out of the box on Raspbian. See http://www.getlazarus.org/setup/?download#none and navigate to the Raspberry. You may have noticed I actually use it a lot. This is the ONLY version that I know that has no issues and is compiled correctly. The latter is important if you also want to do trunk builds later yourself. Note that it is absolutely not necessary to cross-compile first on a RPi2 or 3 (Or even 1, but that is slower and needs swapspace setup now). These little boxes are perfectly capable of building natively. At the moment I can not fully recommend the newpascal solution yet for beginners and advise strongly to use the version from my above link. This opinion may change in the future.... ---------------------------------------------------------------------- rvk · 2016-10-28 07:48 If you want to install trunk you can follow the guidelines I once posted. http://forum.lazarus.freepascal.org/index.php/topic,33254.msg215422.ht ml#msg215422 Note1: That is not a script but are guidelines/commands you need to execute to download and compile FPC & Lazarus. Note2: It will put Lazarus in /usr/local/share/lazarus. I haven't gotten around to putting Lazarus in a user-directory. ---------------------------------------------------------------------- Thaddy · 2016-10-28 07:52 This IS as script and it works even for beginners: http://www.getlazarus.org/download/?platform=raspberry Will give you a perfect install on your Raspberry Pi 3. ---------------------------------------------------------------------- rvk · 2016-10-28 08:08 Quote from: Thaddy on October 28, 2016, 09:52:45 amThis IS as script and it works even for beginners: http://www.getlazarus.org/download/?platform=raspberry Will give you a perfect install on your Raspberry Pi 3. When is the last time you tried the script? It doesn't work (for me). At least if Curl is installed it won't follow the redirect of the dropbox download. (not sure if the wget will. yes, wget will so if curl isn't installed it will work without change.) You need to add -L to the curl command for that in the download- function in the script. Not sure if curl is installed standard on RPI3 pixel but I don't think a beginner will find that easily. Note: The getlazarus script downloads a precompiled version from dropbox. (less to go wrong that way I guess ) ---------------------------------------------------------------------- krolikbest · 2016-10-28 08:09 I did: First i've downloaded new version of Rasbian and installed then once again i've written sudo apt-get fpc, then sudo apt-get lazarus and installed version 1.2.4. Can i get something more new than 1.2.4 Thanks very much for your previous help! martin ---------------------------------------------------------------------- rvk · 2016-10-28 08:12 Quote from: krolikbest on October 28, 2016, 10:09:07 amCan i get something more new than 1.2.4 Above these post we've already mentioned two ways to get a newer version. Follow my guidelines to get the latest development version (trunk) Or use the script from getlazarus.org. (if you have curl you'll need to add -L in the script to get it to work) ---------------------------------------------------------------------- krolikbest · 2016-10-28 08:19 thanks, i'll try. martin ---------------------------------------------------------------------- Thaddy · 2016-10-28 08:24 Quote from: rvk on October 28, 2016, 10:08:27 amQuote from: Thaddy on October 28, 2016, 09:52:45 amThis IS as script and it works even for beginners: http://www.getlazarus.org/download/?platform=raspberry Will give you a perfect install on your Raspberry Pi 3. When is the last time you tried the script? It doesn't work (for me). Just now. It is already finished. I will attach the screenshots from a newly unboxed rp3 with raspbian. All I had to do was type ./setup.sh and press y a couple of times. Note that I have the dependencies installed when asked. [edit] Hmm... A  second one (also on a new RP3) timed out.. Never seen that. Unexpected EOF? You've seen that? I did something different: first one connected through cable, second one through wifi on the pi. ---------------------------------------------------------------------- Thaddy · 2016-10-28 08:45 So eventually (after a retry on the second) both installed correctly on two new RP3 Raspbians using the getlazarus script. I am out of hardware to test more No pi's left, no sd cards left. ---------------------------------------------------------------------- rvk · 2016-10-28 08:47 Quote from: Thaddy on October 28, 2016, 10:24:35 amQuote from: rvk on October 28, 2016, 10:08:27 amQuote from: Thaddy on October 28, 2016, 09:52:45 amThis IS as script and it works even for beginners: http://www.getlazarus.org/download/?platform=raspberry Will give you a perfect install on your Raspberry Pi 3. When is the last time you tried the script? It doesn't work (for me). Just now. It is already finished. I will attach the screenshots from a newly unboxed rp3 with raspbian. All I had to do was type ./setup.sh and press y a couple of times. Note that I have the dependencies installed when asked. That's really strange. I just tried with a new installation with the 2016-09-23-raspbian-jessie and it had curl pre-installed. Doing ./setup.sh got me the result below (because curl doesn't redirect without -L). Do you have curl installed on your newly installed RPI3? And what version of jessie did you use ?? Code: [Select]Raspberry Free Pascal 3.0 with Lazarus install script ----------------------------------------------------- This script will install a lightweight version of The Free Pascal Compiler version 3.0 The Lazarus Development Environment After install 280MB of drive space will be used This lightweight version is designed specifically for the Raspberry Pi running Raspbian OS Enter an installation folder or press return to accept the default install location [/home/pi/Development/FreePascal]: The install folder will be: /home/pi/Development/FreePascal Continue? (y,n): y After install do you want to shortcuts created in: /home/pi/.local/share/applications (y/n)? y   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 [b]tar: fpc.lazarus.raspberry.tar.gz: Cannot open: No such file or directory tar: Error is not recoverable: exiting now rm: cannot remove âfpc.lazarus.raspberry.tar.gzâ: No such file or directory [/b]./setup.sh: line 206: /home/pi/Development/FreePascal/fpc/bin/fpcmkcfg: No such file or directory find: `/home/pi/Development/FreePascal/lazarus/config': No such file or directory find: `/home/pi/Development/FreePascal/lazarus/config': No such file or directory find: `/home/pi/Development/FreePascal/lazarus': No such file or directory find: `/home/pi/Development/FreePascal/lazarus': No such file or directory cp: cannot stat â/home/pi/Development/FreePascal/lazarus/lazarus.desktopâ: No such file or directory mv: cannot stat â/home/pi/Development/FreePascal/lazarus/lazarus.desktopâ: No such file or directory ./setup.sh: line 237: /home/pi/Development/FreePascal/fpc/bin/fpc- terminal.sh: No such file or directory ./setup.sh: line 238: /home/pi/Development/FreePascal/fpc/bin/fpc- terminal.sh: No such file or directory ./setup.sh: line 239: /home/pi/Development/FreePascal/fpc/bin/fpc- terminal.sh: No such file or directory ./setup.sh: line 240: /home/pi/Development/FreePascal/fpc/bin/fpc- terminal.sh: No such file or directory chmod: cannot access â/home/pi/Development/FreePascal/fpc/bin/fpc- terminal.shâ: No such file or directory Your Free Pascal 3.0 with Lazarus is now installed On a complete clean RPI3 with new jessie: Code: [Select]pi@raspberrypi:~ $ curl --version curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP pi@raspberrypi:~ $ ---------------------------------------------------------------------- Thaddy · 2016-10-28 08:54 A Raspbian that came with the sd card, but with all updates that are available today: raspi-config and an apt-get update and dist-upgrade Only the second install via wifi had an unexpected EOF due to a time- out. As you can see: cUrl is indeed installed by default. ---------------------------------------------------------------------- Thaddy · 2016-10-28 08:59 A further note is that I did the upgrades first is because of VC4 hardware accelerated chromium. But nothing else except for the dependency installs. I suggest you look at the logs if cUrl is updated in the dist-upgrade. ---------------------------------------------------------------------- rvk · 2016-10-28 09:00 What version of curl? curl --version And what does this give you: curl -o fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz For me it doesn't download anything without the -L switch: (this is on the latest 2016-09-23-raspbian-jessie without sudo apt-get update/upgrade) Code: [Select]pi@raspberrypi:~ $ curl -o fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 pi@raspberrypi:~ $ curl --version curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP pi@raspberrypi:~ $ ---------------------------------------------------------------------- Thaddy · 2016-10-28 09:04 Seem identical: Code: [Select]~/Downloads $ curl --version curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP Must be something else then? ---------------------------------------------------------------------- rvk · 2016-10-28 09:06 So... does this work? curl -o fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz If it does I would be really puzzled as to why it wouldn't work for me without the -L. When I add the -v I get this. You'll see I get the 302 Found but it doesn't proceed without -L for follow redirect. Code: [Select]pi@raspberrypi:~ $ curl -v -o fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz * Hostname was NOT found in DNS cache   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 162.125.65.1... * Connected to www.dropbox.com (162.125.65.1) port 443 (#0) * successfully set certificate verify locations: *   CAfile: none   CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): } [data not shown] * SSLv3, TLS handshake, Server hello (2): { [data not shown] * SSLv3, TLS handshake, CERT (11): { [data not shown] * SSLv3, TLS handshake, Server key exchange (12): { [data not shown] * SSLv3, TLS handshake, Server finished (14): { [data not shown] * SSLv3, TLS handshake, Client key exchange (16): } [data not shown] * SSLv3, TLS change cipher, Client hello (1): } [data not shown] * SSLv3, TLS handshake, Finished (20): } [data not shown] * SSLv3, TLS change cipher, Client hello (1): { [data not shown] * SSLv3, TLS handshake, Finished (20): { [data not shown] * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * Server certificate: *        subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=4348296; street=185 Berry St STE 400; postalCode=94107; C=US; ST=California; L=San Francisco; O=Dropbox, Inc; OU=Dropbox Ops; CN=www.dropbox.com *        start date: 2015-12-10 00:00:00 GMT *        expire date: 2017-12-13 12:00:00 GMT *        subjectAltName: www.dropbox.com matched *        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA *        SSL certificate verify ok. > GET /s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz HTTP/1.1 > User-Agent: curl/7.38.0 > Host: www.dropbox.com > Accept: */* > < HTTP/1.1 302 Found * Server nginx is not blacklisted < Server: nginx < Date: Fri, 28 Oct 2016 09:09:29 GMT < Content-Type: text/html; charset=utf-8 < Content-Length: 0 < Connection: keep-alive < Cache-Control: no-cache < Content-Security-Policy: sandbox < Location: https://dl.dropboxusercontent.com/content_link/QJWLWUYiHTR AOccw7bFYM2YioLe8PV8O5c840b3U2qN3klJFvdnzbTl5IF1prpKJ/file < Pragma: no-cache < Set-Cookie: locale=en; Domain=dropbox.com; expires=Wed, 27 Oct 2021 09:09:29 GMT; Path=/; secure < Set-Cookie: gvc=MjM2ODE0MTMxMTU4NDE1OTQ3NTU2Nzc4MDUyMDg5Mzk1MTExNTY%3D; expires=Wed, 27 Oct 2021 09:09:29 GMT; httponly; Path=/; secure < Set-Cookie: puc=; expires=Fri, 28 Oct 2016 09:09:29 GMT; httponly; Path=/; secure < Set-Cookie: seen-sl-signup-modal=VHJ1ZQ%3D%3D; expires=Sun, 27 Nov 2016 09:09:29 GMT; httponly; Path=/; secure < Set-Cookie: t=WXn8Fayw6qMyTmZm0G9GVk4f; Domain=dropbox.com; expires=Mon, 28 Oct 2019 09:09:29 GMT; httponly; Path=/; secure < Set-Cookie: __Host-js_csrf=WXn8Fayw6qMyTmZm0G9GVk4f; expires=Mon, 28 Oct 2019 09:09:29 GMT; Path=/; secure < X-Content-Type-Options: nosniff < X-Dropbox-Http-Protocol: None < X-Dropbox-Request-Id: aae547ea8e805d87fa1bd91dbeeb8354 < X-Frame-Options: DENY < X-Robots-Tag: noindex, nofollow, noimageindex < X-Xss-Protection: 1; mode=block < Strict-Transport-Security: max-age=15552000; includeSubDomains <   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 * Connection #0 to host www.dropbox.com left intact pi@raspberrypi:~ $ ---------------------------------------------------------------------- Thaddy · 2016-10-28 10:27 That does not work, indeed, I guess you missed something in the script, because that works.... I will have a closer look at the script. Looks at first glance to me the dropbox part is a fallback for the S3? ---------------------------------------------------------------------- rvk · 2016-10-28 10:30 Quote from: Thaddy on October 28, 2016, 12:27:50 pmThat does not work, indeed, I guess you missed something in the script, because that works.... I will have a closer look at the script. Looks at first glance to me the dropbox part is a fallback for the S3? Did you use the latest version of the script? Where it has this line: download fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz If so, it would be really really weird that it worked for you If you're using an older script which takes the download from S3, then it makes sense. ---------------------------------------------------------------------- Thaddy · 2016-10-28 10:39 I did not use the version on github but the first link ---------------------------------------------------------------------- Thaddy · 2016-10-28 10:48 it came from the first link like: http://cache.getlazarus.org/download/raspberry/setup.sh And that one works. ---------------------------------------------------------------------- rvk · 2016-10-28 10:50 Quote from: Thaddy on October 28, 2016, 12:39:02 pmI did not use the version on github but the first link Mmmm, The github version has: Code: [Select]URL=http://cache.getlazarus.org/archives download fpc.lazarus.raspberry.tar.gz $URL/fpc.lazarus.raspberry.tar.gzSo that one would work. The version on cache.getlazarus.org (http://cache.getlazarus.org/download/raspberry/setup.sh) has Code: [Select]# Download from our Amazon S3 bucket URL=http://cache.getlazarus.org/archives # download fpc.lazarus.raspberry.tar.gz $URL/fpc.lazarus.raspberry.tar.gz # trying dropbox to save money on bandwidth charges from amazon s3 download fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz So I would expect that you DO have the one from github, because that one still works (and doesn't use dropbox) !! Quote from: Thaddy on October 28, 2016, 12:48:21 pmit came from the first link like: http://cache.getlazarus.org/download/raspberry/setup.sh And that one works. Now this gets really weird.... The one from http://cache.getlazarus.org/download/raspberry/setup.sh has the dropbox link. And that doesn't work for me ---------------------------------------------------------------------- Thaddy · 2016-10-28 11:06 Oh well, it's Friday. I will get an 16G sd cart extra from the supermarket and film the whole shebang...again ---------------------------------------------------------------------- rvk · 2016-10-28 11:11 Quote from: Thaddy on October 28, 2016, 01:06:57 pmOh well, it's Friday. I will get an 16G sd cart extra from the supermarket and film the whole shebang...again  No need to film it. But if you check the script you'll see that line download fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz And if you enter the line manually curl -o fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz it also doesn't work for you. I would love to know why your script works (I do believe you but I'd like to understand why). The download function is this so I'll expect it to always take curl if installed: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i # function download(url, output)function download() {        if type "curl" > /dev/null; then                curl -o "$1" "$2"        elif type "wget" > /dev/null; then                wget -O "$1" "$2"        fi    } Adding -L will fix it but in that case I'll still not understand why it would work on your box. ---------------------------------------------------------------------- Thaddy · 2016-10-28 11:25 That's why I do a new sd card. I have no clue other than the file coming from a different cache. ---------------------------------------------------------------------- rvk · 2016-10-28 11:29 Quote from: Thaddy on October 28, 2016, 01:25:27 pmThat's why I do a new sd card. I have no clue other than the file coming from a different cache. You could check that by looking in the script itself to see if there is the dropbox link. Could you post the text from the terminal during install (it will be easier then to filming the whole shebang and it will make clear if curl is used or wget). (unfortunately it won't show if the download was taken from S3 or dropbox) (I also took a clean SD-card with the latest jessie 2016-09-23 on it) ---------------------------------------------------------------------- Cyrax · 2016-10-28 23:22 Code: [Select]#!/bin/bash # Author of this script: http://www.getlazarus.org # This is the universal script to install fpc 3.0.0 minimal # If you need to fix something and or want to contribute, send your # changes to admin at getlazarus dot org with # "fpc lazazarus install" in the subject line. # Prevent this script from running as root if [ "$(id -u)" = "0" ]; then    echo "This script should not be run as root"    exit 1 fi # Prevent this script from running as root if [ "$(id -u)" = "0" ]; then    echo "This script should not be run as root"    exit 1 fi # function download(url, output) function download() { if type "curl" > /dev/null; then curl -o "$1" "$2" elif type "wget" > /dev/null; then wget -O "$1" "$2" fi } # Cross platform function expandPath(path) function expandPath() { if [ `uname`="Darwin" ]; then [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; else echo $(readlink -m `$1`) fi } clear echo "Prerequisites for Free Pascal and Lazarus on Raspbian" echo "-----------------------------------------------------" echo "Lazarus requires the following Gtk+ dev packages which" echo "can be installed on Raspbian by using:" echo echo "sudo apt-get install libgtk2.0-dev libcairo2-dev \\" echo "  libpango1.0-dev libgdk-pixbuf2.0-dev libatk1.0-dev \\" echo "  libghc-x11-dev" echo echo -n "Press return to check your system" read CHOICE echo # function requirePackage(package) function requirePackage() { INSTALLED=$(dpkg-query -W --showformat='${Status}\n' $1 2> /dev/null | grep "install ok installed") if [ "$INSTALLED" = "" ]; then echo "$1 not found" echo echo "An error occured" echo echo "This script requires the package $1" echo echo "Use the command:" echo echo "sudo apt-get install $1" echo echo "Then re-run this script" echo exit 1 fi echo "$1 found" } requirePackage "libgtk2.0-dev" requirePackage "libcairo2-dev" requirePackage "libpango1.0-dev" requirePackage "libgdk-pixbuf2.0-dev" requirePackage "libatk1.0-dev" requirePackage "libghc-x11-dev" sleep 2s # Present a description of this script clear echo "Raspberry Free Pascal 3.0 with Lazarus install script" echo "-----------------------------------------------------" echo "This script will install a lightweight version of" echo echo "The Free Pascal Compiler version 3.0" echo "The Lazarus Development Environment" echo echo "After install 280MB of drive space will be used" echo echo "This lightweight version is designed specifically" echo "for the Raspberry Pi running Raspbian OS" echo # The default folder BASE=$HOME/Development/FreePascal # Ask a series of questions while true; do # Ask for an install location echo "Enter an installation folder or press return to" echo "accept the default install location" echo echo -n "[$BASE]: " read CHOICE echo # Use BASE as the default if [ -z "$CHOICE" ]; then CHOICE=$BASE fi # Allow for relative paths CHOICE=`eval echo $CHOICE` EXPAND=`expandPath "$CHOICE"` EXPAND=${EXPAND%/} # Allow install only under your home folder if [[ $EXPAND == $HOME* ]]; then echo "The install folder will be:" echo "$EXPAND" echo else echo "The install folder must be under your personal home folder" echo continue fi # Confirm their choice echo -n "Continue? (y,n): " read CHOICE echo case $CHOICE in [yY][eE][sS]|[yY]) ;; *) echo "done." echo exit 1 ;; esac # If folder already exists ask to remove it if [ -d "$EXPAND" ]; then echo "Directory already exist" echo -n "Remove the entire folder and overwrite? (y,n): " read CHOICE case $CHOICE in [yY][eE][sS]|[yY]) echo rm -rf $EXPAND ;; *) echo echo "done." echo exit 1 ;; esac fi break done # Confirm their choice echo "After install do you want to shortcuts created in:" read -r -p "$HOME/.local/share/applications (y/n)? " SHORTCUT echo # Create the folder BASE=$EXPAND mkdir -p $BASE # Exit if the folder could not be created if [ ! -d "$BASE" ]; then   echo "Could not create directory"   echo   echo "done."   echo   exit 1; fi cd $BASE # Note we use our bucket instead of sourceforge or svn for the following # reason: #   It would be unethical to leach other peoples bandwidth and data #   transfer charges. As such, we rehost the same fpc stable binary, fpc #   test sources, and lazarus test sources from sourceforge and free #   pascal svn servers using our own Amazon S3 bucket. # Download from our Amazon S3 bucket URL=http://cache.getlazarus.org/archives # download fpc.lazarus.raspberry.tar.gz $URL/fpc.lazarus.raspberry.tar.gz # trying dropbox to save money on bandwidth charges from amazon s3 download fpc.lazarus.raspberry.tar.gz https://www.dropbox.com/s/90cuaf1rvh8asj5/fpc.lazarus.raspberry.tar.gz tar xvf fpc.lazarus.raspberry.tar.gz rm fpc.lazarus.raspberry.tar.gz # Create the cfg file "$BASE/fpc/bin/fpcmkcfg" -d "basepath=$BASE/fpc/lib/fpc/\$FPCVERSION" -o "$BASE/fpc/bin/fpc.cfg" # function replace(folder, files, before, after) function replace() { BEFORE=$(echo "$3" | sed 's/[\*\.]/\\&/g') BEFORE=$(echo "$BEFORE" | sed 's/\//\\\//g') AFTER=$(echo "$4" | sed 's/[\*\.]/\\&/g') AFTER=$(echo "$AFTER" | sed 's/\//\\\//g') find "$1" -name "$2" -exec sed -i "s/$BEFORE/$AFTER/g" {} \; } # Replace paths from their original location to the new one ORIGIN="/home/pi/Development/Base" replace "$BASE/lazarus/config" "*.xml" "$ORIGIN" "$BASE" replace "$BASE/lazarus/config" "*.cfg" "$ORIGIN" "$BASE" replace "$BASE/lazarus" "lazarus.sh" "$ORIGIN" "$BASE" replace "$BASE/lazarus" "lazarus.desktop" "$ORIGIN" "$BASE" case $SHORTCUT in [yY][eE][sS]|[yY]) cp "$BASE/lazarus/lazarus.desktop" "$HOME/.local/share/applications/" ;; *) ;; esac mv "$BASE/lazarus/lazarus.desktop" "$BASE/lazarus.desktop" FPCDIR="$BASE/fpc" # Create a terminal configuration TERMINAL="$FPCDIR/bin/fpc-terminal.sh" echo "#!/bin/bash" > $TERMINAL echo "export PPC_CONFIG_PATH=$FPCDIR/bin" >> $TERMINAL echo "export PATH=\$PPC_CONFIG_PATH:\$PATH" >> $TERMINAL echo "\$SHELL" >> $TERMINAL chmod +x $TERMINAL # Get the current terminal program name APP=`ps -p $(ps -p $(ps -p $$ -o ppid=) -o ppid=) o args=` # Create a shortcut file DESKTOP="$BASE/freepascal.desktop" echo "[Desktop Entry]" > $DESKTOP echo "Name=Free Pascal Terminal" >> $DESKTOP echo "Comment=Open a new terminal with the fpc program made available" >> $DESKTOP echo "Icon=terminal" >> $DESKTOP echo "Exec=$APP -e \"$TERMINAL\"" >> $DESKTOP echo "Terminal=false" >> $DESKTOP echo "Type=Application" >> $DESKTOP chmod +x $DESKTOP function hit() { if type "curl" > /dev/null; then curl -s -o /dev/null "$1" elif type "wget" > /dev/null; then wget -q -O /dev/null "$1" fi } hit "http://www.getlazarus.org/installed/?platform=raspberry" echo echo "Your Free Pascal 3.0 with Lazarus is now installed" echo I see dropbox link in that script, too. ---------------------------------------------------------------------- rvk · 2016-10-28 23:29 Quote from: Cyrax on October 29, 2016, 01:22:01 amI see dropbox link in that script, too. And does the script work for you on a RPI with curl installed? Maybe dropbox doesn't always redirect (in which case the curl will work without -L). ---------------------------------------------------------------------- Cyrax · 2016-10-28 23:35 Quote from: rvk on October 29, 2016, 01:29:41 amQuote from: Cyrax on October 29, 2016, 01:22:01 amI see dropbox link in that script, too. And does the script work for you on a RPI with curl installed? Maybe dropbox doesn't always redirect (in which case the curl will work without -L). Sorry, but I don't own RPI so I can't test it. Just checked it out if server at cache.getlazarus.org does some funky real time modifications on during serving the script file to the client. ---------------------------------------------------------------------- krolikbest · 2016-11-07 08:20 Hi, I try to install at rvk suggestion http://forum.lazarus.freepascal.org /index.php/topic,33254.msg215422.html#msg215422 and 1. fpc is installed 2. but after downloading trunk ver of Lazarus, when doing: Quotemake all OPT="-dFPC_ARMHF"get an errors: Quote/usr/local/lazarus/trunktmp/ide/lazbuild.lpr(1870,1) Error: (9029) Error while compiling resources /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(1870,1) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted Makefile:4010: recipe for target 'lazbuild' failed make[2]: *** [lazbuild] Error 1 make[2]: Leaving directory '/usr/local/lazarus/trunktmp/ide' Makefile:4437: recipe for target 'lazbuilder' failed make[1]: *** [lazbuilder] Error 2 make[1]: Leaving directory '/usr/local/lazarus/trunktmp/ide' Makefile:3221: recipe for target 'lazbuild' failed make: *** [lazbuild] Error 2 system: Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux Could someone help? Martin ---------------------------------------------------------------------- DonAlfredo · 2016-11-07 08:57 Building Lazarus consumes a lot of memory ! You need an extra swap of at least 500MB, but better 1GB to build Lazarus. So, add swap with a swapfile. ---------------------------------------------------------------------- rvk · 2016-11-07 09:03 Quote from: DonAlfredo on November 07, 2016, 09:57:58 amBuilding Lazarus consumes a lot of memory ! You need an extra swap of at least 500MB, but better 1GB to build Lazarus. So, add swap with a swapfile. If my instructions were followed to the letter the swap would have been extended to 512Mb. (I'm currently testing to see if that's enough with a clean install) Code: [Select]# ====================================================== # we NEED to extend the swapfile (1 minute) # ====================================================== sudo nano /etc/dphys-swapfile CONF_SWAPSIZE=512   # <-- change this line sudo /etc/init.d/dphys-swapfile stop sudo /etc/init.d/dphys-swapfile start ---------------------------------------------------------------------- rvk · 2016-11-07 09:21 Yep, I also get the error with a 512 swap. Extending it to 1024 doesn't help. Code: [Select]Free Pascal Compiler version 3.1.1 [2016/11/07] for arm Copyright (c) 1993-2016 by Florian Klaempfl and others (1002) Target OS: Linux for ARMHF (3104) Compiling lazbuild.lpr /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(84,48) Hint: (5024) Parameter "Filename" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(81,45) Hint: (5024) Parameter "Code" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(82,21) Hint: (5024) Parameter "Filename" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(101,38) Hint: (5024) Parameter "DlgType" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(101,65) Hint: (5024) Parameter "Buttons" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(102,44) Hint: (5024) Parameter "HelpKeyword" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(104,39) Hint: (5024) Parameter "DlgType" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(104,66) Hint: (5024) Parameter "Buttons" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(105,45) Hint: (5024) Parameter "HelpKeyword" not used /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(617,97) Hint: (5091) Local variable "InheritedOptionStrings" of a managed type does not seem to be initialized (9022) Compiling resource ../units/arm-linux/nogui/lazbuild.or An unhandled exception occurred at $00079B9C: EStringListError: List index (7) out of bounds   $00079B9C   $00090154 /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(1870,1) Error: (9029) Error while compiling resources /usr/local/lazarus/trunktmp/ide/lazbuild.lpr(1870,1) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted Makefile:4010: recipe for target 'lazbuild' failed make[2]: *** [lazbuild] Error 1 make[2]: Leaving directory '/usr/local/lazarus/trunktmp/ide' Makefile:4437: recipe for target 'lazbuilder' failed make[1]: *** [lazbuilder] Error 2 make[1]: Leaving directory '/usr/local/lazarus/trunktmp/ide' Makefile:3221: recipe for target 'lazbuild' failed make: *** [lazbuild] Error 2 ---------------------------------------------------------------------- rvk · 2016-11-07 09:36 It's a problem with trunk. On Windows I also get a error compiling Lazarus (lazbuild in particular) Code: [Select]An unhandled exception occurred at $0041F3CA: EStringListError: List index (7) out of bounds   $0041F3CA  TSTRINGLIST__INSERT,  line 1632 of C:/dev2/fpc/rtl/objpas/classes/stringl.inc   $00428B6C  TCONFFILEPARSER__PARSE,  line 171 of fpcres/paramparser.pas   $00429723  TPARAMETERS__PARSE,  line 377 of fpcres/paramparser.pas   $00401F95  PARSEPARAMS,  line 175 of fpcres/fpcres.pas   $00402D04  main,  line 394 of fpcres/fpcres.pas MAKE.EXE[2]: *** [lazbuild.exe] Error 1 MAKE.EXE[1]: *** [lazbuilder] Error 2 MAKE.EXE: *** [lazbuild] Error 2 Done ---------------------------------------------------------------------- krolikbest · 2016-11-07 09:42 so maybe a little older ver (eg. 1.6), but more stable? ---------------------------------------------------------------------- rvk · 2016-11-07 09:47 Quote from: krolikbest on November 07, 2016, 10:42:39 amso maybe a little older ver (eg. 1.6), but more stable? I'm not sure at the moment if the problem is FPC or Lazbuild. You could try the Lazarus fixes_1.6 branche with FPC 3.0 svn co http://svn.freepascal.org/svn/fpc/branches/fixes_3_0/ fixes svn co http://svn.freepascal.org/svn/lazarus/branches/fixes_1_6/ fixes (and change the lines below that from trunk to fixes) Sometimes trunk brakes likes this (It's the hazard of using the latest development version). Using the fixes_branches normally get you a relative stable version. Otherwise you could go for the standard released 1.6/3.0 combo. in http://svn.freepascal.org/svn/fpc/tags/ http://svn.freepascal.org/svn/lazarus/tags/ ---------------------------------------------------------------------- marcov · 2016-11-07 16:22 It should be fixed meanwhile. ---------------------------------------------------------------------- dogriz · 2016-11-08 08:01 I had same errors with trunk versions from time to time, but with branch FPC 3.0.1 and Lazars 1.6.1, everything works on RaspberryPi 2 and OrangePi One (Raspbian and Armbian OS) ---------------------------------------------------------------------- krolikbest · 2016-11-08 14:21 Finally I've got Lazarus 1.7 (trunk ver). Thank you rvk and marcov very very much for cooperation stay tuned probably it's not an end of my problems, but i'm strongly determined to abandon Windows and Delphi. Martin ---------------------------------------------------------------------- lanties · 2016-11-10 16:06 ^^^^ krolikbest - What worked for you in the end? ---------------------------------------------------------------------- att2 · 2016-11-15 15:19 Hello, If you got your banana pi m3 to work with lazarus, its awesome. I just tried to install Lazarus 1.7 - the IDE starts but soon when I compile my first test program it fails with: Compile Project, Target: project1: Exit code 256, Errors: 1, Warnings: 2 project1.lpr(22,0) Warning: "crtbegin.o" not found, this will probably cause a linking failure project1.lpr(22,0) Warning: "crtend.o" not found, this will probably cause a linking failure /usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T? //usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRFreeMonitors' //usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRGetMonitors' project1.lpr(22,0) Error: Error while linking Again I am at a loss of just what to do. ---------------------------------------------------------------------- Thaddy · 2016-11-15 17:16 Quote from: att2 on November 15, 2016, 04:19:51 pmproject1.lpr(22,0) Warning: "crtbegin.o" not found, this will probably cause a linking failure project1.lpr(22,0) Warning: "crtend.o" not found, this will probably cause a linking failure You can ignore them. But you can also add the GCC library path which is (on my fully up-to- date RPi 3's): /usr/lib/gcc/arm-linux-gnueabihf/4.9 Now. I don't want to see that question ever again. You are not the first but I KNOW I have to do it all over again next week. ---------------------------------------------------------------------- Thaddy · 2016-11-15 17:43 Code: [Select]/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T? That is an ld (linker) bug and can be safely ignored. The future release of RaspBian is fixed. Code: [Select]//usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRFreeMonitors' //usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRGetMonitors' Are you sure you did a standard install? I have never seen those.... Which is strange. ---------------------------------------------------------------------- DonAlfredo · 2016-11-15 19:48 You could also try fpcupdeluxe. At the moment, it runs fine on my RPi. https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/tag/0.99c Just press trunk for trunk. ---------------------------------------------------------------------- Thaddy · 2016-11-15 20:00 Hmm.Will I get newpascal or FPC, then? Gonna try ---------------------------------------------------------------------- DonAlfredo · 2016-11-15 20:04 Trunk will give you a honest trunk, straight from SVN, without any extras. NewPascal will give you trunk from 1.5 days ago + some extras.