Go to file
Thomas Lamprecht 77017fd76b bump version to 1.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-23 16:55:07 +02:00
debian bump version to 1.1.0 2023-06-23 16:55:07 +02:00
Xdgmime update bindings 2023-05-26 19:00:11 +02:00
xdgmime-source Merge commit '73d5a30a1d93eb79761f2472c685afb8e42a8646' from upstream 2023-05-24 13:06:12 +02:00
exports.h import from svn://proxdev/server/svn//libxdgmime-perl/pmg3 2014-09-19 14:10:30 +02:00
Makefile buildsys: avoid no-pre-clean flag when building DSC 2023-06-23 16:55:07 +02:00
README add update instructions to README 2021-06-11 11:52:21 +00:00

Updating the bindings
#####################

* The upstream sources are added https://gitlab.freedesktop.org/xdg/xdgmime as
  git-subtree in xdgmime-source use git-subtree to update them

* All functions in upstream's xdgmime.h are also present as CPP defines (for
  adding XDG_PREFIX to the function name, which confuses h2xs into creating
  constant symbols for them. These constant symbols then create errors in the
  automatically generated tests.

* By running `make update-bindings` h2xs is called with the appropriate
  parameters to create a fresh xs module from xdgmime.h. Only symbols matching
  XDG_ are treated as constants (-M '^XDG'), thus avoiding the problematic
  defines.
  Rationale of relevant h2xs parameters:
  * -P - avoids POD part in .pm - which only contains boilerplate and would need
    adopting every time
  * -F -DHAVE_MMAP - simply sets the define during compilation
  * -M '^XDG_' - treat only defines starting with XDG as constants (see above)
  * -t PV - set the default constant type to PV (a.k.a. string see man perlguts)
    (fitting with the 3 XDG_ constants)

* All functions needed in the perl-module need to be added to
  Xdgmime/lib/Xdgmime.pl in the EXPORT_TAGS (and since pmg-api and others use
  them without fully qualifying them with the module name also to the EXPORT)
  array, and implemented in Xdgmime/Xdgemime.xs

* C::Scan is not used anymore but can be installed via CPAN, should you need
  an initial prototype for a new function

0.) initial package generated with following commands:
######################################################

git clone git://anongit.freedesktop.org/xdg/xdgmime


man h2xs
man perlxs
man perlxstut

h2xs -Afn Xdgmime

cp xdgmime-source/src/xdgmime*.[ch] Xdgmime/

create exports.h file in Xdgmime/exports.h

# Note: following requires package 'libc-scan-perl' 
# downloaded that from debian etch archive

h2xs -Oxan Xdgmime exports.h

edit Xdgmime/Xdgmime.xs
edit Xdgmime/lib/Xdgmime.pm
edit Xdgmime/Makefile (add -DHAVE_MMAP)