| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | <!-- $NetBSD: creating.xml,v 1.31 2019/08/25 17:11:00 brook Exp $ --> | | 1 | <!-- $NetBSD: creating.xml,v 1.32 2019/08/30 22:19:37 gutteridge Exp $ --> |
2 | | | 2 | |
3 | <chapter id="creating"> | | 3 | <chapter id="creating"> |
4 | <title>Creating a new pkgsrc package from scratch</title> | | 4 | <title>Creating a new pkgsrc package from scratch</title> |
5 | | | 5 | |
6 | <para>When you find a package that is not yet in pkgsrc, you | | 6 | <para>When you find a package that is not yet in pkgsrc, you |
7 | most likely have a URL from where you can download the source | | 7 | most likely have a URL from where you can download the source |
8 | code. Starting with this URL, creating a package involves only a | | 8 | code. Starting with this URL, creating a package involves only a |
9 | few steps.</para> | | 9 | few steps.</para> |
10 | | | 10 | |
11 | <procedure> | | 11 | <procedure> |
12 | | | 12 | |
13 | <step><para>First, install the packages <filename | | 13 | <step><para>First, install the packages <filename |
14 | role="pkg">pkgtools/url2pkg</filename> and <filename | | 14 | role="pkg">pkgtools/url2pkg</filename> and <filename |
| @@ -26,27 +26,28 @@ you for a URL. Enter the URL of the dist | | | @@ -26,27 +26,28 @@ you for a URL. Enter the URL of the dist |
26 | of your package are created automatically. The distribution file is | | 26 | of your package are created automatically. The distribution file is |
27 | extracted automatically to fill in some details in the | | 27 | extracted automatically to fill in some details in the |
28 | <filename>Makefile</filename> that would otherwise have to be done | | 28 | <filename>Makefile</filename> that would otherwise have to be done |
29 | manually.</para></step> | | 29 | manually.</para></step> |
30 | | | 30 | |
31 | <step><para>Examine the extracted files to determine the dependencies of | | 31 | <step><para>Examine the extracted files to determine the dependencies of |
32 | your package. Ideally, this is mentioned in some | | 32 | your package. Ideally, this is mentioned in some |
33 | <filename>README</filename> file, but things may differ. For each of | | 33 | <filename>README</filename> file, but things may differ. For each of |
34 | these dependencies, look where it exists in pkgsrc, and if there is a | | 34 | these dependencies, look where it exists in pkgsrc, and if there is a |
35 | file called <filename>buildlink3.mk</filename> in that directory, add a | | 35 | file called <filename>buildlink3.mk</filename> in that directory, add a |
36 | line to your package <filename>Makefile</filename> which includes that | | 36 | line to your package <filename>Makefile</filename> which includes that |
37 | file just before the last line. If the | | 37 | file just before the last line. If the |
38 | <filename>buildlink3.mk</filename> file does not exist, it must be | | 38 | <filename>buildlink3.mk</filename> file does not exist, it must be |
39 | created first. The <filename>buildlink3.mk</filename> file makes sure that the package's include files and libraries are provided.</para> | | 39 | created first. The <filename>buildlink3.mk</filename> file makes sure |
| | | 40 | that the package's include files and libraries are provided.</para> |
40 | | | 41 | |
41 | <para>If you just need binaries from a package, add a | | 42 | <para>If you just need binaries from a package, add a |
42 | <varname>DEPENDS</varname> line to the Makefile, which specifies the | | 43 | <varname>DEPENDS</varname> line to the Makefile, which specifies the |
43 | version of the dependency and where it can be found in pkgsrc. This line | | 44 | version of the dependency and where it can be found in pkgsrc. This line |
44 | should be placed in the third paragraph. If the dependency is only | | 45 | should be placed in the third paragraph. If the dependency is only |
45 | needed for building the package, but not when using it, use | | 46 | needed for building the package, but not when using it, use |
46 | <varname>TOOL_DEPENDS</varname> or <varname>BUILD_DEPENDS</varname> | | 47 | <varname>TOOL_DEPENDS</varname> or <varname>BUILD_DEPENDS</varname> |
47 | instead of <varname>DEPENDS</varname>. | | 48 | instead of <varname>DEPENDS</varname>. |
48 | The difference between <varname>TOOL_DEPENDS</varname> and | | 49 | The difference between <varname>TOOL_DEPENDS</varname> and |
49 | <varname>BUILD_DEPENDS</varname> occurs when cross-compiling: | | 50 | <varname>BUILD_DEPENDS</varname> occurs when cross-compiling: |
50 | <varname>TOOL_DEPENDS</varname> are <emphasis>native</emphasis> | | 51 | <varname>TOOL_DEPENDS</varname> are <emphasis>native</emphasis> |
51 | packages, i.e. packages for the architecture where the package | | 52 | packages, i.e. packages for the architecture where the package |
52 | is built; | | 53 | is built; |