summaryrefslogtreecommitdiff
path: root/README.org
blob: f9228860faae0911db999cd85451211597b0c9aa (plain) (blame)
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
#+TITLE: zup

* What

~Zup~ is a [[https://ziglang.org][Zig]] language version manager (Zig-UPdater).

* Requirements

** System libraries

- libarchive
- libressl

** Zig version

You need at least Zig 0.10.0 to compile zup, if your system package manager does not have a high
enough version of Zig, you can download a precompiled tarball from [[https://ziglang.org/download/]]
and use the ~zig~ binary from it manually.  In general, any zup version should be able to install a
newer (hopefully the newest!) Zig version that should enable you to compile the newest zup.

| Zig version | zup version |
|-------------+-------------|
| 0.10.0      | 0.2.0       |
| master      | main        |

* How

** Compiling & installing

#+begin_src shell
  git clone --recursive https://git.sr.ht/~ukko/zup
  cd zup
  zig build -Drelease-safe -p ~/.local
#+end_src

** Using

Sample usage:

#+begin_src shell
  zup install master # Installs the master version of zig
  zup switch master # Actually use it
#+end_src

For more information, refer to ~zup help~.  ~Zup~ currently installs stuff internally to
~$XDG_DATA_HOME/zup~ (if ~XDG_DATA_HOME~ is not set, ~~/.local/share~ is used).  ~zup switch~
symlinks the current binary into ~~/.local/bin~ (currently not configurable).

* Configuration

Configuration file goes in ~/etc/xdg/zup/zup.json~, ~~/.config/zup/zup.json~, or any of the magical
~XDG_CONFIG_...~ locations.  (In the future zup might support some more human-friendly format like
TOML or YAML.)  Multiple different configs get read in order, the user-specific configuration file
coming in last.

A configuration file should be a single JSON object, the following keys are supported:

- ~supported_targets~ :: An array of targets your machine supports running in addition to the native
  architecture.  The running native architecture will be preferred when installing and then the
  targets listed in this array (earlier in the array -- higher priority).  If this value is set in
  multiple configuration files, the values get concatenated.

  Examples:

  #+begin_src json
    "supported_targets": [
        "x86_64-linux",
        "i386-linux"
    ]
  #+end_src

  #+begin_src json
    "supported_targets": [
        "aarch64-macos",
        "x86_64-macos"
    ]
  #+end_src

** Example configuration file

#+begin_src json
  {
      "supported_targets": [
          "x86_64-linux",
          "i386-linux"
      ]
  }
#+end_src