ocaml-cross / opam-cross-android

An OCaml cross-toolchain for Android and several useful libraries
105 stars 15 forks source link

creating ppx_deriving_protobuf-android.2.5 #35

Closed mryau closed 7 years ago

mryau commented 7 years ago

For my previous cross-compiler suite I simply changed your pkg/build.ml:

...
let ocamlbuild =
  "ocamlbuild -use-ocamlfind -ocamlc '-toolchain arm ocamlc' -ocamldep '-toolchain arm ocamldep' -ocamlopt '-toolchain arm ocamlopt' -classic-display -plugin-tag 'package(cppo_ocamlbuild)'"
...

For new version I tried to follow your instructions for topkg based packages in README.md, but pkg/build.ml doesn't understand "--toolchain android" arguments, so I changed opam file:

build: [
  "env" "OCAMLFIND_TOOLCHAIN=android" "ocaml" "pkg/build.ml" "native=%{ocaml-native}%"
                         "native-dynlink=%{ocaml-native-dynlink}%"
]

But it does not enough to cross-compile package:

[ppx_deriving_protobuf-android: env ocaml] Command started
+ env "OCAMLFIND_TOOLCHAIN=android" "ocaml" "pkg/build.ml" "native=true" "native-dynlink=true" (CWD=/home/ssp/.opam/4.04.0+32bit/build/ppx_deriving_protobuf-android.2.5)
- ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package cppo_ocamlbuild myocamlbuild.ml /home/ssp/.opam/4.04.0+32bit/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
- + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package cppo_ocamlbuild myocamlbuild.ml /home/ssp/.opam/4.04.0+32bit/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
- ocamlfind: Package `ocamlbuild' not found
- Command exited with code 2.

How you will recomend to prepare this package to cross-compilation? Should I add remove section to opam file too?

mryau commented 7 years ago

Ported. Thanks to your ppx_deriving-android and documentation for topkg :)