批里批里 (゜-゜)つ🍺 干杯|

七つ一旋桜

园龄:4年2个月粉丝:6关注:3

2022-08-06 10:50阅读: 796评论: 0推荐: 1

GHCup安装haskell开发环境

使用ghcup安装haskell

详细参考如下

GHCup 源使用帮助 — USTC Mirror Help 文档

windows:

# Windows 用户:以非管理员身份在 PowerShell 中运行如下命令
$env:BOOTSTRAP_HASKELL_YAML = 'https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.6.yaml'
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://mirrors.ustc.edu.cn/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true

配置 GHCup 使用科大源。编辑 ~/.ghcup/config.yaml 增加如下配置:

url-source:
    OwnSource: https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.6.yaml

配置 Cabal 和 Stack 使用科大源,请参考文档 Hackage 源使用帮助Stackage 源使用帮助

配置Hackage源

编辑 ~/.stack/config.yaml,增加下列参数

package-indices:
- download-prefix: https://mirrors.ustc.edu.cn/hackage/
  hackage-security:
    keyids:
    - 0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d
    - 1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42
    - 280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833
    - 2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201
    - 2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3
    - 51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921
    - 772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d
    - aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9
    - fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0
    key-threshold: 3 # number of keys required

    # ignore expiration date, see https://github.com/commercialhaskell/stack/pull/4614
    ignore-expiry: true

Cabal 使用说明

  1. 执行 cabal user-config init
  2. 修改 ~/.cabal/config

找到官方仓库:

repository hackage.haskell.org
  url: http://hackage.haskell.org/
  -- secure: True
  -- root-keys:
  -- keys-threshold: 3

改为科大源:

repository mirrors.ustc.edu.cn
  url: https://mirrors.ustc.edu.cn/hackage/
  secure: True

编辑 ~/.stack/config.yaml, 根据版本的不同,增加下列配置:

setup-info-locations:
   - http://mirrors.ustc.edu.cn/stackage/stack-setup.yaml
urls:
  latest-snapshot: http://mirrors.ustc.edu.cn/stackage/snapshots.json
snapshot-location-base: http://mirrors.ustc.edu.cn/stackage/stackage-snapshots/

環境變量

[ -f "~/.ghcup/env" ] && source "~/.ghcup/env" # ghcup env

issue

libgmp缺失問題:https://www.cnblogs.com/theophania/p/install_libgmp_so.html

本文作者:七つ一旋桜

本文链接:https://www.cnblogs.com/poifa/p/16556625.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   七つ一旋桜  阅读(796)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起