Difference between revisions of "Pkgsrc"

From NetHackWiki
Jump to navigation Jump to search
(This stub concerns pkgsrc, NetHack, and patching.)
 
(Patches: Describe all eight patches.)
Line 24: Line 24:
 
These are the patches. (The following list is from HEAD on 2 December 2006, what will become pkgsrc 2006Q4. Compared to 2006Q3, it contains a build fix for [[Linux]].)
 
These are the patches. (The following list is from HEAD on 2 December 2006, what will become pkgsrc 2006Q4. Compared to 2006Q3, it contains a build fix for [[Linux]].)
  
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-aa?rev=1.9&content-type=text/x-cvsweb-markup patch-aa]
+
These are small portability fixes or tweaks to interface with pkgsrc. They do not add new features to the game, as most patches from the [[NetHack Patch Database]] would do. There are eight patches because pkgsrc employs one patch per file, not "diff -r" patches.
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ab?rev=1.11&content-type=text/x-cvsweb-markup patch-ab]
 
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ac?rev=1.9&content-type=text/x-cvsweb-markup opatch-ac]
 
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ad?rev=1.5&content-type=text/x-cvsweb-markup patch-ad]
 
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ae?rev=1.4&content-type=text/x-cvsweb-markup patch-ae]
 
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-af?rev=1.6&content-type=text/x-cvsweb-markup patch-af]
 
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ag?rev=1.2&content-type=text/x-cvsweb-markup patch-ag]
 
  
{{stub|Explain what the patches had to fix.}}
+
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-aa?rev=1.9&content-type=text/x-cvsweb-markup patch-aa] to [[config.h]]; makes the common configuration changes of enabling vision tables and using gzip.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ab?rev=1.11&content-type=text/x-cvsweb-markup patch-ab] to Makefile.top; mostly tweaks to permissions and the installed file hierarchy, and new targets 'binfiles' and 'datastuff' to separate nethack-lib from interface packages.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ac?rev=1.9&content-type=text/x-cvsweb-markup patch-ac] to [[system.h]]; several portability fixes discussed below.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ad?rev=1.5&content-type=text/x-cvsweb-markup patch-ad] to nethack.sh; changes to support the five-package system.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ae?rev=1.4&content-type=text/x-cvsweb-markup patch-ae] to Makefile.doc; a simple change to install the nethack(6) manual page in the same prefix as everything else.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-af?rev=1.6&content-type=text/x-cvsweb-markup patch-af] to [[unixconf.h]]; some improvements to portablity across Unix flavors; strangely, this disables ''all'' of the usual OS-specific defines.
 +
* [http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/games/nethack-lib/patches/patch-ag?rev=1.2&content-type=text/x-cvsweb-markup patch-ag] to [[mail.c]]; change a default for NetBSD systems.
 +
 
 +
{{stub|Insert portability fixes here.}}
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 02:02, 4 December 2006

This page is about how pkgsrc, the NetBSD Packages Collection, compiles and installs NetHack onto several Unix-like operating systems, by patching NetHack to be more Unix-portable.

Important: The information on this wiki page so far is the result of a study of the pkgsrc documentation and CVS repository, with no actual experience using pkgsrc. Thus this page more probably contains errors.

Introduction

The main way to install a third-party package onto NetBSD is to use pkgsrc like this:

# cd /usr/pkgsrc/games/nethack
# make install

First, this installs any necessary dependent packages. Then, this downloads the source code of the package, extracts it, patches it, configures it, builds (compiles) it, and installs it. Many BSD users know this, but pkgsrc is a fork of the FreeBSD Ports Collection, where this "cd /there && make install" idea started.

"If it works, it should work everywhere." Thus, unlike the FreeBSD Ports Collection, pkgsrc works above multiple Unix-like operating systems, the systems most compatible with NetBSD.

An interesting study is to examine the patches that pkgsrc provides, to check if Unix software required portability fixes.

NetHack

Currently pkgsrc can install NetHack 3.4.3 above Unix. This uses five packages, because pkgsrc does not support something like OpenBSD's flavors or Gentoo's USE flags. The nethack package simply depends on the nethack-qt, nethack-tty, nethack-x11 packages, so installing "nethack" gives you all three user interfaces. The three packages simply call a make target in the nethack-lib package which actually handles the NetHack sources. The end result is up to three executables sharing one playground; this differs from the typical setup of having one executable and setting the win option in NETHACKOPTIONS or a nethackrc.

Thus the nethack-lib package is responsible for patching the sources as well as installing the playground.

Patches

These are the patches. (The following list is from HEAD on 2 December 2006, what will become pkgsrc 2006Q4. Compared to 2006Q3, it contains a build fix for Linux.)

These are small portability fixes or tweaks to interface with pkgsrc. They do not add new features to the game, as most patches from the NetHack Patch Database would do. There are eight patches because pkgsrc employs one patch per file, not "diff -r" patches.

  • patch-aa to config.h; makes the common configuration changes of enabling vision tables and using gzip.
  • patch-ab to Makefile.top; mostly tweaks to permissions and the installed file hierarchy, and new targets 'binfiles' and 'datastuff' to separate nethack-lib from interface packages.
  • patch-ac to system.h; several portability fixes discussed below.
  • patch-ad to nethack.sh; changes to support the five-package system.
  • patch-ae to Makefile.doc; a simple change to install the nethack(6) manual page in the same prefix as everything else.
  • patch-af to unixconf.h; some improvements to portablity across Unix flavors; strangely, this disables all of the usual OS-specific defines.
  • patch-ag to mail.c; change a default for NetBSD systems.
This page is a stub. Should you wish to do so, you can contribute by expanding this page.

A user has suggested improving this page or section as follows:

"Insert portability fixes here."