xmake-io / xrepo

🗂️ A cross-platform C/C++ package manager based on Xmake
https://xrepo.xmake.io
Apache License 2.0
354 stars 18 forks source link

增加gitee的支持 #7

Closed wangzhankun closed 3 years ago

wangzhankun commented 3 years ago

国内访问GitHub网站速度太差,希望能够增加对gitee的支持。我这边执行了xrepo add-repo myrepo https://gitee.com/tboox/xrepo但是发现仍然使用的是GitHub的源。`xrepo install "opencv 3.4"输出如下:

note: try installing these packages (pass -y to skip confirm)?
in xmake-repo:
  -> libffi 3.3 [linux, x86_64, from:opencv,python]
  -> zlib 1.2.11 [linux, x86_64, from:opencv,python]
  -> zlib#1 1.2.11 [from:opencv]
  -> opencv 3.4.9 
please input: y (y/n)
y
  => download https://github.com/madler/zlib/archive/v1.2.11.tar.gz .. failed

we can also download these packages manually:
  - https://github.com/madler/zlib/archive/v1.2.11.tar.gz
to the local search directories: 
  - v1.2.11.tar.gz
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error: download failed!
error: execv(xmake require -j 6 --extra={system=false} "opencv 3.4") failed(255)
wangzhankun commented 3 years ago

这里有一篇文章可作参考:https://juejin.cn/post/6925303913012789256

https://github.com/wearerequired/git-mirror-action

waruqi commented 3 years ago

xrepo add-repo myrepo https://gitee.com/tboox/xrepo

仅仅只是对 xmake-repo 包仓库自身拉取切到 gitee

但是里面的包还是内部 add_urls 定义的官方源 url,这是没法切gitee的

而且还支持不了,因为里面大部分都是 tar /archive 包源,但是 gitee 有限制,所有附件以及archive包下载,必须得账号登录,然后输入验证码,才能下载。。而且附件下载还有1m大小的限制

所以根本没法用来做镜像,除非你有办法让gitee官方解除限制,反正我是没办法

另外,可以根据失败提示,走 pkg_searchdirs 设置本地搜索路径,自己手动下载好包放到对应目录下,就能直接使用

或者走 xmake --proxy 配置代理,具体看文档

waruqi commented 3 years ago

尽管 gitee 支持不了,但是可以切到 fastgit 上去加速下载,具体见:https://github.com/xmake-io/xmake/issues/1358

需要更新到 dev 版本才支持。

zp0605 commented 2 years ago

这玩意真难用,一安装就404

wangzhankun commented 2 years ago

这玩意真难用,一安装就404

现在很好啊,执行命令bash <(curl -fsSL https://xmake.io/shget.text)即可呀。脚本里面会自动根据网络进行选择下载,速度很快啊。升级的时候执行xmake update就可以速度都很快。