summaryrefslogtreecommitdiffhomepage
path: root/README
blob: 33e7978c0794673f9c300362bb057bc97f2d0460 (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
-*- mode: org -*-
#+TITLE:       D related overlays
#+DESCRIPTION: ldc, dub, dtools: dlang compiler build tool and tools
#+FILETAGS:    :dlang:build:tools:
#+AUTHOR:      Ralph Amissah
#+EMAIL:       [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+COPYRIGHT:   Copyright (C) 2022 - 2024 Ralph Amissah
#+LANGUAGE:    en
#+STARTUP:     content hideblocks hidestars noindent entitiespretty

* README for D related dev shells with overlays
** in emacs write (tangle) this (org) file for its output

This org file: "dlang-nix-flakes.org" when using emacs and saved (tangling output)
it creates and writes output to the subdirectory path:

  ..

and writes output there, this is to prevent accidentally writing over anything
in the directory in which the dlang-nix-flakes.org file happens to be saved.

.. becomes your nix flake work directory.

** dlang-nix-flakes.org

the file dlang-nix-flakes.org contains nix related files for producing more
recent versions of the dlang compiler and build tools: ldc, dub and dtools, than
exist in nixpkgs at the time of publishing, in some cases with additional fixes.

.envrc files

nix control files
  - default.nix
  - shell.nix
  - flake.nix

nix overlays for (updates nixpkgs, more recent versions of):
  - ldc     ( 1.30.0 -> 1.38.0 )
  - dub     ( 1.23.0 -> 1.36.0 ) [for nix versions 1.31.0 ... 1.33.0 broken]
  - dtools  ( 2.095.1 -> 2.103.1 )

  - dmd     ( 2.100.2 -> 2.109.0 )
  - gdc     [not yet available]

(updates nixpkgs circa 2023-05-12)

dlang-nix-flakes.org --❯
  .
  └── dlang-nix-flakes
      ├── #default.nix
      ├── flake.lock
      ├── flake.nix
      ├── README
      ├── shell.nix
      └── nix-overlays
          ├── dmd [not working]
          │   ├── binary.nix
          │   ├── bootstrap.nix
          │   ├── default.nix
          │   └── generic.nix
          ├── dtools
          │   └── default.nix
          ├── dub
          │   └── default.nix
          └── ldc
              ├── binary.nix
              ├── bootstrap.nix
              ├── default.nix
              └── generic.nix

search nixpkgs here:

- https://search.nixos.org/packages?channel=unstable&from=0&size=100&sort=relevance&query=

** compilers
*** ldc OK ✓ ( 1.30.0 -> 1.38.0 )

- https://wiki.dlang.org/LDC

- https://github.com/ldc-developers/ldc
  - https://github.com/ldc-developers/ldc/releases
    nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.38.0.tar.gz
  - https://github.com/ldc-developers/ldc/issues

- version in nixpkgs:
  - https://search.nixos.org/packages?channel=unstable&show=ldc&from=0&size=100&sort=relevance&type=packages&query=ldc

*** dmd OK ✓ ( 2.100.2 -> 2.109.0 )

- https://dlang.org/
  - https://wiki.dlang.org/LDC

- https://github.com/dlang/dmd
  - https://github.com/dlang/dmd/tags
    nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.109.0.tar.gz
  - https://github.com/dlang/dmd/pulls

- version in nixpkgs:
  - https://search.nixos.org/packages?channel=unstable&show=dmd&from=0&size=100&sort=relevance&type=packages&query=dmd

- dmd nixpkg modified and appears to build ok, but it appears my overlay does
  not get things right REVIEW

- dmd on nixos FAILS to build (my working projects), appears not to find parts
  of itself

*** gdc ( not provided yet with gcc12 in nixpkgs )

not yet provided in nixpkgs with gcc12, no attempt made

- https://wiki.dlang.org/GDC
  - https://wiki.dlang.org/GDC_Development

- https://github.com/D-Programming-GDC/gdc

** build tool
*** dub ( 1.23.0 -> 1.36.0 )

- https://code.dlang.org/packages/dub

- https://github.com/dlang/dub
  - https://github.com/dlang/dub/releases
    nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.36.0.tar.gz
  - https://github.com/dlang/dub/issues

- version in nixpkgs:
  - https://search.nixos.org/packages?channel=unstable&show=dub&from=0&size=100&sort=relevance&type=packages&query=dub

- dub nixpkg overlay is updated and runs most dub tests correctly

- dub OK ✓ ( 1.30.0 -> 1.36.0 )

  from v1.31.0 requires seeting of pwd in buildPhase else fails to build
  packages with nix tools that previous version of dub built;

** tools
*** dtools OK ✓ ( 2.095.1 -> 2.103.1 )

- https://code.dlang.org/packages/dtools

- https://github.com/dlang/tools
  - https://github.com/dlang/tools/tags
    nix-prefetch --unpack https://github.com/dlang/tools/archive/refs/tags/v2.103.1.tar.gz
  - https://github.com/dlang/tools/issues

- version in nixpkgs
  - https://search.nixos.org/packages?channel=unstable&show=dtools&from=0&size=100&sort=relevance&type=packages&query=dtools

** nixpkgs

It is possible to work directly against a local copy of nixpkgs. To do so you
would clone nixpkgs and point to the local nixpkgs as your build source.

git clone --depth=1 --branch master https://github.com/nixos/nixpkgs nixpkgs

- ./nixpkgs/pkgs/development/compilers/ldc
- ./nixpkgs/pkgs/development/compilers/dmd
- ./nixpkgs/pkgs/development/tools/build-managers/dub
- ./nixpkgs/pkgs/development/tools/dtools

- ./nixpkgs/pkgs/development/compilers/gcc

Note the overlays if copied to the nixpkgs path locations should work as they do
in the overlay, with a pointer to the cloned nixpkgs as nixpkgs repository
source. In fact the starting point for the overlays was to take verbatim what
was in nixpkgs and then to update and fix where necessary those packages.

It is possible to compare the changes made by the overlays here directly against
what is currently available in nixpkgs.

- https://search.nixos.org/packages?channel=unstable&size=100&sort=relevance&query=

nix flake update && nix flake check --show-trace && nix flake info && echo "" && nix flake show
  │
  ├───devShells
  │   └───x86_64-linux
  │       ├───default: development environment 'nix-shell'
  │       ├───dsh-nixpkgs-ldc-dub: development environment 'nixpkgs---ldc---dub'
  │       ├───dsh-overlay-dmd-dub: development environment 'overlay---dmd-2.104.0---dub-1.30.0---broken'
  │       ├───dsh-overlay-dtest-tilix: development environment 'overlay---ldc-1.32.2---dub-1.30.0---tilix---gtkd'
  │       ├───dsh-overlay-dtools: development environment 'overlay---ldc-1.32.2---dub-1.30.0---dtools-2.103.1'
  │       └───dsh-overlay-ldc-dub: development environment 'overlay---ldc-1.32.2---dub-1.30.0'
  └───packages
      └───x86_64-linux
          ├───check-local-dir-build: package 'dummy-0.1.0'
          ├───check-tilix: package 'tilix-1.9.5'
          └───default: package 'tilix-1.9.5'