Table of Contents
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.
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.mkThis file contains some basic definitions, for example the name of the C compiler.
mk/bsd.prefs.mkInsert 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.mkThis 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/platform/MyOS.pkg.distThis file contains a list of directories,
together with their permission bits and ownership. These
directories will be created automatically with every package
that explicitly sets USE_MTREE. This feature will
be removed.
mk/platform/MyOS.x11.distJust copy one of the pre-existing x11.dist files
to your
.MyOS.x11.dist
mk/tools/bootstrap.mkOn some operating systems, the tools that are provided with the base system are not good enough for pkgsrc. For example, there are many versions of sed(1) that have a narrow limit on the line length they can process. Therefore pkgsrc brings its own tools, which can be enabled here.
mk/tools/tools.MyOS.mkThis 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.