summaryrefslogtreecommitdiff
path: root/doc/guide/files/porting.xml
blob: de04fe419ba629eee6bee81efe0727d3c13d27dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!-- $NetBSD: porting.xml,v 1.7 2021/11/30 10:00:05 jperkin 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>OPSYS_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/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>

</chapter>