1
1
Using Source Registries
2
2
=======================
3
3
4
- Passing the name of a ".lid" file to `` dylan-compiler `` works great when you
5
- have a single library that only uses other libraries that are part of Open
4
+ Passing the name of a ".lid" file to :program: ` dylan-compiler ` works great when
5
+ you have a single library that only uses other libraries that are part of Open
6
6
Dylan, but what if you want to use a second library that you wrote yourself or
7
- that you installed from GitHub? How will `` dylan-compiler `` find the sources
8
- for that library? The answer is registries. For each Dylan library that isn't
9
- part of Open Dylan itself, you create a file in the registry that points to the
10
- ".lid" file for the library. For example, here's the registry file for
11
- hello-world, created in the previous section. Note that this assumes you are
12
- still in the directory created by `` make- dylan-app ` `::
13
-
14
- $ cat ./registry/generic /hello-world
7
+ that you installed from GitHub? How will :program: ` dylan-compiler ` find the
8
+ sources for that library? The answer is registries. For each Dylan library
9
+ that isn't part of Open Dylan itself, you create a file in the registry that
10
+ points to the ".lid" file for the library. For example, here's the registry
11
+ file for hello-world, created in the previous section. Note that this assumes
12
+ you are still in the directory created by :command: ` dylan new application `::
13
+
14
+ $ cat ./registry/{platform} /hello-world # substitute your platform
15
15
abstract://dylan/hello-world.lid
16
16
17
17
What's going on here? First of all, the registry mechanism makes it possible
18
- to have platform specific libraries. Anything platform-independent (like our
19
- hello-world example) goes under the " generic" directory. Other supported
20
- platform names are ``x86_64-freebsd ``, ``x86_64-linux ``, ``x86-win32 ``,
21
- etc. For a full list see `the Open Dylan registry
18
+ to have platform- specific libraries. Anything platform-independent can go
19
+ under the :file: ` generic ` directory. Other supported platform names are
20
+ ``x86_64-freebsd ``, ``x86_64-linux ``, ``x86-win32 ``, etc. For a full list see
21
+ `the Open Dylan registry
22
22
<https://github.com/dylan-lang/opendylan/tree/master/sources/registry> `_.
23
23
24
24
Platform-specific registry directories are searched before the
@@ -31,30 +31,30 @@ Now let's look at the actual content of our hello-world registry file::
31
31
abstract://dylan/hello-world.lid
32
32
33
33
What this is doing is locating a file *relative to the directory containing the
34
- registry directory itself *. If the " registry" directory is
34
+ registry directory itself *. If the :file: ` registry ` directory is
35
35
``/home/you/xyz/registry `` then ``abstract://dylan/hello-world.lid `` says the
36
36
hello-world ".lid" file is in ``/home/you/xyz/hello-world.lid ``.
37
37
"abstract://dylan/" is just boilerplate.
38
38
39
- When you invoke `` dylan-compiler `` in the directory ** containing ** the
39
+ When you invoke :program: ` dylan-compiler ` in the directory containing the
40
40
"registry" directory it automatically uses that registry, in addition to (and
41
41
taking precedence over) the registry in the Open Dylan installation directory.
42
42
43
43
If you prefer to invoke the compiler from elsewhere, you can set the
44
- `` OPEN_DYLAN_USER_REGISTRIES `` environment variable to point your registry
45
- directory. For example::
44
+ :envvar: ` OPEN_DYLAN_USER_REGISTRIES ` environment variable to point your
45
+ registry directory. For example::
46
46
47
47
$ export OPEN_DYLAN_USER_REGISTRIES=/home/you/xyz/registry
48
48
49
- Once you've set `` OPEN_DYLAN_USER_REGISTRIES ` ` to your new registry,
50
- `` dylan-compiler `` can find the hello-world library source no matter what
51
- directory you're currently working in. You only need to specify the library
52
- name::
49
+ Once you've set :envvar: ` OPEN_DYLAN_USER_REGISTRIES ` to your new registry,
50
+ :program: ` dylan-compiler ` can find the hello-world library source no matter
51
+ what directory you're currently working in. You only need to specify the
52
+ library name::
53
53
54
54
$ cd /tmp
55
55
$ dylan-compiler -build hello-world
56
56
57
- You can add more than one registry to `` OPEN_DYLAN_USER_REGISTRIES ` ` by
57
+ You can add more than one registry to :envvar: ` OPEN_DYLAN_USER_REGISTRIES ` by
58
58
separating them with colons (Unix) or semicolons (Windows)::
59
59
60
60
$ export OPEN_DYLAN_USER_REGISTRIES=/my/registry:/their/registry
0 commit comments