fd00 / yacp

Yet Another Cygwin Ports
MIT License
109 stars 58 forks source link

Patch to support ocaml bindings in hivex-1.3.18-1bl1.cygport #26

Closed sdaau closed 4 years ago

sdaau commented 4 years ago

I've tried the cygport build from here:

https://github.com/fd00/yacp/tree/master/hivex

... and after installing a bunch of missing libraries, everything compiled, but the package step failed with:

...
Preparing debuginfo source files:
        26 files
>>> Packaging hivex-1.3.18-1bl1.x86_64
>>> Creating binary package(s)
>>> hivex-1.3.18-1bl1.tar.xz
usr/bin/hivexget
usr/bin/hivexml.exe
...
>>> hivex-debuginfo-1.3.18-1bl1.tar.xz
usr/lib/debug/
usr/lib/debug/usr/
...
usr/src/debug/hivex-1.3.18-1bl1/xml/
usr/src/debug/hivex-1.3.18-1bl1/xml/hivexml.c
>>> Checking packages for missing or duplicate files
*** Warning: Packages are missing files:
-usr/lib/ocaml/hivex/META
-usr/lib/ocaml/hivex/hivex.cmi
-usr/lib/ocaml/hivex/hivex.cmx
-usr/lib/ocaml/hivex/hivex.mli
-usr/lib/ocaml/hivex/libmlhivex.a
-usr/lib/ocaml/hivex/mlhivex.a
-usr/lib/ocaml/hivex/mlhivex.cma
-usr/lib/ocaml/hivex/mlhivex.cmxa
-usr/lib/ocaml/stublibs/dllmlhivex.so
-usr/lib/ocaml/stublibs/dllmlhivex.so.owner
*** ERROR: Packages are missing files:

So, apparently, by default, it build ocaml bindings on my system (probably because the configure found relevant libraries); but that couldn't be packaged.

It turns out, we can just add directives in the .cygport file, so that these files are added to a new package, ocaml-hivex. The patch is attached: hivex-1.3.18-1bl1.cygport.ocaml.patch.txt - and since it is small, I'm also pasting it inline:

--- hivex-1.3.18-1bl1.cygport.orig  2020-03-22 09:29:49.693831400 +0100
+++ hivex-1.3.18-1bl1.cygport   2020-03-22 09:18:37.506292500 +0100
@@ -31,6 +31,7 @@
    lib${PN}0
    lib${PN}-devel
    python2-${PN}
+   ocaml-${PN}
 "
 hivex_CONTENTS="
    usr/bin/${PN}*
@@ -50,7 +51,11 @@
 python2_hivex_CONTENTS="
    usr/lib/python*
 "
+ocaml_hivex_CONTENTS="
+   usr/lib/ocaml*
+"
 hivex_SUMMARY="${SUMMARY} (utilities)"
 libhivex0_SUMMARY="${SUMMARY} (runtime)"
 libhivex_devel_SUMMARY="${SUMMARY} (development)"
 python2_hivex_SUMMARY="${SUMMARY} (python2 bindings)"
+ocaml_hivex_SUMMARY="${SUMMARY} (ocaml bindings)"