I'm using the `build-env` feature for my experimental lem package <https://github.com/ocamllabs/opam-repo-dev/blob/master/packages/lem/lem.0.4.0-dev/opam#L3>. I don't know of a way to override internal variables unless the script consents.