<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Wojno: Tag port</title>
    <link>http://christopher.wojno.com/articles/tag/port</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Exploration through Code</description>
    <item>
      <title>Mac Latex-mk</title>
      <description>&lt;p&gt;I really like the LaTeX typesetting system. It makes nice looking documents. It&amp;#8217;s a bit of a pain to use, however. On FreeBSD, there is a &lt;span class="caps"&gt;LIFE&lt;/span&gt;-SAVING port called &amp;#8220;latex-mk,&amp;#8221; which is a set of &lt;em&gt;maintained&lt;/em&gt; make files that will do all the heavy-lifting for you. It&amp;#8217;s only released for FreeBSD and NetBSD, but I&amp;#8217;ll walk you through how to install it on Darwin (Mac). I make no warrantees here. You accept all responsibility for following these instructions or deviating from these instructions. I am not responsible for lost data or damaged property, etc.&lt;/p&gt;


	&lt;h1&gt;Installation&lt;/h1&gt;


	&lt;h2&gt;Getting LaTeX and latex-mk&lt;/h2&gt;


	&lt;p&gt;First, you need the latex package for Mac: &lt;a href="http://tug.org/mactex/"&gt;MacTex&lt;/a&gt;. Install that the usual way (or read their instructions if you get lost, no sense me repeating them). Once you have that installed, grab the &lt;a href="http://latex-mk.sourceforge.net/"&gt;latex-mk&lt;/a&gt; file. You&amp;#8217;ll have to dig around a big, look under &amp;#8220;Obtaining&amp;#8221; if that link still exists. You&amp;#8217;ll see a SourceForge download. Download this file:      latex-mk-1.9.1.tar.gz. I&amp;#8217;m sure these instructions will work for future versions too, though I make no guarantees.&lt;/p&gt;


	&lt;h2&gt;Uncompressing/Unarchiving&lt;/h2&gt;


	&lt;p&gt;Go ahead and unzip the latex-mk. Crack open a terminal (Finder &amp;gt; Applications &amp;gt; Utilities &amp;gt; Terminal.app). Change to the latex-mk directory:&lt;/p&gt;


&lt;pre&gt;cd ~/Downloads/latex-mk-1.9.1&lt;/pre&gt;

	&lt;p&gt;If the version has changed, cd to that. Remember, you must unzip it first. Apple&amp;#8217;s archiver should handle it. But you can always do a &amp;#8220;tar -xzf latex-mk-1.9.1.tar.gz&amp;#8221; if you&amp;#8217;re old fashioned like me.&lt;/p&gt;


	&lt;h2&gt;Configuration&lt;/h2&gt;


	&lt;p&gt;Like most packages, you need to run the configuration program. Do this from the latex-mk-1.9.1 directory (you should still be there).&lt;/p&gt;


&lt;pre&gt;sh ./configure&lt;/pre&gt;

	&lt;p&gt;You will see lots of text fly by. If you get errors, sorry, this tutorial is over. Drop me a line, maybe I&amp;#8217;ll be able to help or point you in the right direction. If you see it create lots of little files, then you&amp;#8217;re golden.&lt;/p&gt;


	&lt;h2&gt;Compile&lt;/h2&gt;


	&lt;p&gt;Type:&lt;/p&gt;


&lt;pre&gt;make&lt;/pre&gt;

	&lt;p&gt;And, after a very short time, it will complete.&lt;/p&gt;


	&lt;h2&gt;Install&lt;/h2&gt;


	&lt;p&gt;Type&lt;/p&gt;


&lt;pre&gt;sudo make install&lt;/pre&gt;

	&lt;p&gt;Sudo will ask for an administrator&amp;#8217;s password. Enter it. If you don&amp;#8217;t trust this package, you can always install by hand&amp;#8230; But I&amp;#8217;m not going over that. Once this is done, latex-mk is now installed and ready for use.&lt;/p&gt;


	&lt;h2&gt;Cleaning up&lt;/h2&gt;


	&lt;p&gt;Type:&lt;/p&gt;


&lt;pre&gt;make clean distclean&lt;/pre&gt;

	&lt;p&gt;That will remove any installation files. You may also simply delete the latex-mk-1.9.1 folder. You should delete the zip file from which you got the latex-mk-1.9.1 folder; you no longer need it.&lt;/p&gt;


	&lt;h3&gt;Testing&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s take it for a spin. Assuming you have MacTex installed already:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Create a new folder somewhere, I&amp;#8217;ll call it: &amp;#8220;Test&amp;#8221; &lt;/li&gt;
		&lt;li&gt;cd to &amp;#8220;Test&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Create a new latex document, say, &amp;#8220;test.tex&amp;#8221; and type or copy in the following:&lt;/li&gt;
	&lt;/ul&gt;


&lt;pre&gt;%test.tex:
\documentclass[]{article}
\begin{document}
\LaTeX
\end{document}
&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Now create a new file called &amp;#8220;Makefile&amp;#8221; and put the following into it:&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;#Makefile
NAME = test
TEXSRCS = test.tex
BIBTEXSRCS = 
TGIFDIRS = tgif_figs

