mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-22 23:54:00 +08:00
Split ocaml out
This commit is contained in:
parent
89646983ab
commit
79e7296b63
|
@ -184,15 +184,6 @@ pl_haskell_sources[] = {
|
|||
},
|
||||
|
||||
|
||||
/**
|
||||
* @time 2023-09-15 更新
|
||||
*/
|
||||
pl_ocaml_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git"}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -733,7 +724,6 @@ wr_tex_sources[] = {
|
|||
|
||||
def_sources_n(pl_clojure);
|
||||
def_sources_n(pl_dotnet); def_sources_n(pl_dart); def_sources_n(pl_haskell);
|
||||
def_sources_n(pl_ocaml);
|
||||
def_sources_n(pl_r); def_sources_n(pl_julia);
|
||||
|
||||
def_sources_n(os_ubuntu); def_sources_n(os_mint);
|
||||
|
|
40
src/chsrc.c
40
src/chsrc.c
|
@ -175,45 +175,7 @@ pl_haskell_setsrc (char *option)
|
|||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
pl_ocaml_check_cmd ()
|
||||
{
|
||||
chsrc_ensure_program ("opam");
|
||||
}
|
||||
|
||||
void
|
||||
pl_ocaml_getsrc(char *option)
|
||||
{
|
||||
pl_ocaml_check_cmd ();
|
||||
chsrc_run ("opam repo get-url default", RunOpt_Default);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考: https://mirrors.sjtug.sjtu.edu.cn/docs/git/opam-repository.git
|
||||
*/
|
||||
void
|
||||
pl_ocaml_setsrc(char *option)
|
||||
{
|
||||
pl_ocaml_check_cmd ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (pl_ocaml);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *cmd = xy_strjoin (3, "opam repo set-url default ",
|
||||
source.url,
|
||||
" --all --set-default");
|
||||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_note2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
|
||||
puts (xy_2strjoin ("opam init default ", source.url));
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeSemiAuto);
|
||||
}
|
||||
|
||||
|
||||
#include "recipe/lang/ocaml.c"
|
||||
|
||||
void
|
||||
pl_r_getsrc (char *option)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* ------------------------------------------------------------*/
|
||||
|
||||
/* Begin Target Matrix */
|
||||
def_target(pl_dart); def_target(pl_ocaml);
|
||||
def_target(pl_dart);
|
||||
def_target(pl_r); def_target(pl_julia);
|
||||
def_target_noget (pl_clojure);
|
||||
def_target_noget (pl_dotnet);
|
||||
|
|
58
src/recipe/lang/ocaml.c
Normal file
58
src/recipe/lang/ocaml.c
Normal file
|
@ -0,0 +1,58 @@
|
|||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* Created on : <2023-09-15>
|
||||
* Last modified : <2024-08-15>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @time 2023-09-15 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
pl_ocaml_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git"}
|
||||
};
|
||||
def_sources_n(pl_ocaml);
|
||||
|
||||
|
||||
void
|
||||
pl_ocaml_check_cmd ()
|
||||
{
|
||||
chsrc_ensure_program ("opam");
|
||||
}
|
||||
|
||||
void
|
||||
pl_ocaml_getsrc(char *option)
|
||||
{
|
||||
pl_ocaml_check_cmd ();
|
||||
chsrc_run ("opam repo get-url default", RunOpt_Default);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考: https://mirrors.sjtug.sjtu.edu.cn/docs/git/opam-repository.git
|
||||
*/
|
||||
void
|
||||
pl_ocaml_setsrc(char *option)
|
||||
{
|
||||
pl_ocaml_check_cmd ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (pl_ocaml);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *cmd = xy_strjoin (3, "opam repo set-url default ",
|
||||
source.url,
|
||||
" --all --set-default");
|
||||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_note2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
|
||||
puts (xy_2strjoin ("opam init default ", source.url));
|
||||
|
||||
chsrc_say_lastly (&source, ChsrcTypeSemiAuto);
|
||||
}
|
||||
|
||||
def_target(pl_ocaml);
|
Loading…
Reference in New Issue
Block a user