首页 > 解决方案 > Installing Racket Packages without installing Dr Racket

问题描述

I am running a minimal install of Racket and wish to install the sql package. If I try the command:

raco pkg install sql

I am prompted to install racket-doc, which has a dependency on drracket. I would rather not install the whole IDE, as I have space constraints on my application.

I have also tried the --no-docs flag, which did not have an effect on raco's behavior as far as I can tell.

Thanks!

标签: packageracketpackage-managers

解决方案


--no-docs means it will not setup documentation, but it is still a dependency!

Note however that sql's info.rkt indicates racket-doc as a built-deps. That means if you install a binary package from the built-package catalog, racket-doc will no longer be a dependency.

For Racket 7.6 (current version as of writing) and before:

(Note: this solution is due to Jack Firth)

As a first step, we need to add the built-package catalog to the list of catalogs that raco pkg will use by default. This could be done by:

$ raco pkg config --set catalogs \
    "https://download.racket-lang.org/releases/7.6/catalog/" \
    "https://pkg-build.racket-lang.org/server/built/catalog/" \
    "https://pkgs.racket-lang.org" \
    "https://planet-compats.racket-lang.org"

(assuming you are using Racket 7.6)

Then, install binary sql:

$ raco pkg install --binary sql

For Racket with version after 7.6

Simply run:

$ raco pkg install \
    --catalog "https://pkgs.racket-lang.org" \ 
    --catalog "https://pkg-build.racket-lang.org/server/built/catalog/" \
    --binary sql

推荐阅读