include /usr/local/share/latex-mk/latex.gmk
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;At the command prompt, type: &amp;#8220;make pdf&amp;#8221;&lt;/li&gt;
&lt;li&gt;You&amp;#8217;ll see it build the file. When it finishes, open finder and go to your &amp;#8220;Test&amp;#8221; folder. You&amp;#8217;ll see a shiny new &amp;#8220;Test.pdf&amp;#8221; so go ahead, click it! You&amp;#8217;ll see the strangely formatted LaTeX logo.&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Congratulations. You just &amp;#8220;ported&amp;#8221; a FreeBSD application to Mac. Aren&amp;#8217;t command line applications grand?&lt;/p&gt;


	&lt;h1&gt;Why Latex-mk?&lt;/h1&gt;


	&lt;p&gt;Latex-mk takes care of lots of details when creating LaTeX documents. It keeps your bibliography up to date automatically and will re-run the latex processor to ensure all your citations and cross references are up to date and shiny. Otherwise, you have to run latex 2-3 time every change to ensure your references will be linked. Your new friend is &amp;#8220;make pdf&amp;#8221; as it enables one-stop generation shopping.&lt;/p&gt;


	&lt;h2&gt;More Information&lt;/h2&gt;


	&lt;p&gt;The make file can do much more. You should see what it can do by going to the &lt;a href="http://latex-mk.sourceforge.net"&gt;latex-mk site&lt;/a&gt; for instructions.&lt;/p&gt;</description>
      <pubDate>Sun, 30 Dec 2007 11:27:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4edcce25-e0eb-4085-9e32-59bc7c43b6d0</guid>
      <author>Christopher Wojno</author>
      <link>http://christopher.wojno.com/articles/2007/12/30/mac-latex-mk</link>
      <category>How-Tos</category>
      <category>freebsd</category>
      <category>port</category>
      <category>mac</category>
      <category>latex</category>
      <category>makefile</category>
      <category>mk</category>
    </item>
    <item>
      <title>X11R6-R7 Upgrade Problem: elf_load_section: truncated ELF file</title>
      <description>&lt;h1&gt;The Problem&lt;/h1&gt;


	&lt;p&gt;I attempted to update &lt;span class="caps"&gt;X11&lt;/span&gt; from &lt;span class="caps"&gt;X11R6&lt;/span&gt;.7 to &lt;span class="caps"&gt;X11R7&lt;/span&gt;.3 about a month ago. However, I was not successful and after getting this cryptic message when running startxfce4:&lt;/p&gt;


&lt;pre&gt;elf_load_section: truncated ELF file
Abort&lt;/pre&gt;

	&lt;p&gt;Launching startx yields that same message repeated six times. Oddly enough, launching X worked and also had two truncated &lt;span class="caps"&gt;ELF&lt;/span&gt; files (or the same one repeated). So, X worked, despite the inability to read a few files. I was confounded to say the least.&lt;/p&gt;


	&lt;p&gt;I spent hours, which lead to days trying to find what &lt;span class="caps"&gt;ELF&lt;/span&gt; file was truncated. Google searches and digging through help forums turned up nothing. I did:&lt;/p&gt;


&lt;pre&gt;pkg_delete -rx ".*xorg.*" 
pkg_delete -rx ".*font-.*"&lt;/pre&gt;

	&lt;p&gt;(deleted everything xorg and that which depended on it), then reinstalled xorg (/usr/ports/x11/xorg) to no avail. I even updated from FreeBSD-6.1-RELEASE to FreeBSD-6.2-RELEASE.&lt;/p&gt;


	&lt;p&gt;As of today, I have resolved the problem and I almost lost my mind when I discovered that xinit, a critical component of startx (startx is invoked by startxfce4), was not even installed. Keep in mind, I was getting this error before I deinstalled everything, so I did not deinstall it inadventently and send myself on a wild goose chase.&lt;/p&gt;


	&lt;p&gt;I assume the port maintainers moved this component out of the xorg port for some reason when they went from &lt;span class="caps"&gt;X11R6&lt;/span&gt;.9 to R7.2. Indeed, the &lt;a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/x11/xinit/distinfo"&gt;dist file&lt;/a&gt; for the port xinit supports that conjecture.&lt;/p&gt;


	&lt;h1&gt;In Summary&lt;/h1&gt;


	&lt;p&gt;Simply &lt;span class="caps"&gt;INSTALL&lt;/span&gt;: /usr/ports/x11/xinit and you&amp;#8217;ll be able to use &lt;span class="caps"&gt;X11&lt;/span&gt; again. You need not deleted everything. Oh, please be sure you updated according to the /usr/ports/UPDATING file&amp;#8217;s directions. &lt;span class="caps"&gt;X11&lt;/span&gt; upgrades have always required special treatment (this one&amp;#8217;s no different).&lt;/p&gt;


	&lt;p&gt;Best of luck to you.&lt;/p&gt;</description>
      <pubDate>Sat, 17 Nov 2007 21:09:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4a596106-27c5-43de-bcbf-578c6754c13b</guid>
      <author>Christopher Wojno</author>
      <link>http://christopher.wojno.com/articles/2007/11/17/x11r6-r7-upgrade-problem-elf_load_section-truncated-elf-file</link>
      <category>How-Tos</category>
      <category>freebsd</category>
      <category>file</category>
      <category>ELF</category>
      <category>truncated</category>
      <category>xinit</category>
      <category>X11</category>
      <category>update</category>
      <category>port</category>
    </item>
  </channel>
</rss>
