1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253(**************************************************************************)(* *)(* Copyright 2020 OCamlPro & Origin Labs *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)openEzcmd.TYPES(*
TODO:
* Check if the archive already exists
* if 'bin-package.version' exists, we are in a binary archive,
execute all commands.
* otherwise, check if a binary archive exists.
If no, create an empty
`bin-package.version` file to force execution of all commands.
If yes, create a directory package.cached/ containing that archive,
bin-package.version and bin-package.config.
In wrap-install, perform the installation of the archive.
*)letcmd_name="wrap-build"letactionargs=Misc.log_cmdcmd_nameargs;Misc.make_cache_dir();matchargswith|_name::_version::_depends::cmd->ifSys.file_existsGlobals.marker_source||Sys.file_existsGlobals.marker_skipthenMisc.call(Array.of_listcmd)|_->Printf.eprintf"Unexpected args: usage is '%s %s name version depends cmd...'\n%!"Globals.commandcmd_name;exit2letcmd=letargs=ref[]inArg.{cmd_name;cmd_action=(fun()->action!args);cmd_args=[[],Anons(funlist->args:=list),Ezcmd.info"args"];cmd_man=[];cmd_doc="(opam hook) Exec or not build commands";}