aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/config_misc.org
blob: c60d0cb336518ec76a08fd8da3309eb48bd55b5b (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
-*- mode: org -*-
#+TITLE:       configuration git
#+DESCRIPTION: documents - structuring, various output representations & search
#+FILETAGS:    :spine:hub:
#+AUTHOR:      Ralph Amissah
#+EMAIL:       [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+COPYRIGHT:   Copyright (C) 2015 - 2022 Ralph Amissah
#+LANGUAGE:    en
#+STARTUP:     content hideblocks hidestars noindent entitiespretty
#+PROPERTY:    header-args  :exports code
#+PROPERTY:    header-args+ :noweb yes
#+PROPERTY:    header-args+ :results no
#+PROPERTY:    header-args+ :cache no
#+PROPERTY:    header-args+ :padline no
#+PROPERTY:    header-args+ :mkdirp yes
#+OPTIONS:     H:3 num:nil toc:t \n:t ::t |:t ^:nil -:t f:t *:t

* sundry misc
** sh script to batch process _emacs org babel tangle_ :shell_script:tangle:
  [[https://orgmode.org/manual/Batch-execution.html]]
creates a shell batch script called "tangle", that will tangle (emacs org
babel tangle) org files in ./org/ to create .d source files in ./src/doc_reform/
(similar functionality is contained within the "makefile" created by this
"dr_build_scaffold.org" file make tangle)

#+HEADER: :tangle ../tangle
#+HEADER: :tangle-mode (identity #o755)
#+HEADER: :shebang "#!/bin/sh"
#+BEGIN_SRC sh
# -*- mode: shell-script -*-
# tangle files with org-mode
DIR=`pwd`
ORGFILES=""
EMACSLISP=/usr/share/emacs/site-lisp
ORG_VER_AVAILABLE=$(shell echo `ls -d ~/.emacs.d/elpa/org-???????? | cut -d '-' -f2`)
EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VER_AVAILABLE)))
ORG_CONTRIB_VER_AVAILABLE=$(shell echo `ls -d ~/.emacs.d/elpa/org-plus-???????? | cut -d '-' -f2`)
EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_CONTRIB_VER_AVAILABLE)))
# wrap each argument in the code required to call tangle on it
for i in $@; do
  ORGFILES="$ORGFILES \"$i\""
