Annotation of htdocs/docs/pkgsrc/creating.html, revision 1.24
1.1 dsieger 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html>
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1.6 rillig 5: <title>Chapter 10. Creating a new pkgsrc package from scratch</title>
1.2 rillig 6: <link rel="stylesheet" href="/global.css" type="text/css">
1.1 dsieger 7: <meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
1.15 rillig 8: <link rel="home" href="index.html" title="The pkgsrc guide">
1.1 dsieger 9: <link rel="up" href="developers-guide.html" title="Part II. The pkgsrc developer's guide">
10: <link rel="prev" href="developers-guide.html" title="Part II. The pkgsrc developer's guide">
1.6 rillig 11: <link rel="next" href="components.html" title="Chapter 11. Package components - files, directories and contents">
1.1 dsieger 12: </head>
13: <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14: <div class="navheader">
15: <table width="100%" summary="Navigation header">
1.6 rillig 16: <tr><th colspan="3" align="center">Chapter 10. Creating a new pkgsrc package from scratch</th></tr>
1.1 dsieger 17: <tr>
18: <td width="20%" align="left">
19: <a accesskey="p" href="developers-guide.html">Prev</a> </td>
20: <th width="60%" align="center">Part II. The pkgsrc developer's guide</th>
21: <td width="20%" align="right"> <a accesskey="n" href="components.html">Next</a>
22: </td>
23: </tr>
24: </table>
25: <hr>
26: </div>
1.24 ! wiz 27: <div class="chapter" title="Chapter 10. Creating a new pkgsrc package from scratch">
1.1 dsieger 28: <div class="titlepage"><div><div><h2 class="title">
1.6 rillig 29: <a name="creating"></a>Chapter 10. Creating a new pkgsrc package from scratch</h2></div></div></div>
1.1 dsieger 30: <div class="toc">
31: <p><b>Table of Contents</b></p>
32: <dl>
1.6 rillig 33: <dt><span class="sect1"><a href="creating.html#creating.common">10.1. Common types of packages</a></span></dt>
1.1 dsieger 34: <dd><dl>
1.6 rillig 35: <dt><span class="sect2"><a href="creating.html#creating.perl-module">10.1.1. Perl modules</a></span></dt>
36: <dt><span class="sect2"><a href="creating.html#creating.kde-app">10.1.2. KDE applications</a></span></dt>
1.17 imil 37: <dt><span class="sect2"><a href="creating.html#creating.python-module">10.1.3. Python modules and programs</a></span></dt>
1.1 dsieger 38: </dl></dd>
1.6 rillig 39: <dt><span class="sect1"><a href="creating.html#creating.examples">10.2. Examples</a></span></dt>
40: <dd><dl><dt><span class="sect2"><a href="creating.html#creating.nvu">10.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd>
1.1 dsieger 41: </dl>
42: </div>
43: <p>When you find a package that is not yet in pkgsrc, you
44: most likely have a URL from where you can download the source
45: code. Starting with this URL, creating a package involves only a
46: few steps.</p>
1.24 ! wiz 47: <div class="procedure"><ol class="procedure" type="1">
! 48: <li class="step" title="Step 1"><p>First, install the packages <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a> and <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>.</p></li>
! 49: <li class="step" title="Step 2"><p>Then, choose one of the top-level directories as the
1.1 dsieger 50: category in which you want to place your package. You can also create a
51: directory of your own (maybe called <code class="filename">local</code>). In that
52: category directory, create another directory for your package and change
53: into it.</p></li>
1.24 ! wiz 54: <li class="step" title="Step 3"><p>Run the program <span class="command"><strong>url2pkg</strong></span>, which will ask
1.1 dsieger 55: you for a URL. Enter the URL of the distribution file (in most cases a
56: <code class="filename">.tar.gz</code> file) and watch how the basic ingredients
57: of your package are created automatically. The distribution file is
58: extracted automatically to fill in some details in the
59: <code class="filename">Makefile</code> that would otherwise have to be done
60: manually.</p></li>
1.24 ! wiz 61: <li class="step" title="Step 4">
1.1 dsieger 62: <p>Examine the extracted files to determine the dependencies of
63: your package. Ideally, this is mentioned in some
64: <code class="filename">README</code> file, but things may differ. For each of
65: these dependencies, look where it exists in pkgsrc, and if there is a
66: file called <code class="filename">buildlink3.mk</code> in that directory, add a
67: line to your package <code class="filename">Makefile</code> which includes that
68: file just before the last line. If the
69: <code class="filename">buildlink3.mk</code> file does not exist, add a
70: <code class="varname">DEPENDS</code> line to the Makefile, which specifies the
71: version of the dependency and where it can be found in pkgsrc. This line
72: should be placed in the third paragraph. If the dependency is only
73: needed for building the package, but not when using it, use
74: <code class="varname">BUILD_DEPENDS</code> instead of <code class="varname">DEPENDS</code>.
75: Your package may then look like this:</p>
76: <pre class="programlisting">
77: [...]
78:
79: BUILD_DEPENDS+= lua>=5.0:../../lang/lua
80: DEPENDS+= screen-[0-9]*:../../misc/screen
81: DEPENDS+= screen>=4.0:../../misc/screen
82:
83: [...]
84:
85: .include "../../<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>package</code></em>/buildlink3.mk"
86: .include "../../devel/glib2/buildlink3.mk"
87: .include "../../mk/bsd.pkg.mk"
88: </pre>
89: </li>
1.24 ! wiz 90: <li class="step" title="Step 5"><p>Run <span class="command"><strong>pkglint</strong></span> to see what things still need
! 91: to be done to make your package a <span class="quote">“<span class="quote">good</span>”</span> one. If you don't
1.10 hubertf 92: know what pkglint's warnings want to tell you, try <span class="command"><strong>pkglint
93: --explain</strong></span> or <span class="command"><strong>pkglint
1.1 dsieger 94: -e</strong></span>, which outputs additional
95: explanations.</p></li>
1.24 ! wiz 96: <li class="step" title="Step 6"><p>In many cases the package is not yet ready to build. You can
1.10 hubertf 97: find instructions for the most common cases in the next section, <a class="xref" href="creating.html#creating.common" title="10.1. Common types of packages">Section 10.1, “Common types of packages”</a>. After you have followed the instructions
1.1 dsieger 98: over there, you can hopefully continue here.</p></li>
1.24 ! wiz 99: <li class="step" title="Step 7"><p>Run <span class="command"><strong>bmake clean</strong></span> to clean the working
1.1 dsieger 100: directory from the extracted files. Besides these files, a lot of cache
101: files and other system information has been saved in the working
102: directory, which may become wrong after you edited the
103: <code class="filename">Makefile</code>.</p></li>
1.24 ! wiz 104: <li class="step" title="Step 8"><p>Now, run <span class="command"><strong>bmake</strong></span> to build the package. For
1.10 hubertf 105: the various things that can go wrong in this phase, consult <a class="xref" href="fixes.html" title="Chapter 19. Making your package work">Chapter 19, <i>Making your package work</i></a>.</p></li>
1.24 ! wiz 106: <li class="step" title="Step 9"><p>When the package builds fine, the next step is to install
1.10 hubertf 107: the package. Run <span class="command"><strong>bmake install</strong></span> and hope that
1.1 dsieger 108: everything works.</p></li>
1.24 ! wiz 109: <li class="step" title="Step 10"><p>Up to now, the file <code class="filename">PLIST</code>, which
1.1 dsieger 110: contains a list of the files that are installed by the package, is
1.10 hubertf 111: nearly empty. Run <span class="command"><strong>bmake print-PLIST
1.1 dsieger 112: >PLIST</strong></span> to generate a probably correct list. Check
113: the file using your preferred text editor to see if the list of
114: files looks plausible.</p></li>
1.24 ! wiz 115: <li class="step" title="Step 11"><p>Run <span class="command"><strong>pkglint</strong></span> again to see if the generated
1.1 dsieger 116: <code class="filename">PLIST</code> contains garbage or not.</p></li>
1.24 ! wiz 117: <li class="step" title="Step 12"><p>When you ran <span class="command"><strong>bmake install</strong></span>, the package
1.1 dsieger 118: has been registered in the database of installed files, but with an
1.10 hubertf 119: empty list of files. To fix this, run <span class="command"><strong>bmake deinstall</strong></span>
120: and <span class="command"><strong>bmake install</strong></span> again. Now the package is
1.1 dsieger 121: registered with the list of files from
122: <code class="filename">PLIST</code>.</p></li>
1.24 ! wiz 123: <li class="step" title="Step 13"><p>Run <span class="command"><strong>bmake package</strong></span> to create a binary
1.1 dsieger 124: package from the set of installed files.</p></li>
125: </ol></div>
1.24 ! wiz 126: <div class="sect1" title="10.1. Common types of packages">
1.1 dsieger 127: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.6 rillig 128: <a name="creating.common"></a>10.1. Common types of packages</h2></div></div></div>
1.24 ! wiz 129: <div class="sect2" title="10.1.1. Perl modules">
1.1 dsieger 130: <div class="titlepage"><div><div><h3 class="title">
1.6 rillig 131: <a name="creating.perl-module"></a>10.1.1. Perl modules</h3></div></div></div>
1.1 dsieger 132: <p>Simple Perl modules are handled automatically by
1.10 hubertf 133: <span class="command"><strong>url2pkg</strong></span>, including dependencies.</p>
1.1 dsieger 134: </div>
1.24 ! wiz 135: <div class="sect2" title="10.1.2. KDE applications">
1.1 dsieger 136: <div class="titlepage"><div><div><h3 class="title">
1.6 rillig 137: <a name="creating.kde-app"></a>10.1.2. KDE applications</h3></div></div></div>
1.1 dsieger 138: <p>KDE applications should always include
139: <code class="filename">meta-pkgs/kde3/kde3.mk</code>, which contains numerous
140: settings that are typical of KDE packages.</p>
141: </div>
1.24 ! wiz 142: <div class="sect2" title="10.1.3. Python modules and programs">
1.17 imil 143: <div class="titlepage"><div><div><h3 class="title">
144: <a name="creating.python-module"></a>10.1.3. Python modules and programs</h3></div></div></div>
145: <p>Python modules and programs packages are easily created using a
146: set of predefined variables.</p>
1.24 ! wiz 147: <p>Most Python packages use either <span class="quote">“<span class="quote">distutils</span>”</span> or
! 148: easy-setup (<span class="quote">“<span class="quote">eggs</span>”</span>).
! 149: If the software uses <span class="quote">“<span class="quote">distutils</span>”</span>, set the
! 150: <code class="varname">PYDISTUTILSPKG</code> variable to <span class="quote">“<span class="quote">yes</span>”</span> so
1.17 imil 151: pkgsrc will make use of this framework.
1.24 ! wiz 152: <span class="quote">“<span class="quote">distutils</span>”</span> uses a script called <code class="filename">setup.py</code>,
! 153: if the <span class="quote">“<span class="quote">distutils</span>”</span> driver is not called
1.17 imil 154: <code class="filename">setup.py</code>, set the <code class="varname">PYSETUP</code> variable
155: to the name of the script.</p>
156: <p>
157: If the default Python versions are not supported by the software, set the
158: <code class="varname">PYTHON_VERSIONS_ACCEPTED</code> variable to the Python versions
159: the software is known to work with, from the most recent to the older
160: one, e.g.
161: </p>
162: <pre class="programlisting">
1.23 jakllsch 163: PYTHON_VERSIONS_ACCEPTED= 25 24
1.17 imil 164: </pre>
165: <p>
166: If the packaged software is a Python module, include
1.24 ! wiz 167: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/extension.mk</code></span>”</span>.
1.17 imil 168: In this case, the package directory should be called
1.24 ! wiz 169: <span class="quote">“<span class="quote">py-software</span>”</span> and <code class="varname">PKGNAME</code> should be set to
! 170: <span class="quote">“<span class="quote">${PYPKGPREFIX}-${DISTNAME}</span>”</span>, e.g.
1.17 imil 171: </p>
172: <pre class="programlisting">
173: DISTNAME= foopymodule-1.2.10
174: PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
175: </pre>
176: <p>If it is an application, also include
1.24 ! wiz 177: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/application.mk</code></span>”</span>
! 178: before <span class="quote">“<span class="quote">extension.mk</span>”</span>.</p>
1.17 imil 179: <p>If the packaged software, either it is an application or a module, is
180: egg-aware, you only need to include
1.24 ! wiz 181: <span class="quote">“<span class="quote"><code class="filename">../../lang/python/egg.mk</code></span>”</span>.</p>
1.17 imil 182: <p>In order to correctly set the path to the Python interpreter, use the
183: <code class="varname">REPLACE_PYTHON</code> variable and set it to the list of files
184: that must be corrected. For example :
185: </p>
186: <pre class="programlisting">
187: REPLACE_PYTHON= ${WRKSRC}/*.py
188: </pre>
189: </div>
1.1 dsieger 190: </div>
1.24 ! wiz 191: <div class="sect1" title="10.2. Examples">
1.1 dsieger 192: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.6 rillig 193: <a name="creating.examples"></a>10.2. Examples</h2></div></div></div>
1.24 ! wiz 194: <div class="sect2" title="10.2.1. How the www/nvu package came into pkgsrc">
1.1 dsieger 195: <div class="titlepage"><div><div><h3 class="title">
1.6 rillig 196: <a name="creating.nvu"></a>10.2.1. How the www/nvu package came into pkgsrc</h3></div></div></div>
1.24 ! wiz 197: <div class="sect3" title="10.2.1.1. The initial package">
1.1 dsieger 198: <div class="titlepage"><div><div><h4 class="title">
1.6 rillig 199: <a name="creating.nvu.init"></a>10.2.1.1. The initial package</h4></div></div></div>
1.1 dsieger 200: <p>Looking at the file <code class="filename">pkgsrc/doc/TODO</code>, I saw
1.24 ! wiz 201: that the <span class="quote">“<span class="quote">nvu</span>”</span> package has not yet been imported into
1.1 dsieger 202: pkgsrc. As the description says it has to do with the web, the obvious
1.24 ! wiz 203: choice for the category is <span class="quote">“<span class="quote">www</span>”</span>.</p>
1.1 dsieger 204: <pre class="programlisting">
205: <code class="prompt">$</code> mkdir www/nvu
206: <code class="prompt">$</code> cd www/nvu
207: </pre>
208: <p>The web site says that the sources are available as a tar file, so
1.10 hubertf 209: I fed that URL to the <span class="command"><strong>url2pkg</strong></span> program:</p>
1.1 dsieger 210: <pre class="programlisting">
211: <code class="prompt">$</code> url2pkg http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
212: </pre>
213: <p>My editor popped up, and I added a <code class="varname">PKGNAME</code> line
214: below the <code class="varname">DISTNAME</code> line, as the package name should
1.24 ! wiz 215: not have the word <span class="quote">“<span class="quote">sources</span>”</span> in it. I also filled in the
1.1 dsieger 216: <code class="varname">MAINTAINER</code>, <code class="varname">HOMEPAGE</code> and
217: <code class="varname">COMMENT</code> fields. Then the package
218: <code class="filename">Makefile</code> looked like that:</p>
219: <pre class="programlisting">
1.2 rillig 220: # $NetBSD$
1.1 dsieger 221: #
222:
223: DISTNAME= nvu-1.0-sources
224: PKGNAME= nvu-1.0
225: CATEGORIES= www
226: MASTER_SITES= http://cvs.nvu.com/download/
227: EXTRACT_SUFX= .tar.bz2
228:
229: MAINTAINER= rillig@NetBSD.org
230: HOMEPAGE= http://cvs.nvu.com/
231: COMMENT= Web Authoring System
232:
233: # url2pkg-marker (please do not remove this line.)
234: .include "../../mk/bsd.pkg.mk"
235: </pre>
236: <p>Then, I quit the editor and watched pkgsrc downloading a large
237: source archive:</p>
238: <pre class="programlisting">
239: url2pkg> Running "make makesum" ...
240: => Required installed package digest>=20010302: digest-20060826 found
241: => Fetching nvu-1.0-sources.tar.bz2
242: Requesting http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2
243: 100% |*************************************| 28992 KB 150.77 KB/s00:00 ETA
244: 29687976 bytes retrieved in 03:12 (150.77 KB/s)
245: url2pkg> Running "make extract" ...
246: => Required installed package digest>=20010302: digest-20060826 found
247: => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2
248: => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2
249: work.bacc -> /tmp/roland/pkgsrc/www/nvu/work.bacc
250: ===> Installing dependencies for nvu-1.0
251: ===> Overriding tools for nvu-1.0
252: ===> Extracting for nvu-1.0
253: url2pkg> Adjusting the Makefile.
254:
255: Remember to correct CATEGORIES, HOMEPAGE, COMMENT, and DESCR when you're done!
256:
257: Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-)
258: </pre>
259: </div>
1.24 ! wiz 260: <div class="sect3" title="10.2.1.2. Fixing all kinds of problems to make the package work">
1.1 dsieger 261: <div class="titlepage"><div><div><h4 class="title">
1.6 rillig 262: <a name="creating.nvu.problems"></a>10.2.1.2. Fixing all kinds of problems to make the package work</h4></div></div></div>
1.1 dsieger 263: <p>Now that the package has been extracted, let's see what's inside
264: it. The package has a <code class="filename">README.txt</code>, but that only
265: says something about mozilla, so it's probably useless for seeing what
266: dependencies this package has. But since there is a GNU configure script
267: in the package, let's hope that it will complain about everything it
268: needs.</p>
269: <pre class="programlisting">
270: <code class="prompt">$</code> bmake
271: => Required installed package digest>=20010302: digest-20060826 found
272: => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2
273: => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2
274: ===> Patching for nvu-1.0
275: ===> Creating toolchain wrappers for nvu-1.0
276: ===> Configuring for nvu-1.0
277: [...]
278: configure: error: Perl 5.004 or higher is required.
279: [...]
280: WARNING: Please add USE_TOOLS+=perl to the package Makefile.
281: [...]
282: </pre>
283: <p>That worked quite well. So I opened the package Makefile in my
284: editor, and since it already has a <code class="varname">USE_TOOLS</code> line, I
1.24 ! wiz 285: just appended <span class="quote">“<span class="quote">perl</span>”</span> to it. Since the dependencies of the
1.1 dsieger 286: package have changed now, and since a perl wrapper is automatically
1.24 ! wiz 287: installed in the <span class="quote">“<span class="quote">tools</span>”</span> phase, I need to build the package
1.1 dsieger 288: from scratch.</p>
289: <pre class="programlisting">
290: <code class="prompt">$</code> bmake clean
291: ===> Cleaning for nvu-1.0
292: <code class="prompt">$</code> bmake
293: [...]
294: *** /tmp/roland/pkgsrc/www/nvu/work.bacc/.tools/bin/make is not \
295: GNU Make. You will not be able to build Mozilla without GNU Make.
296: [...]
297: </pre>
1.24 ! wiz 298: <p>So I added <span class="quote">“<span class="quote">gmake</span>”</span> to the
1.1 dsieger 299: <code class="varname">USE_TOOLS</code> line and tried again (from scratch).</p>
300: <pre class="programlisting">
301: [...]
302: checking for GTK - version >= 1.2.0... no
303: *** Could not run GTK test program, checking why...
304: [...]
305: </pre>
306: <p>Now to the other dependencies. The first question is: Where is the
307: GTK package hidden in pkgsrc?</p>
308: <pre class="programlisting">
309: <code class="prompt">$</code> echo ../../*/gtk*
310: [many packages ...]
311: <code class="prompt">$</code> echo ../../*/gtk
312: ../../x11/gtk
313: <code class="prompt">$</code> echo ../../*/gtk2
314: ../../x11/gtk2
315: <code class="prompt">$</code> echo ../../*/gtk2/bui*
316: ../../x11/gtk2/buildlink3.mk
317: </pre>
318: <p>The first try was definitely too broad. The second one had exactly
319: one result, which is very good. But there is one pitfall with GNOME
320: packages. Before GNOME 2 had been released, there were already many
321: GNOME 1 packages in pkgsrc. To be able to continue to use these
322: packages, the GNOME 2 packages were imported as separate packages, and
1.24 ! wiz 323: their names usually have a <span class="quote">“<span class="quote">2</span>”</span> appended. So I checked
1.1 dsieger 324: whether this was the case here, and indeed it was.</p>
325: <p>Since the GTK2 package has a <code class="filename">buildlink3.mk</code>
326: file, adding the dependency is very easy. I just inserted an
327: <code class="literal">.include</code> line before the last line of the package
328: <code class="filename">Makefile</code>, so that it now looks like this:</p>
329: <pre class="programlisting">
330: [...]
331: .include "../../x11/gtk2/buildlink3.mk"
332: .include "../../mk/bsd.pkg.mk
333: </pre>
1.10 hubertf 334: <p>After another <span class="command"><strong>bmake clean && bmake</strong></span>, the answer
1.1 dsieger 335: was:</p>
336: <pre class="programlisting">
337: [...]
338: checking for gtk-config... /home/roland/pkg/bin/gtk-config
339: checking for GTK - version >= 1.2.0... no
340: *** Could not run GTK test program, checking why...
341: *** The test program failed to compile or link. See the file config.log for the
342: *** exact error that occured. This usually means GTK was incorrectly installed
343: *** or that you have moved GTK since it was installed. In the latter case, you
344: *** may want to edit the gtk-config script: /home/roland/pkg/bin/gtk-config
345: configure: error: Test for GTK failed.
346: [...]
347: </pre>
1.24 ! wiz 348: <p>In this particular case, the assumption that <span class="quote">“<span class="quote">every package
! 349: prefers GNOME 2</span>”</span> had been wrong. The first of the lines above
1.1 dsieger 350: told me that this package really wanted to have the GNOME 1 version of
351: GTK. If the package had looked for GTK2, it would have looked for
1.10 hubertf 352: <span class="command"><strong>pkg-config</strong></span> instead of <span class="command"><strong>gtk-config</strong></span>.
1.1 dsieger 353: So I changed the <code class="literal">x11/gtk2</code> to
354: <code class="literal">x11/gtk</code> in the package <code class="filename">Makefile</code>,
355: and tried again.</p>
356: <pre class="programlisting">
357: [...]
358: cc -o xpidl.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" -I../../../dist/include/xpcom -I../../../dist/include -I/tmp/roland/pkgsrc/www/nvu/work.bacc/mozilla/dist/include/nspr -I/usr/X11R6/include -fPIC -DPIC -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -O2 -I/home/roland/pkg/include -I/usr/include -Dunix -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_roland -DTRACING -g -I/home/roland/pkg/include/glib/glib-1.2 -I/home/roland/pkg/lib/glib/include -I/usr/pkg/include/orbit-1.0 -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -include ../../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/xpidl.pp xpidl.c
359: In file included from xpidl.c:42:
360: xpidl.h:53:24: libIDL/IDL.h: No such file or directory
361: In file included from xpidl.c:42:
362: xpidl.h:132: error: parse error before "IDL_ns"
363: [...]
364: </pre>
365: <p>The package still does not find all of its dependencies. Now the
366: question is: Which package provides the
367: <code class="filename">libIDL/IDL.h</code> header file?</p>
368: <pre class="programlisting">
369: <code class="prompt">$</code> echo ../../*/*idl*
370: ../../devel/py-idle ../../wip/idled ../../x11/acidlaunch
371: <code class="prompt">$</code> echo ../../*/*IDL*
372: ../../net/libIDL
373: </pre>
374: <p>Let's take the one from the second try. So I included the
375: <code class="filename">../../net/libIDL/buildlink3.mk</code> file and tried
376: again. But the error didn't change. After digging through some of the
377: code, I concluded that the build process of the package was broken and
378: couldn't have ever worked, but since the Mozilla source tree is quite
379: large, I didn't want to fix it. So I added the following to the package
380: <code class="filename">Makefile</code> and tried again:</p>
381: <pre class="programlisting">
382: CPPFLAGS+= -I${BUILDLINK_PREFIX.libIDL}/include/libIDL-2.0
383: BUILDLINK_TRANSFORM+= -l:IDL:IDL-2
384: </pre>
385: <p>The latter line is needed because the package expects the library
386: <code class="filename">libIDL.so</code>, but only
387: <code class="filename">libIDL-2.so</code> is available. So I told the compiler
388: wrapper to rewrite that on the fly.</p>
389: <p>The next problem was related to a recent change of the FreeType
390: interface. I looked up in <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/seamonkey/README.html" target="_top"><code class="filename">www/seamonkey</code></a>
391: which patch files were relevant for this issue and copied them to the
392: <code class="filename">patches</code> directory. Then I retried, fixed the
393: patches so that they applied cleanly and retried again. This time,
394: everything worked.</p>
395: </div>
1.24 ! wiz 396: <div class="sect3" title="10.2.1.3. Installing the package">
1.1 dsieger 397: <div class="titlepage"><div><div><h4 class="title">
1.6 rillig 398: <a name="creating.nvu.inst"></a>10.2.1.3. Installing the package</h4></div></div></div>
1.1 dsieger 399: <pre class="programlisting">
400: <code class="prompt">$</code> bmake CHECK_FILES=no install
401: [...]
402: <code class="prompt">$</code> bmake print-PLIST >PLIST
403: <code class="prompt">$</code> bmake deinstall
404: <code class="prompt">$</code> bmake install
405: </pre>
406: </div>
407: </div>
408: </div>
409: </div>
410: <div class="navfooter">
411: <hr>
412: <table width="100%" summary="Navigation footer">
413: <tr>
414: <td width="40%" align="left">
415: <a accesskey="p" href="developers-guide.html">Prev</a> </td>
416: <td width="20%" align="center"><a accesskey="u" href="developers-guide.html">Up</a></td>
417: <td width="40%" align="right"> <a accesskey="n" href="components.html">Next</a>
418: </td>
419: </tr>
420: <tr>
421: <td width="40%" align="left" valign="top">Part II. The pkgsrc developer's guide </td>
422: <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
1.6 rillig 423: <td width="40%" align="right" valign="top"> Chapter 11. Package components - files, directories and contents</td>
1.1 dsieger 424: </tr>
425: </table>
426: </div>
427: </body>
428: </html>
CVSweb <webmaster@jp.NetBSD.org>