Puppy Linux Blog Archive - Dec 2015

Posts Below
12/27/2015 - How to compile GNU Common Lisp 2.6.12 in Lucid Puppy Linux 5.2.8
12/27/2015 - How to compile newLISP in Lucid Puppy Linux 5.2.8
12/29/2015 - Was able to compile PHP 7.0.1 in Lucid Puppy Linux 5.2.8, but couldn't compile PHP-GTK 2.0.1 to work with PHP 7.0.1
12/29/2015 - How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8
12/30/2015 - How to compile Guile-Gnome 2.16.4 in Lucid Puppy Linux 5.2.8

    Hide/Show:


   ▲ Top  ▼ Bottom  △ TOC   ↓ Down
How to compile GNU Common Lisp 2.6.12 in Lucid Puppy Linux 5.2.8
Sunday, December 27th, 2015
14:39:57 GMT


I had a tough time compiling GNU Common Lisp 2.6.12 from scratch in Lucid Puppy Linux 5.2.8 version 004.

But, I finally managed to do it. Here's how:


  1. GNU Common Lisp can do things with Tcl/Tk, but only if you have Tcl/Tk installed.

    As far as I know, Lucid Puppy 5.2.8 doesn't include Tcl/Tk by default. So, if you want Tcl/Tk, you can download their source code here:

    https://www.tcl.tk/software/tcltk/download.html

    I downloaded version 8.6.4 of both Tcl and Tk.


  2. Both Tcl and Tk were nice and easy to compile. I don't know if you have to compile and install them in a particular order, but I think I compiled and installed Tcl first.

    All I had to do was unzip each source code tarball, open the source code folder, open a terminal window, and put in these three commands:

    ./configure
    make
    make install

    (Though I actually used the command "new2dir make install" (without quotes) because I wanted to make .pet and .sfs files.)


  3. GNU Common Lisp itself was far more troublesome to compile. You can download its source code here:

    http://gnu.mirror.iweb.com/gcl/gcl-2.6.12.tar.gz


  4. Unzip the source code tarball. And if you want to make a .pet or .sfs file of make .pet and .sfs files, rename the gcl folder to "gcl-2.6.12" (or whichever version you're trying to compile).


  5. Next, open your gcl source code folder, then open the "h" folder. Then, open the "make-init.h" file in a text editor.

    Above the line which says "#include <signal.h>" (without quotes), add this line:

    #include <sys/ucontext.h>

    (Huge thanks to the author of this post for the solution, because without that post I would have had absolutely no clue at all what to do.)

    The above fix makes it so the compilation won't be stopped by these errors:


  6. Go back to the gcl source code folder, open a terminal, and type these three lines:

    ./configure --enable-tkconfig=/usr/local/lib/ --enable-tclconfig=/usr/local/lib/

    LD_LIBRARY_PATH=/usr/local/lib

    make


  7. After the build is finished - if you want to make a .pet and/or .sfs file, type this:

    new2dir make install

    Or, if you'd rather just install it without building a .pet or .sfs file, type this:

    make install


  8. Just one last nuisance to deal with. The file /bin/gcl has to be moved or renamed, because otherwise, your system might mistakenly try to run that instead of the correct gcl file at: /usr/local/bin/gcl

After all those steps, it should be possible to run GNU Common Lisp simply by typing "gcl" (without quotes).


If you have Tcl/Tk, here's how you can try them out with GNU Common Lisp.

Go to the gcl source code folder, open a terminal prompt, and type:

gcl

Then, at the GCL prompt, put in these commands:

(si::tkconnect)

(load "gcl-tk/demos/widget.lisp")

That last command will fail if your current working directory isn't the gcl source code folder.

   ▲ Top  ▼ Bottom  △ TOC   ↓ Down


   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑
How to compile newLISP in Lucid Puppy Linux 5.2.8
Sunday, December 27th, 2015
14:58:21 GMT


Compiling newLISP 10.6.2 from scratch in Lucid Puppy Linux 5.2.8 wasn't as tough as compiling GNU Common Lisp 2.6.12, but it was still a bit tricky.


  1. You can download newLISP's source code from here:

    http://www.newlisp.org/index.cgi?Downloads


  2. Then, download libffi from here (I used version 3.2.1):

    https://sourceware.org/libffi/

    I don't know if most typical Linuxes usually already have that or not, but, Lucid Puppy 5.2.8 version 004 doesn't, and newLISP needs it.


  3. Unzip the libffi source code tarball, open the libffi source code folder, and open a terminal window. Then, do these 3 commands:

    ./configure
    make
    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.


  4. Next, unzip newLISP's source code, open the newLISP source code folder, open a terminal window, and type:

    ./configure


  5. Don't type "make" yet. For some reason, ./configure wrongly assumes libffi is at a location it's not at, so you have to open the file "makefile_build" in a text editor and fix the mistaken path in it.

    This is the line you need to change:

    CFLAGS = -fPIC -m32 -Wall -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX -DFFI -I/usr/local/lib/libffi-3.0.13/include

    And here's what you change it to:

    CFLAGS = -fPIC -m32 -Wall -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX -DFFI -I/usr/local/lib/libffi-3.2.1/include/


  6. Now, you can type "make" (without quotes), and the build should succeed now.


  7. Next, you can type "make install" or "new2dir make install" (without quotes) to install newLISP.


  8. And the last step is, you have to create a symlink so newLISP can find a shared library which newLISP mistakenly looks for in the wrong place.

    This command will create the symlink:

    ln -s /usr/local/lib/libffi.so.6 /usr/lib/libffi.so.6


Now, it should be possible to run newLISP just by typing "newlisp" (without quotes).

   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑


   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑
Was able to compile PHP 7.0.1 in Lucid Puppy Linux 5.2.8, but couldn't compile PHP-GTK 2.0.1 to work with PHP 7.0.1
Tuesday, December 29th, 2015
06:50:38 GMT


I finally heard the news that PHP 7.0.1 has been released. So, I decided to see if I could get PHP-GTK 2.0.1 working with it. Alas, no.

I had hardly any trouble compiling PHP 7.0.1 itself. The only problem I had was this old problem, oddly deemed "Not a bug", from 2010:

https://bugs.php.net/bug.php?id=51774

./configure got stopped with these error messages at the bottom:

The problem was, I had put my PHP source code folder at a path which had a space in it:

/apmnt/truecrypt62/Hobbiton_Meadow/PHP 7/php-7.0.1/

I think I encountered this error while compiling PHP in the past, but I forgot yet again that lots of things in Linux have ridiculous incompatibilities with paths containing spaces.

The fix was simply to remove the space, changing the path to this:

/apmnt/truecrypt62/Hobbiton_Meadow/PHP7/php-7.0.1/

"./configure" worked fine after that, and so did "make" and "make install".


Here are some details on what stopped me from compiling PHP-GTK 2.0.1 to work with PHP 7.0.1.

If I recall correctly, PHP-GTK 2.0.1 needs the Cairo extension from PECL, and I wasn't able to compile Cairo 0.3.2, despite the fact that it worked with PHP 5.6.13.

This is as far as I got trying to compile Cairo 0.3.2:

And this is as far as I got trying to compile PHP-GTK 2.0.1:


So, if I ever manage to finish the PHP-GTK version of Astroblahhh Desktop, it might not be capable, at least for a while, of running on anything much newer than PHP 5.6.13. (Though it might also work with slightly later versions of PHP 5.6 which I haven't yet tried.)

   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑


   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑
How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8
Tuesday, December 29th, 2015
13:07:46 GMT


I apparently managed to compile GNU Guile in Lucid Puppy Linux 5.2.8 version 004 - though doing so was even more difficult than the last few things I compiled.

And I'm not sure the way I did it was a good idea, since I had to do something rather questionable to trick libunistring into acknowledging that my copy of iconv works. I hope this didn't break anything, but I have no idea. So, please be careful.


I got interested in GNU Guile because it uses the programming language Scheme, which is related to Lisp, and GNU Guile has a component called Guile-Gnome (which I haven't tried to compile yet) which apparently lets you deal with GTK stuff.

So, I guess basically I'm fishing around for Lisp-y alternatives to PHP-GTK, just in case I turn out to like Lisp or maybe even Scheme more than PHP.

But maybe in the end I'll just use lisphp with PHP and PHP-GTK. Or maybe I won't even like Lisp enough to do that? I just haven't done enough with any Lisp or Scheme yet to be able to decide.

Also, another factor to take into consideration is, how cross-platform are these Lisp and Scheme-based things? Will they make it as easy as PHP-GTK to make Astroblahhh Desktop capable of working in not only Linux, but also Windows and Macs?


How to build GNU Guile in Lucid Puppy Linux 5.2.8 version 004:

  1. There were at least two dependencies of GNU Guile I had to download, compile and install - libunistring (I used version 0.9.5), and libgc (I used version 7.2).

    And if I hadn't already had libffi 3.2.1 as a result of compiling newLISP the other day, I probably would have had to install libffi too.

    So, the first step is to download the dependencies you need:

    https://www.gnu.org/software/libunistring/#downloading

    http://www.hboehm.info/gc/#where

    https://sourceware.org/libffi/


  2. Lucid Puppy 5.2.8 version 004 apparently already has iconv - so, I'm not sure if this step 2 is necessary. But, I upgraded to libiconv 1.14 in the hope that that would get rid of libunistring's refusal to acknowledge that I have a working copy of iconv.

    But, even upgrading libiconv still didn't fix that problem, so I had to resort to something which I'm hoping was not a bad, dangerous thing to do - I edited libunistring's configure script to make it just assume iconv is working. (I'll explain exactly what I did in a later step.)

    I don't know whether or not GNU Guile can use the iconv that comes with Lucid Puppy 5.2.8, so, maybe it's best to upgrade to libiconv 1.14, as I did.

    So, step 2 is to download libiconv, if you want to update iconv.

    https://www.gnu.org/software/libiconv/#downloading


  3. And, download the source code of GNU Guile itself. (I used version 2.0.11.)

    http://www.gnu.org/software/guile/download/

    ftp://ftp.gnu.org/gnu/guile/guile-2.0.11.tar.gz


  4. Unzip the libffi source code tarball, open the libffi source code folder, and open a terminal window. Then, do these 3 commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  5. Next, unzip the libgc source code tarball, open the source code folder, open a terminal, and do these commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  6. If you decided not to upgrade libiconv, you can skip this step.

    If you decided to upgrade libiconv, unzip the libiconv source code tarball, open the libiconv code folder, open a terminal window, and do these commands:

    ./configure --prefix=/usr/local

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)

    Then, to stop your system from trying to use the old iconv instead of the new iconv - go to the folder /usr/bin, and rename the file iconv to something else.


  7. Next, unzip the libunistring source code tarball, and open the libunistring source code folder.


  8. This is the trickiest and probably the most potentially dangerous and questionable step. I'm not sure this is a good idea at all, but, I haven't yet found any other way to make the build of GNU Guile succeed, because GNU Guile's ./configure complains if libunistring is compiled without libiconv support.

    In the libunistring source code folder, open the file "configure" with a text editor. Go to line 17639, which says:

    am_cv_func_iconv_works=no

    Change it to:

    am_cv_func_iconv_works=yes


  9. Next, open a terminal at the libunistring source code folder. Do this command:

    ./configure --prefix=/usr/local

    If it worked properly, it should say the following starting around line 114 of the stuff printed by ./configure:

    checking for iconv... yes
    checking for working iconv... yes
    checking how to link with libiconv... /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
    checking for iconv declaration... 
             extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
    checking for iconv.h... yes

    If it does say that, then, do these commands:

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  10. Now that GNU Guile's dependencies have been installed, we can proceed with building GNU Guile. Unzip GNU Guile's source code tarball, open the GNU Guile source code folder, and open a terminal window. Do these commands:

    LD_LIBRARY_PATH=/usr/local/lib

    ./configure

    (The first line somehow stops "make" from complaining about not being able to find libunistring.)


  11. Next, do this command:

    make

    And be prepared to wait a long time for it to build. For me, it took more than a half an hour, even on the 3.4 GHz dual core desktop computer I was building it on.

    At first it looks like it's going pretty fast and doing lots of stuff, but it seemed to get stuck for a very long time doing something with these files:

    wrote `ice-9/eval.go'
      GUILEC ice-9/psyntax-pp.go
    wrote `ice-9/psyntax-pp.go'
      GUILEC ice-9/boot-9.go
    wrote `ice-9/boot-9.go'
      GUILEC ice-9/vlist.go
    wrote `ice-9/vlist.go'
      GUILEC srfi/srfi-1.go
    wrote `srfi/srfi-1.go'
      GUILEC language/tree-il/peval.go
    wrote `language/tree-il/peval.go'
      GUILEC language/tree-il/cse.go

    And so on. I was a bit worried something went wrong and it was never going to finish, but, all I had to do was wait. And wait, and wait.


  12. Once "make" is finished, you can do this command:

    make install

    (Or, if you want to build an .sfs or .pet file, put "new2dir make install" (without quotes) instead of "make install".)


Now, it should be possible to run GNU Guile simply by typing "guile" in a terminal.

I don't know if there's a GUI (graphical user interface) somewhere, but, if I find there is, I'll update this post.


I don't yet know how to make GNU Guile do anything particularly eye-catching, but, you can make it do some addition by typing something like this:

(+ 2 2)

To which GNU Guile will respond:

$1 = 4

And apparently that creates a variable called $1, containing "4" (the result of adding 2+2).


And you can use the automatically-created $1 variable in other commands like this:

(+ $1 1)

To which GNU Guile will respond:

$2 = 5

($1 equals 4, and 4 plus 1 equals 5.)

   ▲ Top  ▼ Bottom  △ TOC   ↓ Down   Up ↑


   ▲ Top  ▼ Bottom  △ TOC   Up ↑
How to compile Guile-Gnome 2.16.4 in Lucid Puppy Linux 5.2.8
Wednesday, December 30th, 2015
14:39:36 GMT


It was another difficult process, but I finally managed to build Guile-Gnome for GNU Guile in Lucid Puppy Linux 5.2.8 version 004.

Now, I can actually make GNU Guile create GTK windows! So, perhaps GNU Guile will turn out to be a good substitute for PHP-GTK.

If I can get GNU Guile to work with MySQL and SQLite databases, and also have it output web pages (so I can keep Astroblahhh Desktop's web interface), perhaps a GNU Guile-based Astroblahhh Desktop might be feasible.

I wonder if GNU Guile can work with OrientDB?

However, I'm not sure if I should write the CMS (content management system, for lack of a better term) of my dreams in any very uncommonly used language or platform. PHP is available from most web hosts. Even figuring out how to make the Java-based OrientDB work with my websites seems like it might be difficult, though maybe less difficult than figuring out how to get some form of Lisp or Scheme like GNU Guile working on a web server.


But, back to the topic of how to build Guile-Gnome in Lucid Puppy Linux 5.2.8 version 004.

Once again, I had to use some trickery (or guile! Haha, I made a pun) to get past some hopefully mistaken errors. I'll explain more about that below.


  1. The first prerequisite is to build GNU Guile, if you haven't already. This earlier blog post of mine has instructions.


  2. You can download Guile-Gnome itself here:

    https://www.gnu.org/software/guile-gnome/download.html

    I used version 2.16.4.


  3. Guile-Gnome has various dependencies that you'll need to download.

    Here's most of what I needed:

    Those are the three easiest things to get. Downloading Guile-Cairo will be explained in step 3.


  4. Guile-Cairo can't so easily be downloaded because the needed version was never officially released - it seems to only be available by downloading it via Git (and not even GitHub).

    Fortunately, an at least partway functional copy of an old version of Git exists in the Lucid Puppy Linux DevX SFS file of development tools. The DevX, by the way, is what you need to use to compile software in Lucid Puppy Linux 5.2.8.

    My page of Some Puppy Linux Basics explains more about DevX files, and if you need the DevX for Lucid Puppy 5.2.8, it's available at this link:

    http://distro.ibiblio.org/puppylinux/puppy-5.2.8/

    (If you're using a different version of Puppy than Lucid Puppy 5.2.8, that DevX probably won't work, so you should instead download the DevX released for your Puppy.

    Also, if you're not using Lucid Puppy 5.2.8, please bear in mind that the instructions in this blog post might not all apply or work for you, since different Puppy Linux distros, and probably even different versions of the same Puppy distro, can differ quite substantially from each other.)

    And here's how to load SFS files.


  5. Once you have the DevX mounted, you should be able to run Git. Go to a folder that you want to download Guile-Cairo into, open a terminal window, and put in this command:

    git clone git://git.savannah.nongnu.org/guile-cairo.git

    If it worked, you'll see some text like this:

    # git clone git://git.savannah.nongnu.org/guile-cairo.git
    Initialized empty Git repository in /root/guile-cairo/.git/
    remote: Counting objects: 830, done.
    remote: Compressing objects: 100% (280/280), done.
    remote: Total 830 (delta 522), reused 830 (delta 522)
    Receiving objects: 100% (830/830), 594.72 KiB | 666 KiB/s, done.
    Resolving deltas: 100% (522/522), done.

    And there will now be a "guile-cairo" folder in the folder you opened the terminal window from.


  6. Now we can get started compiling things. First, an easy one. Unzip the G-Wrap source code tarball, open the G-Wrap folder, open a terminal window, and put in these commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  7. Next, Pixman, which is also easy to compile. Unzip the Pixman source code tarball, open the Pixman folder, open a terminal window, and put in these commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  8. Next, a more difficult one to compile - Cairo. Unzip the Cairo source code tarball, open the Cairo folder, open a terminal window, and put in these commands:

    export pixman_CFLAGS="-I/usr/local/include/pixman-1"

    export pixman_LIBS="-L/usr/local/lib/ -lpixman-1"

    ./configure --enable-gobject=yes

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  9. Next, Guile-Cairo. Mostly easy, once you have Cairo itself compiled correctly.

    If you want to make a .pet or .sfs file, rename the Guile-Cairo folder to something like "guile_cairo-1.10". (Though I'm not sure that's the actual version number. You can use any version number - this rename is just to make it so new2dir won't complain later on about not being in a folder with a version number.)

    Next, open the Guile-Cairo folder, open a terminal window, and put in these commands:

    ./configure --prefix=/usr/local

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  10. Now, it should be possible to compile Guile-Gnome itself. Unzip the Guile-Gnome source code tarball, open the Guile-Gnome folder, open a terminal window, and put in this command:

    ./configure --prefix=/usr/local/

    If all went well, somewhere in the messages printed by ./configure should be this text:

    All available wrappers will be built:
      atk cairo corba gconf glib gnome-vfs gtk libglade libgnome libgnomecanvas libgnomeui pango


  11. Don't type "make" yet. Here's where I had to do a maybe unwise trick, so Guile-Gnome won't complain that "Cairo was not compiled with support for GObject".

    Go to the folder /usr/local/include/cairo/ and open the file cairo-gobject.h in a text editor.

    Delete this line toward the top (line 42 in my cairo-gobject.h):

    #if CAIRO_HAS_GOBJECT_FUNCTIONS

    And delete these three lines near the bottom (starting at line 188 in my cairo-gobject.h):

    #else /* CAIRO_HAS_GOBJECT_FUNCTIONS */
    # error Cairo was not compiled with support for GObject
    #endif /* CAIRO_HAS_GOBJECT_FUNCTIONS */

    Then, save the cairo-gobject.h file.


    I believe that due to the way I compiled Cairo (described above), Cairo really does have GObject support.

    And also, I got an encouraging-looking response when I tried a command I found on this page:

    pkg-config --libs cairo-gobject

    The response was:

    -pthread -L/usr/local/lib -lcairo-gobject -lcairo -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0


  12. Now, back in the Guile-Gnome folder's, type this in a terminal window:

    make

    Hopefully everything will go smoothly now that Guile-Gnome has no way not to acknowledge that Cairo really does have GObject support.


  13. Next, type either "make install" (without quotes) or "new2dir make install" if you want to make a .pet or .sfs file out of Guile-Gnome.


  14. For some reason, GNU Guile doesn't automatically know where the Guile-Gnome modules are, so you have to give GNU Guile this command:

    (use-modules (gnome-2))

    After doing that, it should be possible to run the example scripts from the Guile-Gtk Overview page, which will create a GTK window containing a button which says "Hello, World!"

I don't know yet how to make GNU Guile automatically find the Guile-Gnome modules.

But, I assume that similar to GNU Emacs, there's probably some sort of config file somewhere which you can put commands in like "(use-modules (gnome-2))" so those commands will be run automatically every time you start GNU Guile.

   ▲ Top  ▼ Bottom  △ TOC   Up ↑


    Hide/Show: