Gtk3 installer for my perl GUI examples

Commercial user software discussion.

Gtk3 installer for my perl GUI examples

Postby Doug Coulter » Tue Dec 12, 2017 12:07 am

It's come to my attention that few people are downloading my nice perl GUI code examples. Yes, I know, perl's weird if you're not familiar, but it's usually pretty easy to read my stuff and get familiar with perl if it wasn't done "write only" - and I avoid that, as I may have to read and maintain it myself...I forget easily, so...I keep it simple.

Anyway, one reason, or bit of friction, is how hard it is to get the necessary Gtk3.pm perl module to install...it seems some of the dependencies have been left out or lost in the newer linux distros.
Salvation is here if you use one that uses .deb.
This installs Gtk3.pm successfully in any recent linux, I tested with some pristine ones in virtual box. One developer nightmare is that as as programmer you have all the modules and dependencies on earth from previous battles, and when you ship code it won't run on other people's machines and you don't know why (doesn't help they don't forward the error messages and don't read them anyway).
So, VirtualBox, even though Oracle owns it - has its uses.

While this will put in cpanm for you (a very handy program you can install perl modules or update them with easily - example: (sudo cpanm Time::HiRes will install that module, or update it if possible),
I've found that syaptic does a little better on dependencies if you can work out the weird way these have been renamed. So this mostly uses that method, saving some hair-pulling to find out that the names now have lib in front of them, the captalization is different, often have -perl on the end, but none of this is "always".

Go for it....
Gtk3Install.sh.tar.gz
This one works in a number of places - tested.
(277 Bytes) Downloaded 255 times


For me, this is kind of a return to the glory days of GUI programming. The one thing Microsoft got right was DevStudio6 and MFC (once you learned those). You could whip out a reasonable user interface very very quickly - faster than VB and with far better code. Now we have the equivalent in Linux (finally), so maybe there will be more high quality stuff in the FOSS world soon.
Here I was just testing this all out.
https://www.youtube.com/watch?v=1SGPZTEECbo

What's cool is that you simply specify in Glade what subroutine to call if someone clicks here or some other event happens, and the perl module just hooks all that up like magic, no effort on your part except to name your handling subroutines correctly. So once you get the idea in Glade that it's a hierarchy of containers that finally contain widgets, it's actually better than Microsoft's best - unlike their layouts, these dynamically resize if the user wants that.

I'm building these scripts for a few other things too - NGINX, MySQL, PhpMyAdmin...things that are a pain to do but need doing everytime I do a full wipe and upgrade on a box. More to come.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Gtk3 installer for my perl GUI examples

Postby Doug Coulter » Tue Dec 12, 2017 12:10 pm

FWIW - Gtk3.pm won't install - is a bigger deal than usual (hoping the bots that crawl us will make this findable). I had to find an unmet dependency, which took a day of searching the internet only to find a single relevant mention from...2013 - quite awhile ago. Turns out this dependency was usually often satisfied by something else in linux installing it, so it's not really the developer's fault totally - you'd never notice even in pretty reasonable testing, that this was recently removed from most linux distros for whatever reason - I never did find out what else used it...

What makes it so interesting is the error message doesn't explicitly list the package you need to install to make it all good - just what's missing, which has a different name and is supplied by that package. Gheesh. The package I had to add was: libgirepository1.0-dev, which supplies also a file with a .pc extension, nowhere mentioned other than in the error message. And another bit of code that generates that file, which has yet another name, which like libgirepository, has seemingly nothing to do with desktop graphics.

Actually, in a perfect world, this would be simple and done by just "sudo cpanm Gtk3" - most of the rest of this script is just handling the other dependencies that aren't well enough specified in Gtk3 itself, and the idea was to eliminate the need to read the errors and go around and around till it worked. And without libgirepository1.0-dev - it did work, up until a more recent release of the popular Ubuntu and Mint distros (likely Debian too, and I saw plenty of issues for Fedora while searching)...but not anymore. So something else that needed that library doesn't anymore, and when they pulled that out, it broke other stuff that was riding along...a truly snaky one.

Sure, once you know this magic name and look it up, it's for graphics interface - but looking up the thing you're trying to get working - graphic interface - doesn't lead you back here!
I'm not surprised, it's more amazing how often this all works at this level of complexity. https://packages.debian.org/jessie/libg ... tory-1.0-1

So, again - Perl Gtk3.pm won't install - read this, robots! This is the cure.
snakes.png
I'm not alone in realizing this.


The below is for the search robots to chew on or others really high on the aspbergers spectrum:
The hope is that someone else can be spared this crap. Getting in touch with a fairly large number of part time developers
is not something I have time to do (finding them, joining their particular communication medium...and so on).
This issue affects more than one entity - and if we're lucky they won't just finger point.

The actual content of the shell file that works - warts and all:
#!/bin/sh

sudo apt-get install cpanminus build-essential gobject-introspection libcairo-gobject-perl libglib-object-introspection-perl libdevice-serialport-perl libgirepository1.0-dev libgtk3-perl
sudo cpanm Modern::Perl
#sudo cpanm --force Gtk3

########

Some captures from a simulated attempt at this:
doug@VBMint18 ~ $ sudo cpanm Gtk3
--> Working on Gtk3
Fetching http://www.cpan.org/authors/id/X/XA/XAO ... 033.tar.gz ... OK
Configuring Gtk3-0.033 ... OK
==> Found dependencies: Cairo::GObject, Glib::Object::Introspection
--> Working on Cairo::GObject
Fetching http://www.cpan.org/authors/id/X/XA/XAO ... 004.tar.gz ... OK
==> Found dependencies: ExtUtils::Depends, ExtUtils::PkgConfig
--> Working on ExtUtils::Depends
Fetching http://www.cpan.org/authors/id/X/XA/XAO ... 405.tar.gz ... OK
Configuring ExtUtils-Depends-0.405 ... OK
Building and testing ExtUtils-Depends-0.405 ... OK
Successfully installed ExtUtils-Depends-0.405
--> Working on ExtUtils::PkgConfig
Fetching http://www.cpan.org/authors/id/X/XA/XAO ... .16.tar.gz ... OK
Configuring ExtUtils-PkgConfig-1.16 ... OK
Building and testing ExtUtils-PkgConfig-1.16 ... OK
Successfully installed ExtUtils-PkgConfig-1.16
Configuring Cairo-GObject-1.004 ... N/A
! Configure failed for Cairo-GObject-1.004. See /home/doug/.cpanm/work/1513098921.4460/build.log for details.
--> Working on Glib::Object::Introspection
Fetching http://www.cpan.org/authors/id/X/XA/XAO ... 044.tar.gz ... OK
Configuring Glib-Object-Introspection-0.044 ... N/A
! Configure failed for Glib-Object-Introspection-0.044. See /home/doug/.cpanm/work/1513098921.4460/build.log for details.
! Installing the dependencies failed: Module 'Glib::Object::Introspection' is not installed, Module 'Cairo::GObject' is not installed
! Bailing out the installation for Gtk3-0.033.
2 distributions installed
//////////////////////////////////////////////////////
Dealing with GObject::Introspection gives other errors as seen above, and the clue such as it is is in the build log:
Running Makefile.PL
Package gobject-introspection-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-introspection-1.0' found
at Makefile.PL line 107.
*** can not find package gobject-introspection-1.0 >= 0.10.0
*** check that it is properly installed and available in PKG_CONFIG_PATH
at Makefile.PL line 107.

So, nowhere but in an obscure thread on the net is gobject-introspection-1.0.pc even mentioned - you'd not easily guess that to get this, you need to look for libgirepository-1.0 ....
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Gtk3 installer for my perl GUI examples

Postby Donovan Ready » Tue Dec 12, 2017 4:21 pm

Lordy. It took you as long to get yer GUI on as it did me, way back when COBOL didn't have GUIs.. :mrgreen:
Donovan Ready
 
Posts: 239
Joined: Thu Apr 17, 2014 1:22 pm
Location: Austin, Texas

Re: Gtk3 installer for my perl GUI examples

Postby Doug Coulter » Thu Dec 28, 2017 10:04 pm

Yup. I actually looked and yeah, you can get GUIs from COBOL now. But I didn't find a free one.
I never really did COBOL, but heard it was easy, but wordy. Not in this video - really, you have to remember and search for an apparently random number/name to get output? Of course, that's the opsys (which leads someday to a good joke about what happened when we once tried to hire some ex IBM guys to do embedded stuff - they about had a heart attack when they heard we wrote "the opsys"). We don't have enough funny efx here on the board to describe their near religious/numinous attitude to that...after we dismissed them, we laughed our butts off.
https://www.youtube.com/watch?v=Uv7ThVwb7m8
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Gtk3 installer for my perl GUI examples

Postby Donovan Ready » Fri Dec 29, 2017 1:39 am

I've never used JCL or any of the mainframe control languages.

This was PC COBOL 87, and for the "GUI", I spent a few hours getting high-order ASCII characters to look right when output to the text-mode CRT.

It actually looked better than some of the FoxPro frontends that people using smaller databases were familiar with at the time. I mean, Windows was there, but really? For a student loan service and accounting package, we didn't need the overhead and crashes..

I guess it's still like that, eh? :mrgreen:
Donovan Ready
 
Posts: 239
Joined: Thu Apr 17, 2014 1:22 pm
Location: Austin, Texas


Return to Userland

Who is online

Users browsing this forum: No registered users and 1 guest

cron