Chapter 26. Porting pkgsrc

Table of Contents

26.1. Porting pkgsrc to a new operating system
26.2. Adding support for a new compiler

The pkgsrc system has already been ported to many operating systems, hardware architectures and compilers. This chapter explains the necessary steps to make pkgsrc even more portable.

26.1. Porting pkgsrc to a new operating system

To port pkgsrc to a new operating system (called MyOS in this example), you need to touch the following files:

pkgtools/bootstrap-mk-files/files/mods/MyOS.sys.mk

This file contains some basic definitions, for example the name of the C compiler.

mk/bsd.prefs.mk

Insert code that defines the variables OPSYS, OS_VERSION, LOWER_OS_VERSION, LOWER_VENDOR, MACHINE_ARCH, OBJECT_FMT, APPEND_ELF, and the other variables that appear in this file.

mk/platform/MyOS.mk

This file contains the platform-specific definitions that are used by pkgsrc. Start by copying one of the other files and edit it to your needs.

mk/tools/tools.MyOS.mk

This file defines the paths to all the tools that are needed by one or the other package in pkgsrc, as well as by pkgsrc itself. Find out where these tools are on your platform and add them.

Now, you should be able to build some basic packages, like lang/perl5, shells/bash.

26.2. Adding support for a new compiler

TODO