{"id":2256,"date":"2009-02-15T22:34:14","date_gmt":"2009-02-15T13:34:14","guid":{"rendered":"http:\/\/yasu2.prosou.nu\/blog\/index.php\/2009\/02\/15\/automated_gtk_build_script\/"},"modified":"2009-02-15T22:34:14","modified_gmt":"2009-02-15T13:34:14","slug":"automated_gtk_build_script","status":"publish","type":"post","link":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/2009\/02\/15\/2256\/","title":{"rendered":"Automated GTK+ build script"},"content":{"rendered":"<p><a href=\"http:\/\/yasu2.prosou.nu\/blog\/2009\/01\/gtk2416-universal-package-now.html\">As I wrote before<\/a>, I wrote an automated GTK+ build script. GTK framework is already available from <a href=\"http:\/\/www.gtk-osx.org\/\">gtk-osx.org<\/a> but I still need my own package because this is for Intel Macs only.<\/p>\n<p>\nI think GTK&#8217;s Quartz support is enough stable now, so this script builds an Quartz-GTK.<\/p>\n<p>\nTo use this script,<\/p>\n<ol>\n<li>Put all archives you need in archive\/\n<li>Make \/opt\/gtk writable by your account\n<li>Check whether your \/tmp has enough capacity\n<li>Then run this script, and do rm -rf \/tmp\/gtk\n<\/ol>\n<p>and you&#8217;ll get your GTK installation in \/opt\/gtk.<\/p>\n<p><!--more--><br \/>\n#!\/bin\/sh<br \/>\nexport CPPFLAGS=&#8217;-I\/opt\/gtk\/include&#8217;<br \/>\nexport LDFLAGS=&#8217;-L\/opt\/gtk\/lib&#8217;<br \/>\nexport PATH=${DEST}\/bin:${PATH}<br \/>\nexport BASEDIR=`pwd`<br \/>\nunpack_cmd(){<br \/>\necho $1 | awk -F. &#8216;{ \\<br \/>\ni=NF;<br \/>\n}&#8217;<br \/>\n}<br \/>\npre_configure(){<br \/>\ncase &#8220;$1&#8221; in<br \/>\njpeg|jasper)<br \/>\ncp \/usr\/bin\/glibtool libtool<br \/>\n;;<br \/>\nlibXrender)<br \/>\n#X11.app doesn&#8217;t provide x11.pc nor xproto.pc<br \/>\nsed -i \\~ -e &#8220;\/Requires.private: x11\/d&#8221; \\<br \/>\n-e &#8220;s\/ *x11\/\/g;s\/ *xproto\/\/g&#8221; \\<br \/>\n-e &#8220;\/^Cflags\/s\/$\/ -I\\\/usr\\\/X11R6\\\/include\/&#8221; \\<br \/>\n-e &#8220;\/^Libs\/s\/$\/ -L\\\/usr\\\/X11R6\\\/lib -lX11\/&#8221; \\<br \/>\nxrender.pc.in<br \/>\n#MacOS X 10.4 doesn&#8217;t have Xregion.h, but it&#8217;s included in MacPorts.<br \/>\ncp \/opt\/local\/var\/macports\/sources\/rsync.macports.org\/release\/ports\/x11\/xrender\/files\/include\/X11\/Xregion.h ${DEST}\/include\/X11<br \/>\nexport X_CFLAGS=&#8217;-I\/usr\/X11R6\/include -DXTHREADS&#8217;<br \/>\nexport X_LIBS=&#8217;-L\/usr\/X11R6\/lib -lX11&#8242;<br \/>\n;;<br \/>\nesac<br \/>\n}<br \/>\npre_build(){<br \/>\ncase &#8220;$1&#8221; in<br \/>\nglib|atk|gtk+) # -undefined dynamic_lookup problem<br \/>\nif [ &#8220;$CXXFLAGS&#8221; = &#8220;-arch ppc&#8221; ]; then<br \/>\nsed -i \\~ -e &#8216;s\/\\\\$.wl.-undefined \\\\$.wl.dynamic_lookup\/\/g;s\/-undefined dynamic_lookup\/\/g&#8217; libtool<br \/>\nfi<br \/>\n;;<br \/>\njpeg|jasper)<br \/>\n.\/configure &#8211;enable-shared &#8211;prefix=${DEST}<br \/>\nif [ &#8220;$(uname -p)&#8221; = &#8220;powerpc&#8221; -a &#8220;$1&#8221; = &#8220;jpeg&#8221; ]; then<br \/>\nsed -i \\~ -e &#8216;s\/\\\\$.wl.-undefined \\\\$.wl.dynamic_lookup\/\/g;s\/-undefined dynamic_lookup\/\/g&#8217; libtool<br \/>\n# sed -e &#8216;s\/CC= gcc\/CC= gcc -arch ppc\/&#8217; -i\\~ Makefile;<br \/>\nfi<br \/>\n;;<br \/>\nesac<br \/>\n}<br \/>\nconfig_opts(){<br \/>\ncase &#8220;$1&#8221; in<br \/>\ngtk+)<br \/>\necho &#8216;&#8211;with-gdktarget=quartz&#8217;<br \/>\n;;<br \/>\ngtk-engines)<br \/>\necho &#8216;&#8211;enable-animation&#8217;<br \/>\n;;<br \/>\nesac<br \/>\n}<br \/>\npost_build(){<br \/>\ncase &#8220;$1&#8243; in<br \/>\nlibXrender)<br \/>\nunset X_CFLAGS<br \/>\nunset X_LIBS<br \/>\nrm ${DEST}\/include\/X11\/Xregion.h<br \/>\n;;<br \/>\nesac<br \/>\n}<br \/>\necho Cleaning up all intermediate directories&#8230;<br \/>\nmkdir -p $BUILDDIR<br \/>\npushd $BUILDDIR<br \/>\nfor PKG in $PKGS ; do<br \/>\necho -n $PKG&#8217; &#8216;<br \/>\nrm -rf ${PKG}*<br \/>\ndone<br \/>\necho &#8221; &#8221;<br \/>\necho Extracting all archives&#8230;<br \/>\nfor PKG in $PKGS ; do<br \/>\necho -n $PKG&#8217; &#8216;<br \/>\n$(unpack_cmd ${BASEDIR}\/archive\/${PKG}*) ${BASEDIR}\/archive\/${PKG}* || exit<br \/>\ndone<br \/>\necho &#8221; &#8221;<br \/>\necho Building everything&#8230;<br \/>\nfor PKG in $PKGS ; do<br \/>\necho Building ${PKG}<br \/>\ncd ${PKG}*<br \/>\npre_configure ${PKG}<br \/>\n.\/configure &#8211;prefix=${DEST} `config_opts ${PKG}` || exit<br \/>\npre_build ${PKG}<br \/>\nmake -j4 &#038;&#038; make install || exit<br \/>\npost_build ${PKG}<br \/>\ncd ..<br \/>\ndone<br \/>\npopd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sed -i \\~ -e &#8216;s\/\\\\$.wl.-undefined \\\\$.wl.dynamic_lookup\/\/g;s\/-undefined dynamic_lookup\/\/g&#8217; libtool<br \/>\n&#8230;\t\tsed -i \\~ -e &#8216;s\/\\\\$.wl.-undefined \\\\$.wl.dynamic_lookup\/\/g;s\/-undefined dynamic_lookup\/\/g&#8217; libtool<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[9,6,4],"tags":[],"class_list":["post-2256","post","type-post","status-publish","format-standard","hentry","category-mac","category-unix-","category-4"],"_links":{"self":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2256"}],"version-history":[{"count":0,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2256\/revisions"}],"wp:attachment":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}