File: 0005-Adapt-SWIG-documentation-to-Debian.patch

package info (click to toggle)
numpy 1%3A2.3.4%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 86,072 kB
  • sloc: python: 255,800; asm: 232,483; ansic: 212,593; cpp: 157,465; f90: 1,575; sh: 845; fortran: 567; makefile: 431; sed: 139; xml: 109; java: 97; perl: 82; cs: 62; javascript: 53; objc: 33; lex: 13; yacc: 9
file content (46 lines) | stat: -rw-r--r-- 1,703 bytes parent folder | download | duplicates (2)
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
From: Sandro Tosi <morph@debian.org>
Date: Sun, 11 Oct 2015 10:12:18 -0700
Subject: Adapt SWIG documentation to Debian

Location of `swig` directory in Debian is specific to our distro, so the
documentation needs adaptation.

Origin: vendor
Forwarded: not-needed
Last-Update: 2021-12-19
---
 doc/source/reference/swig.interface-file.rst | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/doc/source/reference/swig.interface-file.rst b/doc/source/reference/swig.interface-file.rst
index 5d2991c..f08a516 100644
--- a/doc/source/reference/swig.interface-file.rst
+++ b/doc/source/reference/swig.interface-file.rst
@@ -166,10 +166,23 @@ assignments in lines 19 and 20.
 Using numpy.i
 -------------
 
-The ``numpy.i`` file is currently located in the ``tools/swig``
-sub-directory under the ``numpy`` installation directory.  Typically,
-you will want to copy it to the directory where you are developing
-your wrappers.
+The ``numpy.i`` file is shipped in the NumPy include directory, which can be
+found as shown in the following ``Makefile`` snippet::
+
+    NUMPY_INCLUDEDIR := $(shell pkgconf --variable=includedir numpy)/numpy
+
+    %.py %_wrap.cc: %.i
+            swig                    \
+              -I$(NUMPY_INCLUDEDIR) \
+              -py3                  \
+              -python               \
+              -c++                  \
+              -outdir .             \
+              -o $*_wrap.cc         \
+              $<
+
+So if we have a swig module ``module.i``, we can build the swig wrappers with
+``make module.py module_wrap.cc``.
 
 A simple module that only uses a single `SWIG`_ interface file should
 include the following::