{"id":306,"date":"2006-01-27T07:49:00","date_gmt":"2006-01-27T07:49:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/Apple\/OSX\/howto-build-and-install-carbon-xemacs-on-os-x.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"howto-build-and-install-carbon-xemacs-on-os-x","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2006\/01\/27\/howto-build-and-install-carbon-xemacs-on-os-x\/","title":{"rendered":"HOWTO (Build and) Install Carbon XEmacs on OS X"},"content":{"rendered":"<p><strong>Update:<\/strong> added instructions for installing elisp packages after building.<\/p>\n<p>There are as many <a href=\"http:\/\/www.emacswiki.org\/cgi-bin\/emacs-en\/Emacsen\">Emacsen<\/a> as there are grains of sand in the desert.  For various reason (largely habit) I prefer XEmacs to Emacs, when given a choice- even when in text mode (<code>xemacs -nw<\/code> for the uninitiated; I usually alias this to <code>emacs<\/code>).  And while I love a good command prompt as much as the next geek, I do own a Mac, and sometimes I want a more Mac-like experience.  <\/p>\n<p><a href=\"http:\/\/members.shaw.ca\/akochoi-xemacs\/\">Carbon XEmacs<\/a> is a derivative of <a href=\"http:\/\/www.xemacs.org\/\">XEmacs<\/a>, developed by <a href=\"http:\/\/www.sixthhappiness.ca\/blog\/index.html\">Andrew Choi<\/a>.  Carbon XEmacs does not require X11, but instead uses the OS X Carbon libraries for its GUI display.  Of the various OS X-specific Emacsen I have tried, it is my current favorite.  At the time of this writing, the current version of Carbon XEmacs is Beta 4, and is available as a series of patches against the XEmacs source.  This HOWTO describes how to build Carbon XEmacs Beta 4 for Mac OS X 10.4.4, and <em>attempts<\/em> to describe more generally how to build the latest Carbon XEmacs for any OS X 10.3+.  Since many Mac users (myself included) are spoiled by the many binary packages and  package managers (such as <a href=\"http:\/\/fink.sourceforge.net\/\">Fink<\/a> and <a href=\"http:\/\/darwinports.opendarwin.org\/\">Darwin Ports<\/a>) available for OS X, this HOWTO goes into some detail about how to download, patch, and build the source.  If you already know this stuff, feel free to skim.<\/p>\n<p>(If you&#8217;ve never done so before, you&#8217;ll need to install the XCode developer tools from your OS X install CD\/DVD.  If you&#8217;ve lost these, it&#8217;s available from <a href=\"http:\/\/developer.apple.com\/\">Apple&#8217;s Developer site<\/a>.  It&#8217;s basically a click-and-forget installer package.)<\/p>\n<h5>Let&#8217;s do this<\/h5>\n<p>To begin, you will need to download the XEmacs source for the same XEmacs version that your Carbon XEmacs patches apply to.  At the time of the writing, the latest Carbon XEmacs is Beta 4, which is supplied as a diff (set of patches) to xemacs-21.5.23.   Visit the <a href=\"http:\/\/www.xemacs.org\/Download\/index.html\">XEmacs.org download page<\/a> to locate a suitable mirror, and download the source package for the correct version.  As of this writing, all 21.5.x releases are considered Beta releases of XEmacs, so I chose the beta download page, and a local mirror therein. <\/p>\n<p>When you arrive at the mirror, it will be a directory on an FTP server, full of files.  look for a tarball- a file ending with <code>.tar.gz<\/code>&#8211; matching the xemacs version you need.  In this case, I&#8217;ll be downloading <code>xemacs-21.5.23.tar.gz<\/code>.  You will also see files with similar names ending in <code>.patch.gz<\/code>, <code>.asc<\/code>, and <code>.md5<\/code>.  You will not need these (unless you need them- in which case you already know you need them.  The rest of us will soldier on).  <\/p>\n<p>After downloading the file, open Terminal and change to the directory where the <code>.tar.gz<\/code> file was downloaded.  I downloaded mine to my <code>~\/ext<\/code> directory:<\/p>\n<pre><code>cd ~\/ext<\/code><\/pre>\n<p>If you don&#8217;t know where your downloads go, they probably go to your desktop; try <code>cd ~\/Desktop<\/code> (capitalization counts).  Now we&#8217;ll extract the source code:<\/p>\n<pre><code>tar xzf xemacs-21.5.23.tar.gz<\/code><\/pre>\n<p>Download the diff file from the <a href=\"http:\/\/members.shaw.ca\/akochoi-xemacs\/\">Carbon XEmacs page<\/a> to the same directory where you downloaded the xemacs source.  Uncompress the diff file:<\/p>\n<pre><code>bunzip2 xemacs-21.5.23-carbon-b4.diff.bz2<\/code><\/pre>\n<p>And patch the original sources: <\/p>\n<pre><code>patch -p0 &lt; xemacs-21.5.23-carbon-b4.diff<\/code><\/pre>\n<p>An aside: this is some pretty cool stuff if you&#8217;re not familiar with diffing and patching; the diff file is just a list of the <em>changes<\/em> between the original and Andrew Choi&#8217;s version, <code>patch<\/code> applies these changes to our original files, resulting in files that match Choi&#8217;s modified source.  For the curious, <code>-p0<\/code> (essentially) tells <code>patch<\/code> that it doesn&#8217;t have to adjust the paths; that&#8217;s why we made sure we put the patch in the same directory as the original zipped sources.<\/p>\n<p>Now, time to make the donuts, er, software:<\/p>\n<pre><code>cd xemacs-21.5.23\/carbon\nsh build-app.sh<\/code><\/pre>\n<p>And now, the waiting.  The hardest part, if we are to believe Tom Petty.  This will take a while.  On my 1.8 GHz iMac G5 (1.5GB RAM), it took around 7 minutes or so; it would probably take twice as long on my old G4 Powerbook.<\/p>\n<p>When it&#8217;s done, you&#8217;ll have a shiny new XEmacs.app in the current directory (<code>carbon<\/code>).  Unfortunately, your shiny new XEmacs.app doesn&#8217;t do a whole lot- none of the lisp packages that provide a significant portion of XEmacs&#8217; features are included in the source code package.  Instead, you&#8217;ll need to download them separately.  The easiest way is to download the &#8220;xemacs-sumo&#8221; package, which contains all of the official packages in a single download.  For multibyte character set support, you&#8217;ll also want the &#8220;xemacs-mule-sumo&#8221; package (mule is the emacs\/xemacs multibyte subsystem).  <\/p>\n<p>From the <a href=\"http:\/\/www.xemacs.org\/Download\/index.html\">XEmacs.org download page<\/a>, find the link to download Official Packages, and select a mirror.  You&#8217;ll end up in an FTP directory, as before.  Download the following packages into the same directory as your other downloads:<\/p>\n<pre><code>xemacs-sumo.tar.gz\nxemacs-mule-sumo.tar.gz<\/code><\/pre>\n<p>The packages can live a couple of different location, but I prefer to keep the packages directly inside the XEmacs.app application bundle.  To unpack the tarballs to the right place run the following (remember to change the path if your downloads aren&#8217;t in ~\/ext):<\/p>\n<pre><code>cd ~\/ext\/xemacs-21.5.23\/carbon\/XEmacs.app\/Contents\/Resources\/lib\/xemacs\ntar xzf ~\/ext\/xemacs-sumo.tar.gz \ntar xzf ~\/ext\/xemacs-mule-sumo.tar.gz<\/code><\/pre>\n<p>Your XEmacs.app is now fully loaded.  To move this to your Application directory, you can drag-n-drop in Finder, or just:<\/p>\n<pre><code>cd ~\/ext\/xemacs-21.5.23\/carbon\nmv XEmacs.app\/ \/Applications\/<\/code><\/pre>\n<p>Just double click the teddybear icon to launch.  If you want to see it run in a terminal window, use this (assuming you moved it to your Applications folder):<\/p>\n<pre><code>\/Applications\/XEmacs.app\/Contents\/MacOS\/XEmacs -nw<\/code><\/pre>\n<p>As additional (Carbon) patches against the same base version of xemacs are released, you can download and apply them in the same manner, so keep the directory around.  Remember to re-build the app (and copy it to Applications) after each patching.  If a new patch-bundle is release against a newer XEmacs version, just dump the old source code directory and start over from the top.<\/p>","protected":false},"excerpt":{"rendered":"<p>Update: added instructions for installing elisp packages after building. There are as many Emacsen as there are grains of sand in the desert. For various reason (largely habit) I prefer XEmacs to Emacs, when given a choice- even when in text mode (xemacs -nw for the uninitiated; I usually alias this to emacs). And while [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-osx"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}