1ghc-pkg(1)                  General Commands Manual                 ghc-pkg(1)
2
3
4

NAME

6       ghc-pkg - GHC Haskell Cabal package manager
7

SYNOPSIS

9       ghc-pkg action [OPTION]...
10

DESCRIPTION

12       A  package  is a library of Haskell modules known to the compiler.  The
13       ghc-pkg tool allows adding or removing them from a package database. By
14       default,  the  system-wide  package  database is modified, but alterna‐
15       tively the user's local package database or another specified file  can
16       be used.
17
18       To  make  a  package available for ghc, ghc-pkg can be used to register
19       it.  Unregistering it removes it from the database.  Also, packages can
20       be  hidden,  to  make  ghc ignore the package by default, without unin‐
21       stalling it.  Exposing a package  makes  a  hidden  package  available.
22       Additionally,  ghc-pkg  has various commands to query the package data‐
23       base.
24
25       Where a package name is required, the package  can  be  named  in  full
26       including  the  version number (e.g.  network-1.0), or without the ver‐
27       sion number. Naming a package without the version  number  matches  all
28       versions  of  the  package; the specified action will be applied to all
29       the matching packages. A package specifier that matches all version  of
30       the package can also be written pkg-*, to make it clearer that multiple
31       packages are being matched.
32

ACTIONS

34       register filename|-
35              Register the  package  using  the  specified  installed  package
36              description.
37
38       update filename|-
39              Register  the  package,  overwriting  any other package with the
40              same name.
41
42       unregister pkg-id
43              Unregister the specified package.
44
45       expose pkg-id
46              Expose the specified package.
47
48       hide pkg-id
49              Hide the specified package
50
51       list [pkg]...
52              List registered packages in the global database,  and  also  the
53              user database if --user is given. If a package name is given all
54              the registered versions  will  be  listed  in  ascending  order.
55              Accepts the --simple-output flag.
56
57       dot    Generate  a graph of the package dependencies in a form suitable
58              for input for the graphviz tools.  For example,  to  generate  a
59              PDF of the dependency graph:
60                  dot  tred  dot -Tpdf >pkgs.pdf
61
62       find-module module
63              List  registered  packages  exposing module module in the global
64              database, and also the user database if --user is given. All the
65              registered  versions will be listed in ascending order.  Accepts
66              the --simple-output flag.
67
68       latest pkg-id
69              Prints the highest registered version of a package.
70
71       check  Check the consistency of package dependencies  and  list  broken
72              packages.  Accepts the --simple-output flag.
73
74       describe pkg
75              Give  the  registered description for the specified package. The
76              description is returned in precisely the syntax required by ghc-
77              pkg register.
78
79       field pkg field
80              Extract  the  specified field of the package description for the
81              specified package.  Accepts comma-separated multiple fields.
82
83       dump   Dump the registered description for every package. This is  like
84              ghc-pkg describe '*',  expect  that it is intended to be used by
85              tools that parse the results, rather than humans.
86
87       recache
88              Regenerate the package database cache.  This command should only
89              be  necessary if you added a package to the database by dropping
90              a file into the database directory manyally.   By  default,  the
91              global  DB  is recached; to recache a different DB use --user or
92              --package-conf as appropriate.
93

OPTIONS

95       When    asked    to    modify    a     database     (register, unregis‐
96       ter, update, hide, expose, and also check), ghc-pkg modifies the global
97       database by default.  Specifying --user causes it to act  on  the  user
98       database,  or  --package-conf  can  be  used to act on another database
99       entirely. When multiple of these options are given, the  rightmost  one
100       is used as the database to act upon.
101
102       Commands     that    query    the    package    database    (list, lat‐
103       est, describe, field) operate on the list of databases specified by the
104       flags --user, --global, and --package-conf.  If none of these flags are
105       given, the default is --global --user.
106
107       --user Use the current user's package database.
108
109       --global
110              Use the global package database.
111
112       -f FILE, --package-conf=FILE
113              Use the specified package config file.
114
115       --global-conf=FILE
116              Location of the global package config.
117
118       --force
119              Ignore missing dependencies, directories, and libraries.
120
121       --force-files
122              Ignore missing directories and libraries only.
123
124       -g, --auto-ghc-libs
125              Automatically build libs for GHCi (with register).
126
127       -?, --help
128              Display a help message and exit.
129
130       -V, --version
131              Output version information and exit.
132
133       --simple-output
134              Print output in easy-to-parse format for some commands.
135
136       --names-only
137              Only print package names, not versions; can only  be  used  with
138              list --simple-output.
139
140       --ignore-case
141              Ignore case for substring matching.
142

ENVIRONMENT VARIABLES

144       GHC_PACKAGE_PATH
145              The GHC_PACKAGE_PATH environment variable may be set to a :-sep‐
146              arated list of files containing package databases. This list  of
147              package databases is used by ghc and ghc-pkg, with earlier data‐
148              bases in the list overriding later ones. This order  was  chosen
149              to  match  the behaviour of the PATH environment variable; think
150              of it as a list of package databases that are searched  left-to-
151              right for packages.
152
153              If  GHC_PACKAGE_PATH  ends in a separator, then the default user
154              and system package databases are appended, in that  order.  e.g.
155              to  augment  the  usual  set of packages with a database of your
156              own, you could say:
157
158                   export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf:
159
160              To check whether your  GHC_PACKAGE_PATH  setting  is  doing  the
161              right thing, ghc-pkg list will list all the databases in use, in
162              the reverse order they are searched.
163

FILES

165       Both of these locations are changed for Debian.  Upstream  still  keeps
166       these  under  /usr.   Some programs may refer to that, but look in /var
167       instead.
168
169       /var/lib/ghc/package.conf
170              Global package.conf file.
171
172       /var/lib/ghc/package.conf.d/
173              Directory for library specific package.conf  files.   These  are
174              added to the global registry.
175

SEE ALSO

177       ghc(1), runghc(1), hugs(1).
178

AUTHOR

180       This  manual page was written by Kari Pahula <kaol@debian.org>, for the
181       Debian project (and may be used by others).
182
183
184
185                                  2010-01-27                        ghc-pkg(1)
Impressum