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
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.
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
16 Rationale of relevant h2xs parameters:
17 * -P - avoids POD part in .pm - which only contains boilerplate and would need
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)
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
29 * C::Scan is not used anymore but can be installed via CPAN, should you need
30 an initial prototype for a new function
32 0.) initial package generated with following commands:
33 ######################################################
35 git clone git://anongit.freedesktop.org/xdg/xdgmime
44 cp xdgmime-source/src/xdgmime*.[ch] Xdgmime/
46 create exports.h file in Xdgmime/exports.h
48 # Note: following requires package 'libc-scan-perl'
49 # downloaded that from debian etch archive
51 h2xs -Oxan Xdgmime exports.h
53 edit Xdgmime/Xdgmime.xs
54 edit Xdgmime/lib/Xdgmime.pm
55 edit Xdgmime/Makefile (add -DHAVE_MMAP)