done
emacs --batch -Q -q \
--eval "(progn
(add-to-list 'load-path (expand-file-name \"$EMACSLISP\"))
(add-to-list 'load-path (expand-file-name \"$EMACSLISP_ORG\" t))
(add-to-list 'load-path (expand-file-name \"$EMACSLISP_ORG_CONTRIB\" t))
(require 'org)(require 'ob)(require 'ob-tangle)
(mapc (lambda (file)
  (find-file (expand-file-name file \"$DIR\"))
  (setq-local org-src-preserve-indentation t)
  (org-babel-tangle)
  (kill-buffer)) '($ORGFILES)))" 2>&1 #|grep tangled
#+END_SRC

** build
*** dub

#+BEGIN_SRC sh
dub build -h
#+END_SRC

#+BEGIN_SRC sh
time dub --compiler=ldc2 -v --force
time (dub --compiler=ldc2 --config=spine-ldc --debug=steps)
time (dub --compiler=ldc2 --config=spine-ldc --debug=checkdoc --debug=summary --debug=dumpdoc)
time (dub --compiler=ldc2 --config=spine-ldc --debug=io)
time (dub --compiler=ldc2 --config=spine-ldc --debug=checkdoc --debug=summary --debug=dumpdoc --debug=io)
time (dub --compiler=ldc2 --config=spine-ldc-debug --debug=io)

time dub --compiler=dmd -v --force
time (dub --compiler=dmd --config=spine-dmd --debug=steps)
time (dub --compiler=dmd --config=spine-dmd-debug --debug=io)

time dub --compiler=gdc -v --force
time (dub --compiler=gdc --config=spine-gdc --debug=steps)
time (dub --compiler=gdc --config=spine-gdc-debug --debug=io)
#+END_SRC

*** make

#+BEGIN_SRC sh
time make dmd
time make gdc
time make ldc
time make gdc ldc
time make all
time make all_ver
time make dmd_ver ldc_ver gdc_ver

time make restart
time make restart ldc
time make tangle ldc

time make ldc_testrun_find_pod_epub
#+END_SRC

** git
*** project version

#+BEGIN_SRC sh
echo $(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g')
#+END_SRC

*** what files changed

#+BEGIN_SRC sh
git whatchanged --since="1 day ago" --oneline --name-only --pretty=format: | sort -u
git log --since="1 day ago" --name-only --pretty=format: | sort -u
#+END_SRC

** test run
*** e.g.

#+BEGIN_SRC sh
time (./result/bin/spine --source --html -v --output-dir=tmp/program-output data/pod/sisu-manual/media/text/en/sisu_markup.sst )

time (./bin/spine-ldc --source --html -v --output-dir=tmp/program-output data/pod/sisu-manual/media/text/en/sisu_markup.sst )

time (./bin/spine-ldc --source --html -v --output-dir=tmp/program-output data/pod/sisu-manual )
time (./bin/spine-ldc --source --html -v --output-dir=tmp/program-output data/pod/the_wealth_of_networks.yochai_benkler )
time (./bin/spine-ldc --source --html -v --output-dir=tmp/program-output data/pod/live-manual )

time (~sdp2/bin/spine-ldc --pod --source --html --epub --sqlite-create --sqlite-update -v sisudoc/media/text/en/sisu_markup_stress_test.sst sisudoc/media/text/en/the_wealth_of_networks.yochai_benkler.sst )

can point to directory containing sisudoc.txt file (listing which files to process)

time (~sdp2/bin/spine-ldc --html -v sisudoc)
# will process source files listed in sisudoc.txt for appropriate files and dir structure

e.g. live-manual a multilingual document (with source file inserts .ssi)

time (~sdp2/bin/spine-ldc --html --lang=en,es -v sisudoc)

time ( find data/pod -name pod.manifest | sort | xargs ./bin/spine-ldc --source --html --epub -v --output-dir=tmp/program-output )

time ( find data/pod -maxdepth 2 -name pod.manifest | sort | xargs ./bin/spine-ldc --source --html --epub -v --output-dir=tmp/program-output )
time ( find data/sisudir/media/text -name *.ss[tm] | sort | xargs ./bin/spine-ldc --source --html --epub -v --output-dir=tmp/program-output )

find data/pod -maxdepth 2 -name pod.manifest | sort | xargs

find data/sisudir/media/text -name *.ss[tm] | sort | xargs
#+END_SRC

*** sort

#+BEGIN_SRC sh
~dr/bin/spine-ldc -v  --sqlite-db-create --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --output=/var/www/html \
  ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/*

~dr/bin/spine-ldc -v  --sqlite-update --sqlite-db-filename="spine.search.db"   --output=/var/www/html \
  ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/*

~dr/bin/spine-ldc -v --html --curate-link  --output=/var/www/html \
   ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/*

~dr/bin/spine-ldc -q --show-config --html --output=/var/www/html ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod

~dr/bin/spine-ldc -q --show-config ~/grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod

~dr/result/bin/spine --html --output=/var/www/html ~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/markup_samples/markup/pod/*

~dr/result/bin/spine --very-verbose --sqlite-db-create --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --output=/var/www ~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/markup_samples/markup/pod/*

~dr/result/bin/spine --very-verbose --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine-search" --output=/var/www ~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/markup_samples/markup/pod/*
#+END_SRC

- produces:
  - sqlite db @:           /var/www/html/sqlite/spine.search.db
  - search script in D @:  /var/www/html/cgi/src/spine_search.d
  - html output *          /var/www/html/en/html/[filename]

#+BEGIN_SRC sh
cd /var/www/html/cgi

cp arsd/cgi.d /var/www/html/cgi/.          *-[needs to be implemented as part of code]

dub --force --compiler=ldc2 && sudo cp -v cgi-bin/spine-search /usr/lib/cgi-bin/.
#+END_SRC

*** list markup files
find data/pod -name pod.manifest | sort
find data/sisudir/media/text -name *.ss[tm] | sort

time make ldc_testrun_paths_pod_pod
time make ldc_testrun_paths_pod_pod | ag "^\".+\"|NOT found"
time make ldc_testrun_find_pod_pod
time make ldc_testrun_find_dir_pod
time make ldc_testrun_filelist_dir_pod

** compilers

- [X] Set D_COMPILER (one of DMD LDC or GDC)
- [X] Set debug flags (using DMD standard flag -deb

[[https://wiki.dlang.org/Compilers][D Compilers wiki https://wiki.dlang.org/Compilers]]
[[https://dlang.org/download.html][D Compilers download https://dlang.org/download.html]]

** version info REVIEW :version:

- https://dlang.org/download.html

*** compilers (set latest versions) :compiler:version:
**** ldc VERSION :version:set:ldc:

- https://github.com/ldc-developers/ldc/releases

***** 1.24.0 HACK

- https://github.com/ldc-developers/ldc/releases/tag/v1.24.0
  - nix-prefetch-url https://github.com/ldc-developers/ldc/releases/download/v1.24.0/ldc-1.24.0-src.tar.gz

#+NAME: ldc_version_info
#+BEGIN_SRC nix
version = "1.24.0";
sha256  = "0g5svf55i0kq55q49awmwqj9qi1n907cyrn1vjdjgs8nx6nn35gx";
#+END_SRC

- ldc-1.24.0 overlay does not build with latest nixos version, nixos-20.09
  nixos at ldc-1.20.0

**** dmd :dmd:

- https://dlang.org/changelog/index.html
- https://dlang.org/changelog/pending.html
- https://downloads.dlang.org/releases/
- https://downloads.dlang.org/releases/2.x/