]> git.proxmox.com Git - libxdgmime-perl.git/blame - README
buildsys: add dsc and sbuild targets
[libxdgmime-perl.git] / README
CommitLineData
72cb96ca
SI
1Updating the bindings
2#####################
3
4* The upstream sources are added https://gitlab.freedesktop.org/xdg/xdgmime as
5 git-subtree in xdgmime-source use git-subtree to update them
6
7* All functions in upstream's xdgmime.h are also present as CPP defines (for
8 adding XDG_PREFIX to the function name, which confuses h2xs into creating
9 constant symbols for them. These constant symbols then create errors in the
10 automatically generated tests.
11
12* By running `make update-bindings` h2xs is called with the appropriate
13 parameters to create a fresh xs module from xdgmime.h. Only symbols matching
14 XDG_ are treated as constants (-M '^XDG'), thus avoiding the problematic
15 defines.
16 Rationale of relevant h2xs parameters:
17 * -P - avoids POD part in .pm - which only contains boilerplate and would need
18 adopting every time
19 * -F -DHAVE_MMAP - simply sets the define during compilation
20 * -M '^XDG_' - treat only defines starting with XDG as constants (see above)
21 * -t PV - set the default constant type to PV (a.k.a. string see man perlguts)
22 (fitting with the 3 XDG_ constants)
23
24* All functions needed in the perl-module need to be added to
25 Xdgmime/lib/Xdgmime.pl in the EXPORT_TAGS (and since pmg-api and others use
26 them without fully qualifying them with the module name also to the EXPORT)
27 array, and implemented in Xdgmime/Xdgemime.xs
28
29* C::Scan is not used anymore but can be installed via CPAN, should you need
30 an initial prototype for a new function
31
a1d229d1
DM
320.) initial package generated with following commands:
33######################################################
34
35git clone git://anongit.freedesktop.org/xdg/xdgmime
36
37
38man h2xs
39man perlxs
40man perlxstut
41
42h2xs -Afn Xdgmime
43
44cp xdgmime-source/src/xdgmime*.[ch] Xdgmime/
45
46create exports.h file in Xdgmime/exports.h
47
48# Note: following requires package 'libc-scan-perl'
49# downloaded that from debian etch archive
50
51h2xs -Oxan Xdgmime exports.h
52
53edit Xdgmime/Xdgmime.xs
54edit Xdgmime/lib/Xdgmime.pm
55edit Xdgmime/Makefile (add -DHAVE_MMAP)
56