{"id":658,"date":"2008-12-25T17:41:19","date_gmt":"2008-12-25T16:41:19","guid":{"rendered":"http:\/\/www.jurecuhalev.com\/blog\/?p=658"},"modified":"2008-12-25T17:42:51","modified_gmt":"2008-12-25T16:42:51","slug":"graphication-on-os-x-with-pycairo","status":"publish","type":"post","link":"https:\/\/www.jurecuhalev.com\/blog\/graphication-on-os-x-with-pycairo\/","title":{"rendered":"Graphication on OS X (with pycairo)"},"content":{"rendered":"<p>I&#8217;m working on some visualizations and I want to achieve the look of Last.fm visualization <a href=\"http:\/\/lastgraph3.aeracode.org\/\">lastgraph3<\/a>:<\/p>\n<p style=\"text-align: center;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-659\" title=\"wavegraph\" src=\"https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/wavegraph.png\" alt=\"wavegraph\" width=\"500\" height=\"199\" srcset=\"https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/wavegraph.png 500w, https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/wavegraph-300x119.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>The great thing about this is that Andew Godwin, author of the site open sourced the underlying library &#8211; <a href=\"http:\/\/www.aeracode.org\/projects\/graphication\/\">Graphication<\/a>.<\/p>\n<p>Since I&#8217;m an OS X user, I decided to make the whole thing work on my system &#8211; Leopard 10.5.6 at the time of this writing. Here are the notes, mostly for my reference and because it might be also useful to others:<\/p>\n<blockquote><p>Get free XCode from Apple: <a href=\"http:\/\/developer.apple.com\/\">http:\/\/developer.apple.com\/<\/a><\/p>\n<p>First build and install pkg-config from: <a href=\"http:\/\/pkgconfig.freedesktop.org\/releases\/pkg-config-0.23.tar.gz\">http:\/\/pkgconfig.freedesktop.org\/releases\/pkg-config-0.23.tar.gz<\/a><\/p>\n<p>Then install libpng and libjpeg libraries:  <a href=\"http:\/\/ethan.tira-thompson.com\/Mac%20OS%20X%20Ports.html\">http:\/\/ethan.tira-thompson.com\/Mac%20OS%20X%20Ports.html<\/a><\/p>\n<p>Build and install pixman from: <a href=\"http:\/\/www.cairographics.org\/releases\/\">http:\/\/www.cairographics.org\/releases\/<\/a><\/p>\n<p>Build and install cairo from: <a href=\"http:\/\/cairographics.org\/releases\/\">http:\/\/cairographics.org\/releases\/<\/a><\/p>\n<p>Build and install pycairo from: <a href=\"http:\/\/cairographics.org\/releases\/\">http:\/\/cairographics.org\/releases\/<\/a><\/p>\n<p>Patching:<br \/>\n&#8211; you&#8217;ll need to edit cairo\/Makefile.in file by modifying parameter _cairo_la_LDFLAGS  (around line 215)  to remove &#8216;-export-symbols-regex init_cairo&#8217;<br \/>\n(<a href=\"http:\/\/michaelandlaura.org.uk\/~michael\/blog\/index.php?id=289\">thanks Michael Dales<\/a>)<\/p>\n<p>Build instructions:<br \/>\n&#8211; just follow INSTALL file. Essential running:<br \/>\n.\/configure &#8211;prefix=\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.5   (sys.path for my system)<br \/>\nand then   make &amp;&amp; sudo make install<\/p>\n<p>Now you can finally build and install Graphication package \ud83d\ude42<\/p><\/blockquote>\n<p>All the installations steps are just .\/configure &amp;&amp; make &amp;&amp; sudo make install and just work out of the box. I already have Python PIL installed from sources and I think you need this for one of the steps, but I&#8217;m not sure anymore for which one.<\/p>\n<p>After you go through all the steps, you can start drawing something like that:<\/p>\n<figure id=\"attachment_661\" aria-describedby=\"caption-attachment-661\" style=\"width: 512px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-661\" title=\"Simple visualization\" src=\"https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/month.png\" alt=\"Simple visualization\" width=\"512\" height=\"192\" srcset=\"https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/month.png 800w, https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2008\/12\/month-300x112.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><figcaption id=\"caption-attachment-661\" class=\"wp-caption-text\">Simple visualization<\/figcaption><\/figure>\n<p><em>Now to figure out how to create something meaningful with it.<\/em><\/p>\n<div class=\"zemanta-pixie\" style=\"margin-top: 10px; height: 15px;\"><a class=\"zemanta-pixie-a\" title=\"Zemified by Zemanta\" href=\"http:\/\/reblog.zemanta.com\/zemified\/e46e1874-4f49-4206-a2e3-2cd77e4b3738\/\"><img decoding=\"async\" class=\"zemanta-pixie-img\" style=\"border: medium none; float: right;\" src=\"http:\/\/img.zemanta.com\/reblog_e.png?x-id=e46e1874-4f49-4206-a2e3-2cd77e4b3738\" alt=\"Reblog this post [with Zemanta]\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m working on some visualizations and I want to achieve the look of Last.fm visualization lastgraph3: The great thing about this is that Andew Godwin, author of the site open sourced the underlying library &#8211; Graphication. Since I&#8217;m an OS X user, I decided to make the whole thing work on my system &#8211; Leopard [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14],"tags":[23,296,622,474,932,621],"class_list":["post-658","post","type-post","status-publish","format-standard","hentry","category-tech","tag-apple","tag-faqs-help-and-tutorials","tag-graphication","tag-mac-os-x","tag-python","tag-xcode"],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/comments?post=658"}],"version-history":[{"count":10,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"predecessor-version":[{"id":669,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions\/669"}],"wp:attachment":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}