pkgsrc/doc/guide/files/porting.xml

81 lines
3.3 KiB
XML

<!-- $NetBSD: porting.xml,v 1.4 2007/04/19 16:54:58 joerg Exp $ -->
<chapter id="porting"> <?dbhtml filename="porting.html"?>
<title>Porting pkgsrc</title>
<para>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.</para>
<sect1 id="porting.opsys">
<title>Porting pkgsrc to a new operating system</title>
<para>To port pkgsrc to a new operating system (called
<literal>MyOS</literal> in this example), you need to touch the
following files:</para>
<variablelist>
<varlistentry><term><filename>pkgtools/bootstrap-mk-files/files/mods/<replaceable>MyOS</replaceable>.sys.mk</filename></term>
<listitem><para>This file contains some basic definitions, for
example the name of the C
compiler.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/bsd.prefs.mk</filename></term>
<listitem><para>Insert code that defines the variables
<varname>OPSYS</varname>, <varname>OS_VERSION</varname>,
<varname>LOWER_OS_VERSION</varname>,
<varname>LOWER_VENDOR</varname>,
<varname>MACHINE_ARCH</varname>, <varname>OBJECT_FMT</varname>,
<varname>APPEND_ELF</varname>, and the other variables that
appear in this file.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/platform/<replaceable>MyOS</replaceable>.mk</filename></term>
<listitem><para>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.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/platform/<replaceable>MyOS</replaceable>.pkg.dist</filename></term>
<listitem><para>This 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 <varname>USE_MTREE</varname>. This feature will
be removed.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/platform/<replaceable>MyOS</replaceable>.x11.dist</filename></term>
<listitem><para>Just copy one of the pre-existing x11.dist files
to your
<filename><replaceable>MyOS</replaceable>.x11.dist</filename>.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/tools/bootstrap.mk</filename></term>
<listitem><para>On 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 &man.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.</para></listitem></varlistentry>
<varlistentry><term><filename>mk/tools/tools.<replaceable>MyOS</replaceable>.mk</filename></term>
<listitem><para>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.</para></listitem></varlistentry>
</variablelist>
<para>Now, you should be able to build some basic packages, like
<filename role="pkg">lang/perl5</filename>, <filename
role="pkg">shells/bash</filename>.</para>
</sect1>
<sect1 id="porting.compiler">
<title>Adding support for a new compiler</title>
<para>TODO</para>
</sect1>
</chapter>