Contributed by dwc on from the typecasting dept.
Edd Barrett writes in with his experiences porting TEX Live to OpenBSD. TEX Live is the heir apparent to the venerable TEX typesetting system by Donald Knuth. Edd's article was originally published in TUGboat 29:2.
Porting TEX Live to OpenBSD
Abstract:The history, creation, and fruition of porting TEX Live to OpenBSD.
At the time that I became a student, I had been using *NIX systems for years, in particular an operating system called OpenBSD, which is one of the BSD1 derived open-source Unix-a-likes. OpenBSD aims to be “Free, Functional and Secure”, but it also has other qualities which made it appealing to me: it was small, it did not demand a fast computer and is developed with “correctness” in mind.
The existing WYSIWYG2 document preparation software packages for OpenBSD either did not suit the nature of the document, or did not feel natural to me as a computing student. In particular:
- Most of my assignments required source code listings. Standard procedure generally consisted of copy and pasting large chunks of code into a word processor (screen by screen if you were in a terminal appplication). It did work, but it was tedious to repeat when the sources changed.
- During my two years in industry, Vim3 had become second nature to me when editing text. In comparison a word processor seemed very limited and inefficient.
It was only when I saw what some of the members of staff at University had done with TEX that I became fully aware of its purpose. The concept of logical markup in a document felt right, and my previous gripes with word processors could be solved, not to mention that documents typeset with TEX looked a much more professional than anything I could make with a word processor. I started learning how to make documents like this myself using the existing teTEX package on my OpenBSD systems.
Oddly enough, the porting process of TEX Live started with the simple need for the rcs package in a document. I had one day decided that a verbatim CVS tag in the preface of my documents looked ugly and that I should find a solution.
A search revealed the rcs package, but it was not included in teTEX. I visited the teTEX web page to see if there was a possibility of including it in future versions. It was then that I realized that teTEX development had sadly been retired for almost a year. The web page suggested that I pursue a project called “TEX Live”, so I did. I was mostly pleased with what I saw, but found the ISO disk image distribution format inconvenient, and the DVD only supplied i386 binaries for OpenBSD, which needless to say would not work on my Sun Sparc systems.
This was when I started the porting process, after an email to the email@example.com mailing list in March 2007 to see if anyone else had been working on a port. At the time I remember thinking that this was a week's work at most. How wrong I was ...
My initial build confirmed that TEX Live was quite happy to build on OpenBSD. Now I had to integrate the build with the OpenBSD “ports” build system. The “ports” build system is basically a set of instructions (in the form of Makefiles) for building third party software, whose concept was originally devised by the FreeBSD project. NetBSD also has a similar system, as does the Gentoo Linux project. The advantage of these systems is that packages need not be manually built upon each new release of the operating system, as it can be powerfully automated.
Getting TEX Live to play nice with the ports infrastructure was not easy. A lot of the TEX Live build system did not honour the GNU standard DESTDIR environment variable, which is required to fool software into installing into a fake root filesystem ready for packaging. Luckily a tool called systrace allowed me to detect these bugs and I was able to “patch them away” before the build commenced. I applied just under 40 patches to the TEX Live build system, resulting in a package named texlive_base-2007. Following the conventions of the existing teTEX port, I made the texmf tree a separate package named texlive_texmf-2007.
On May 8 2007 I posted my hopefully “completed” work onto the porting mailing list and waited.
Responses to my work were positive, but there was concern with the size of the texmf package which had exceeded 512MB. I was asked to “trim it down”, if at all possible. The next few months proved to be the most difficult stage of the port, not only because I was studying for exams as well as porting, but also because I had uncovered some nasty bus errors in when run on the sparc64 CPU architecture. I think my housemates must have thought I was chasing a lost cause, but I was not prepared to give up.
I decided to first concentrate on splitting the texmf tree. This involved learning how the (now deprecated) “TPM”4 hierarchy worked as well as the various configuration files, so that they matched the relevant texmf subset that was installed. Norbert Preining had done a similar task for Debian Linux and generously shared what he knew. Also, a lecturer at University, Peter Knaggs, who had been using TEX for a while was able to explain some of the mechanisms of a TEX system. A Python script I called MFSplit sprang into existence. This creation split the large texmf tree into three smaller counterparts (minimal, full and documentation) and helped to generate configuration files. I must admit I found this quite challenging, even frustrating at times, and the TEX Live mailing list was a invaluable resource during times of confusion.
A major cause of the aforementioned frustration was due to the slowness of my dated Sun hardware. In an attempt to find something more practical, I placed a banner on my web page asking for hardware donations. I had expected to hear nothing. Within a few days one individual donated some money for a beer, which pleasantly shocked me, but not as much as when a company contacted me saying that they wished to donate a machine to the port! The company was yellowshift LLC, a consultancy company in America that believed in giving back to open source (https://www.yellowshift.com/giving-back). Gratefully I accepted and now I am a proud owner of a Sun Blade 1000 for development of TEX LiveOpenBSD for sparc64 systems.
As for the issues, the author and a very dedicated member of the TEX community, Jonathan Kew, helped me out greatly. It proved very difficult to debug over email, so I ended up granting him remote access to my build box in order for him to look more closely at the problem. Very quickly he put together some patches which fixed the issue (and a few others too), which were committed upstream and to the port.
On July 17 2007 the TEX Live port was committed on my behalf to the head branch of the ports tree, but not yet linked to the build as a replacement for teTEX, since further community testing was needed. Small bug fixes and cleanups were applied. Eventually, on October 11 2007, TEX Live replaced teTEX entirely for OpenBSD developer snapshots, and will certainly be included in upcoming OpenBSD-4.3. I consider this is a great personal achievement, as I had always wished I could give something back to the open source community. I have been in contact with several developers interested in developing ports of TEX Live for their operating systems, including a developer from the Macports project who succeeded in translating the OpenBSD port to their ports system. I certainly do enjoy the freedom of open source software development.
If you are running the developer branch of OpenBSD (or -current as it is known), then you can get TEX Live now from the OpenBSD FTP servers. OpenBSD 4.3 pre-orders are available now; this is a great way to help the project.
I would like to take the opportunity to thank all of the people who have answered my questions on mailing lists, donated resources, helped me bug-fix or otherwise contributed to porting TEX Live to OpenBSD. It is greatly appreciated and I hope to meet some of you at the conference in Cork.
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
The command line arguments were:
latex2html -split 0 -no_navigation tb92barrett.ltx
The translation was initiated by Edd on 2008-07-15
[Further HTML editing by me -dwc]
- Berkeley Software Distribution
- What you see is what you get
- ... Vim3
- Vi Improved, http://www.vim.org
- TEX Package Manager
Thanks to Edd for allowing us to reprint the article. Please remember to share your own experiences using OpenBSD.
(Comments are closed)