Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Prima + MCE::Hobo demonstration

by marioroy (Prior)
on May 02, 2017 at 21:01 UTC ( [id://1189360]=note: print w/replies, xml ) Need Help??


in reply to Prima + MCE::Hobo demonstration

Compiling Prima on Mac OS X.

These days, OS X doesn't ship with X11. Fortunately, XQuartz is available from https://www.xquartz.org. That provides the Mac with X11 support and ships with freetype2 and PNG libraries including header files. XQuartz installs under /opt/X11.

Below, one may need to run with configure --prefix=/opt/X11 when building the GIF and JPEG libraries. For unknown reasons, Prima does not check /usr/local on my system.

GIF: https://sourceforge.net/projects/giflib/files/

tar xjf giflib-5.1.4.tar.bz2 cd giflib-5.1.4 ./configure --prefix=/opt/X11 make sudo make install

JPEG: http://www.ijg.org/files/

tar xf jpegsrc.v9b.tar.gz cd jpeg-9b ./configure --prefix=/opt/X11 make sudo make install

Prima: https://metacpan.org/pod/Prima

tar xf Prima-1.51.tar.gz cd Prima-1.51 PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig perl Makefile.PL X11BASE=/opt/X +11 WITH_GTK2=0 make sudo make install

Unfortunately, the fonts aren't as nice as running a Tk app. It did find freetype2 when building Prima. For help, I sent the author an email about why fonts have a staircase look.

Regards, Mario

Update: The author confirm Prima selecting bitmap (core X11 fonts) over freetypes.

Replies are listed 'Best First'.
Re^2: Prima + MCE::Hobo demonstration
by marioroy (Prior) on May 03, 2017 at 15:07 UTC

    Dmitry committed fixes into master to ensure freetype fonts are selected over bitmap (core X11 fonts).

    On the Mac, the Makefile.PL now checks for pkgconfig residing under /opt/X11/lib. Not having to set PKG_CONFIG_PATH nor specify the path for X11BASE is awesome.

    The following applies to master and should work for Prima 1.52 and later releases.

    unzip Prima-master.zip cd Prima-master perl Makefile.PL WITH_GTK2=0 make sudo make install

    Thank you, Dmitry. Prima now looks great on the Mac.

      Hi Mario,

      On my Mac setup, you actually don't even need to say WITH_GTK2=0.

      /dk

        Hi dk,

        Some time ago, I tried Mono (C#) on the Mac. That ships with Gtk2 libraries and header files. For Prima to compile successfully, I'm having to specify WITH_GTK2=0. Otherwise, I get the following error: 'gdk/gdkx.h' file not found.

        perl Makefile.PL make ... cc -c -Iinclude -Iinclude/generic -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng16 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/gtk-2.0 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/gtk-2.0/includ +e -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/atk-1.0 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/gdk-pixbuf +-2.0 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/pango-1.0 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/glib-2.0 -I/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/glib-2.0/inclu +de -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include -I/Library/Frameworks/Mono.framework/Versions/4.8.1/include/libpng14 -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"1.51\" -DXS_VER +SION=\"1.51\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2leve +l/CORE" unix/gtk.c -o unix/gtk.o unix/gtk.c:15:10: fatal error: 'gdk/gdkx.h' file not found #include <gdk/gdkx.h> ^ 1 error generated. make: *** [unix/gtk.o] Error 1

        I'm curious and like to try building Gtk+ on the Mac. That means building PCRE, libffi, GLib, ATK, gdk-pixbuf, Cairo, Pango, and GTK+ 2. I'm not sure if this list covers all the dependencies, but is a start. Then will build Prima again with Gtk+. If successful, will post the steps taken.

        Regards, Mario

        Update: Prima in trunk now builds successfully with the Gtk headers and libraries included in Mono. Thank you, Dmitry. Ensure Mono is in your PATH inside .bash_profile and restart the terminal application. Or simply add the PATH manually.

        PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/4.8.1/bin

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1189360]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found