aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: ac4b8dc964116c71a32671dfb6a64c9cefe2b938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
TeX Live for *Open*BSD
======================

Contents
--------
- [Current Release](#2024-release)
- [Running TeX Live in OpenBSD](#running-tex-live-in-openbsd)
  - [TeX Live for OpenBSD at Utah](#tex-live-for-openbsd-at-utah)
- [Installing TeX Live on OpenBSD With Ready-to-Use Binaries](#installing-tex-live-on-openbsd-with-ready-to-use-binaries)
- [Updating the Binaries Over the Course of the Year](#updating-the-binaries-over-the-course-of-the-year)
- [Package Installation and Updates](#package-installation-and-updates)
- [Building the Sources](#building-the-sources)
- [Acknowledgements](#acknowledgements)

2024 Release
------------

[Updated March 14, 2024] TeX Live for OpenBSD has just been
launched. At the time of writing, it is meant for the [2024
release of TeX Live](https://tug.org/texlive), and will
always run on both -stable and -current versions of OpenBSD.

Running TeX Live in OpenBSD
---------------------------

There are two ways of using TeX Live in OpenBSD.

1. From ports. TeX Live is available in variety of “schemes” to wit
   different sets of package collections, of which a list can be found
   on
   [openports.pl](https://openports.pl/search?file=&pkgname=texlive).[^1]

2. By installing the “native” TeX Live over the internet, as described
   on [its home page](https://tug.org/texlive). This latter method
   facilitates the installation of new packages and the updating of
   existing ones.  However, the binaries for OpenBSD are not
   currently part of the official TeX Live distribution. The reason
   for this is that the TeX Live binaries are published once a year
   while the OpenBSD system undergoes two updates a year.
   
This page provides an easy way to build one's own TeX Live binaries
for OpenBSD—either -stable or -current—through a simple script which
is nothing but an adapted version of the one used to build TeX Live
for the supported systems.[^2]

Furthermore, *TeX Live for OpenBSD* provides ready-to-use binary sets
for those who do not wish to compile their own.

In addition to the standard binaries supported by TeX Live, TeX Live
for OpenBSD provides the following:

- xindy
- LuaMetaTeX (ConTeXt)
- asymptote

biber will soon be added to this list.

### TeX Live for OpenBSD at Utah

By far the most abundant source of documentation on TeX Live builds
for a large number of systems is Nelson Beebe's work at Utah.  It can
be found here: <https://ftp.math.utah.edu/pub/texlive-utah>.

From this url, the binaries for OpenBSD are located in the
[`bin/`](https://ftp.math.utah.edu/pub/texlive-utah/bin)
subdirectory. Look for `amd64-openbsd74-utah-gcc11.tar.xz`.  At the
time or writing, this build is done with the `gcc-11` compilers, while
the one available here is made with `clang`.

Installing TeX Live on OpenBSD with ready-to-use binaries
---------------------------------------------------------

Please read first the reference page on this matter:
<https://tug.org/texlive/custom-bin.html>.

1. Requirements:
   - curl
   - gpg
   - xz
   - p5-Tk

2. Acquire `install-tl-unx.tar.gz` from CTAN as described [on this
   page](https://tug.org/texlive/acquire-netinstall.html).
   - do:
   
     ```sh
     zcat < install-tl-unx.tar.gz | tar xf -
     ```
   
   - do:  (Replace <yyyymmdd> with the actual date.)
   
     ```sh
     cd install-tl-<yyyymmdd>
     ```

3. Import the public key used to sign the archive:

   ```sh
   gpg --keyserver hkps://keys.openpgp.org --recv 1773E9248085C8C7
   ```

4. Clone this git repository and fetch the binaries:

   ```sh
   git clone https://git.sr.ht/~ralessi/texlive-openbsd
   cd texlive-openbsd
   make fetch
   ```
   or
   ```sh
   git clone https://git.robertalessi.net/texlive-openbsd
   cd texlive-openbsd
   make fetch
   ```

5. TeX Live can be installed as root or as a normal user. Make a
   decision, then do:
   
   ```sh
   cd ..
   ```
   and proceed with the installation, as per the instructions
   displayed on the terminal.

6. Post-install actions.  (What follows assumes that the installation
   has been performed as root. Adapt.)  At the end of the
   installation, the script offers to create environment
   variables. Say no, then:
   
   1. Edit root's `.profile` file and add the path to the binaries,
      like so (replace here and below `<yyyy>` with the actual year):
	  
	  ```sh
	  # insert this line:
	  TLBIN=/usr/local/texlive/<yyyy>/bin/custom
	  # modify this line like so:
	  PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:$TLBIN:/usr/local/sbin:/usr/local/bin
	  ```
	  Make sure to insert `$TLBIN` *before* `/usr/local/bin`. Then do
	  the same in other users' `.profile` files.
	 
   2. Edit `/etc/man.conf` (copy `/etc/examples/man.conf` to `/etc` if
      this file doesn't exist) and add the manpath to TL man files,
      like so:
	  
	  ```
	  manpath /usr/share/man
	  manpath /usr/X11R6/man
	  manpath /usr/local/man
	  manpath /usr/local/texlive/<yyyy>/texmf-dist/doc/man
	  ```
	  
    3. Symlink `texlive-fontconfig.conf` file to
       `/etc/fonts/conf.d/09-texlive.conf` and update the font cache:
	   
	   ```sh
	   cd /etc/fonts/conf.d
	   ln -sf /usr/local/texlive/<yyyy>/texmf-var/fonts/conf/texlive-fontconfig.conf 09-texlive.conf
	   fc-cache -fsv
	   ```

	4. Symlink `/usr/local/texlive/<yyyy>/bin/custom` to
       `/usr/local/texlive/<yyyy>/bin/amd64-openbsd`:
	   
	   ```sh
	   cd /usr/local/texlive/<yyyy>/bin/custom
	   ln -s custom amd64-openbsd
	   ```

7. Reboot and enjoy TeX Live on OpenBSD!

### All by hand
Direct link to the binaries: <https://www.ekdosis.org/texlive>.

Updating the binaries over the course of the year
-------------------------------------------------

The requirements are the same as above.  (Make sure you already have
imported the public key used to sign the archives.)

1. Go to the directory where the texlive-openbsd git repository was
   cloned, then do:

   ```sh
   git pull
   make
   ```

2. Proceed as per the instructions displayed on the terminal.

Alternatively, the direct link to the binaries provided above can be
used.

Package installation and updates
--------------------------------

To install new packages and to update already existing ones, do:

```sh
tlobsd tlmgr update --all
```

This command requires the `subversion` package.

In TeX Live for OpenBSD, `tlobsd tlmgr` replaces the standard `tlmgr`
command which is the command name of TeX Live package manager.
`tlobsd tlmgr` can be used with the exact same options and arguments as
`tlmgr`.

More information can be found [on this
page](https://tug.org/texlive/pkginstall.html) or in the [full `tlmgr`
documentation](https://tug.org/texlive/doc/tlmgr.html).

`tlobsd tlmgr` updates the links to a number of scripts that are shipped
within TeX Live and are found in the `texmf-dist/scripts/` directory.
Most of them can be invoked by users from symlinks installed along
with the usual TeX Live binaries.  As OpenBSD is not officially
supported by TeX Live, it is important to note that the standard
`tlmgr update --all` *does not update these links,* especially in the
case of scripts that come with new packages.

Users who for some reason wish to continue using `tlmgr` are advised
to update all existing links and install new links after using
`tlmgr`, like so:

```sh
tlobsd mksymlinks
```

Just as `tlobsd tlmgr`, this command requires the `subversion` package.

Building the sources
--------------------

### References
- General information: <https://tug.org/texlive/build.html>
- Building GNU CLISP for xindy:
  <https://tug.org/svn/texlive/trunk/Build/source/utils/README?view=markup>

### Requirements
- For texlive
  - git
  - gmake
  - rsync
  - subversion
  - wget
  - curl
- For context:
  - cmake
  - ninja
- For asymptote:
  - readline
  - freeglut
  - eigen3
  - py3-cson, py3-qt5 and py3-numpy (run dependencies for `xasy`)

### Getting the sources
```sh
./checkout-tl.sh
```

### Building
```sh
./tl-build.sh
```

Acknowledgements
----------------
Special thanks go to the following people for their work and kind
advice: Karl Berry, Nelson H. F. Beebe, Norbert Preining and Mojca
Miklavec.

Notes
-----
[^1]: More information on how TL is built for OpenBSD here:
    <https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/print/texlive>

[^2]: See <https://tug.org/texlive/build.html>. The `Build` script can
    be found here: <https://tug.org/svn/texlive/trunk/Build/source>.