aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/config_nix.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/config_nix.org')
-rw-r--r--org/config_nix.org230
1 files changed, 158 insertions, 72 deletions
diff --git a/org/config_nix.org b/org/config_nix.org
index e394822..167a406 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -4,12 +4,12 @@
#+FILETAGS: :spine:build:tools:
#+AUTHOR: Ralph Amissah
#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
-#+COPYRIGHT: Copyright (C) 2015 - 2024 Ralph Amissah
+#+COPYRIGHT: Copyright (C) 2015 - 2025 Ralph Amissah
#+LANGUAGE: en
#+STARTUP: show4levels hideblocks hidestars noindent entitiespretty
#+PROPERTY: header-args :exports code
#+PROPERTY: header-args+ :noweb yes
-#+PROPERTY: header-args+ :results no
+#+PROPERTY: header-args+ :results output none
#+PROPERTY: header-args+ :cache no
#+PROPERTY: header-args+ :padline no
#+PROPERTY: header-args+ :mkdirp yes
@@ -44,9 +44,10 @@
runHook postCheck
'';
localOverlay = (final: prev: {
- ldc = prev.callPackage ./nix-overlays/ldc { };
- dmd = prev.callPackage ./nix-overlays/dmd { };
- dub = prev.callPackage ./nix-overlays/dub { };
+ ldc = prev.callPackage ./nix-overlays/ldc { }; # -> ok <<ldc_version>>
+ dmd = prev.callPackage ./nix-overlays/dmd { }; # -> ok <<dmd_version>>
+ dub = prev.callPackage ./nix-overlays/dub { }; # -> ? <<dub_version>>
+ dtools = prev.callPackage ./nix-overlays/dtools { }; # -> ok <<dtools_version>>
#gdc = prev.callPackage ./nix-overlays/gdc { };
});
pkgsForSystem = system: import nixpkgs {
@@ -56,7 +57,8 @@
inherit system;
};
preBuild = ''
- export HOME=$(pwd)
+ export HOME=$TMPDIR
+ #export HOME=$(pwd)
'';
installPhase = ''
runHook preInstall
@@ -65,7 +67,9 @@
runHook postInstall
'';
postInstall = ''
+ echo "❯❯ ./result/bin/spine -v --source --pod --text --epub --html --html-link-pdf --html-link-curate --html-link-markup --curate --output=./OUTPUT_TEST_sisudocSpine ../sisu-spine-samples/markup/pod/*";
echo `ls -la $out/bin/spine`
+ echo "❯❯ spine-v${version} (rev: ${self.shortRev or "unknown"})"
$out/bin/spine -v
'';
in {
@@ -153,6 +157,7 @@
spine-overlay-dmd = stdenv.mkDerivation {
inherit pname;
inherit version;
+ #name = "spine-<<spine_version>> dmd-<<dmd_version>> dub-<<dub_version>>";
meta.mainProgram = "spine-dmd";
executable = true;
src = self;
@@ -176,6 +181,7 @@
spine-overlay-ldc = stdenv.mkDerivation {
inherit pname;
inherit version;
+ #name = "spine-<<spine_version>> ldc-<<ldc_version>> dub-<<dub_version>>";
meta.mainProgram = "spine-ldc";
executable = true;
src = self;
@@ -228,81 +234,104 @@
pkgs-ovl = pkgsForSystem system;
pkgs-nix = nixpkgsFor.${system};
shellHook = ''
- export Date=`date "+%Y%m%d"`
+ #export Date=`date "+%Y%m%d"`
## set local values in .envrc-local (or here if you must)
- echo " ❯❯ ./result/bin/spine -v --source --pod --epub --html --html-link-pdf --html-link-curate --html-link-markup --curate --output=./OUTPUT_TEST_sisudocSpine ../sisu-spine-samples/markup/pod/*";
+ echo '❯❯ nix build';
+ ## ImPure Nix environment
+ SpineGitVer=`git describe | sed "s/^[a-z_-]\+\([0-9.]\+\)/\1/" | sed "s/\([^-]*-g\)/r\1/" | sed "s/-/./g"` && \
+ SpineGitBranch=`git branch --show-current` && \
+ echo "❯❯ spine-v${version} - ($SpineGitBranch: $SpineGitVer)"
+ ## Pure Nix environment - version info from flake inputs
+ #echo "❯❯ spine-v${version} (rev: ${self.shortRev or "unknown"})"
+ echo '❯❯ $SpineBIN -v --source --pod --text --epub --html --html-link-pdf --html-link-curate --html-link-markup --curate --output=$SpineOUT $SpinePOD/*';
+ echo "❯❯ $SpineBIN -v --source --pod --text --epub --html --html-link-pdf --html-link-curate --html-link-markup --curate --output=$SpineOUT $SpinePOD/*";
+ echo '❯❯ nix flake update && nix flake check && nix flake show';
'';
in
with pkgs-nix; {
dsh-overlay = mkShell {
- name = "spine base dev shell";
+ name = "spine-<<spine_version>> base dev shell, ldc-<<ldc_version>>, dub-<<dub_version>> - dtools-<<dtools_version>>";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
ldc
#dmd
dub
+ dtools
gnumake
sqlite
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
- dsh-nixpkgs-dmd-dub = mkShell {
- name = "spine base dev shell";
+ dsh-nixpkgs-dmd = mkShell {
+ name = "spine-<<spine_version>> base dev shell";
inherit shell;
inherit devEnv;
packages = [
dmd
dub
+ dtools
gnumake
sqlite
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
- dsh-nixpkgs-ldc-dub = mkShell {
- name = "spine base dev shell";
+ dsh-nixpkgs-ldc = mkShell {
+ name = "spine-<<spine_version>> base dev shell";
inherit shell;
inherit devEnv;
packages = [
ldc
dub
+ dtools
gnumake
sqlite
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
- dsh-overlay-dmd-dub = mkShell {
- name = "spine base dev shell";
+ dsh-overlay-dmd = mkShell {
+ name = "spine-<<spine_version>> base dev shell, dmd-<<dmd_version>>, dub-<<dub_version>> - dtools-<<dtools_version>>";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
dmd
dub
+ dtools
gnumake
sqlite
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
- dsh-overlay-ldc-dub = mkShell {
- name = "spine base dev shell";
+ dsh-overlay-ldc = mkShell {
+ name = "spine-<<spine_version>> base dev shell, ldc-<<ldc_version>>, dub-<<dub_version>> - dtools-<<dtools_version>>";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
ldc
dub
+ dtools
gnumake
sqlite
];
inherit shellHook;
};
dsh-epub = mkShell {
- name = "spine dev shell for epub output";
+ name = "spine-<<spine_version>> dev shell for epub output";
inherit shell;
inherit devEnv;
packages = [
ldc
#dmd
dub
+ dtools
gnumake
sqlite
libxml2
@@ -320,17 +349,20 @@
calibre #(suite includes: ebook-viewer)
koreader
foliate
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
dsh-html = mkShell {
- name = "spine dev shell for html output";
+ name = "spine-<<spine_version>> dev shell for html output";
inherit shell;
inherit devEnv;
packages = [
ldc
#dmd
dub
+ dtools
gnumake
sqlite
# ❯❯ text-mode web browsers
@@ -340,49 +372,60 @@
w3m
# ❯❯ light graphical
#dillo
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
dsh-latex-pdf = mkShell {
- name = "spine dev shell for latex & pdf output";
+ name = "spine-<<spine_version>> dev shell for latex & pdf output";
inherit shell;
inherit devEnv;
packages = [
ldc
#dmd
dub
+ dtools
gnumake
source-sans-pro
source-serif-pro
source-code-pro
texlive.combined.scheme-full
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
dsh-sqlite = mkShell {
- name = "spine dev shell for latex & pdf output";
+ name = "spine-<<spine_version>> dev shell for sqlite3 output";
inherit shell;
inherit devEnv;
packages = [
ldc
#dmd
dub
+ dtools
gnumake
sqlite
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
dsh-i18n = mkShell {
- name = "spine dev shell internationalization, po4a";
+ name = "spine-<<spine_version>> dev shell for internationalization, po4a";
inherit shell;
inherit devEnv;
packages = [
ldc
#dmd
dub
+ dtools
gnumake
sqlite
perl538Packages.Po4a
+ gnugrep gnused
+ ripgrep
];
inherit shellHook;
};
@@ -497,6 +540,7 @@ with pkgs;
# ❯❯❯ dev
gnumake
ps
+ dtools
# ❯❯❯ d_build_related
# ❯❯ package manager
dub
@@ -645,15 +689,6 @@ installPhase = ''
'';
#+END_SRC
-** variables used SET
-*** spine project VERSION :version:set:project:
-
-#+NAME: spine_version
-#+HEADER: :noweb yes
-#+BEGIN_SRC emacs-lisp
-<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:spine_project_version()>>
-#+END_SRC
-
*** nixpkgs path / url
- nixpkgs_url_github
@@ -662,14 +697,14 @@ installPhase = ''
**** github (official)
#+NAME: nixpkgs_url_github
-#+BEGIN_SRC sh
+#+BEGIN_SRC shell
github:NixOS/nixpkgs/nixpkgs-unstable
#+END_SRC
**** localhost
#+NAME: nixpkgs_url_local
-#+BEGIN_SRC sh
+#+BEGIN_SRC shell
/srv/nix/nixpkgs
#+END_SRC
@@ -712,7 +747,7 @@ github:nixos/nixpkgs
** .env/echo-nixNote CHECK MODIFY
*** notes on nix commands
-#+HEADER: :tangle ../.env/nix-commands
+#+HEADER: :tangle-NO ../.env/nix-commands
#+BEGIN_SRC text
- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
@@ -737,8 +772,8 @@ nix-shell '<nixpkgs>' -A nix --pure
*** echo-nixNote
-#+HEADER: :tangle ../.env/echo-nixNote
-#+BEGIN_SRC sh
+#+HEADER: :tangle-NO ../.env/echo-nixNote
+#+BEGIN_SRC shell
echo '-*- mode: org -*-
,* nixpkgs path?
@@ -751,7 +786,7 @@ echo " <nixpkgs> == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org
echo '
,* nix build and show derivation
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
nix-shell --pure
nix-build
@@ -789,7 +824,7 @@ echo "#+END_SRC
,* initialised shell variables
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
SpineSRC=$SpineSRC
SpineDOC=$SpineDOC
SpinePOD=$SpinePOD
@@ -802,81 +837,81 @@ echo '* spine run instruction examples
,** parallelized tasks
,*** doc source
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --pod --source --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** html & epub output
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --html --epub --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** sqlite db for each document - populate each db
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** doc source; html, epub; sqlite outputs
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --verbose --pod --html --epub --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** curate (authors topics)
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --curate --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** html, curate
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --verbose --dark --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/*
$SpineBIN/spine --very-verbose --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** composite command: source pod, html, epub, curate, sqlite
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --verbose --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,** sequential tasks
,*** sqlite db (shared) - create db
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUTversioned"
,#+END_SRC
,*** sqlite db (shared) - populate db
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-update --output="$SpineOUTversioned" $SpineDOC/sisudoc-spine-markup-samples/markup/pod/*
,#+END_SRC
,*** sqlite db (shared) - drop db
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-db-drop --output="$SpineOUTversioned"
,#+END_SRC
,*** sqlite db (shared) - create & populate db (single step)
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-db-create --sqlite-update --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,*** composite command: source pod, html, epub, curate, sqlite
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/*
,#+END_SRC
,** config [./pod/].dr/config_local_site
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
cat $SpinePOD/.dr/config_local_site
$SpineBIN/spine --show-config $SpinePOD
$SpineBIN/spine --show-config --output="$SpineOUTversioned" $SpinePOD
@@ -884,41 +919,40 @@ $SpineBIN/spine --show-config --output="$SpineOUTversioned" $SpinePOD
,** cgi operations (output to $SpineOUT /var/www)
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUT" $SpinePOD/*
-$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/*
+# CGI search form is built separately in sisudoc-spine-search-cgi/
$SpineBIN/spine -v --show-config --config=$SpinePOD/.dr
$SpineBIN/spine --html $SpinePOD/*
-
-$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local_site
+# See sisudoc-spine-search-cgi/README.md for CGI search form build instructions
,#+END_SRC
,*** generate html linked to search form
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --output=$SpineOUT $SpinePOD/*
,#+END_SRC
,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate)
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="<<spine_search_db>>" --sqlite-db-path="$SpineDBpath"
$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<<spine_search_db>>" --sqlite-db-path="$SpineDBpath"
,#+END_SRC
,*** populate sqlite db
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<<spine_search_db>>" --output=$SpineOUT $SpinePOD/*
,#+END_SRC
,*** generate html (linked to search form), sql output, curate COMPOSITE
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<<spine_search_db>>" --cgi-sqlite-search-filename="<<spine_search_cgi>>" --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/*
$SpineBIN/spine --epub --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --cgi-url-action="https://sisudoc.org/spine_search" --ouput="$SpineOUT" $SpinePOD/*
,#+END_SRC
@@ -927,7 +961,7 @@ $SpineBIN/spine --epub --html --html-link-search --html-link-curate --curate --s
if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/*
,#+END_SRC
@@ -962,13 +996,13 @@ webserv:
,*** make search form
-,#+BEGIN_SRC sh
-$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local_site
+,#+BEGIN_SRC shell
+# CGI search form is built separately - see sisudoc-spine-search-cgi/README.md
,#+END_SRC
,*** latex
-,#+BEGIN_SRC sh
+,#+BEGIN_SRC shell
$SpineBIN/spine --latex --serial --output="$SpineOUT" $SpinePOD/*
ls $SpineOutstatic/latex/*.tex
,#+END_SRC
@@ -983,12 +1017,12 @@ ls $SpineOutstatic/latex/*.tex
*** db search related variables
#+NAME: spine_search_db
-#+BEGIN_SRC sh
+#+BEGIN_SRC shell
spine.search.db
#+END_SRC
#+NAME: spine_search_cgi
-#+BEGIN_SRC sh
+#+BEGIN_SRC shell
spine_search
#+END_SRC
@@ -1028,23 +1062,75 @@ postInstall:
echo `ls -la $${out}/bin/spine`
#+END_SRC
-** empty sha56 hash
+* versions GET
+** dlang overlays
+*** ldc
-#+NAME: blank_hash
+#+NAME: ldc_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:ldc-version()>>
+#+END_SRC
+
+*** dmd
+
+#+NAME: dmd_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dmd-version()>>
+#+END_SRC
+
+*** dub
+
+#+NAME: dub_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dub-version()>>
+#+END_SRC
+
+*** dtools
+
+#+NAME: dtools_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dtools-version()>>
+#+END_SRC
+
+** sha256 blank hash
+
+#+NAME: sha256-blank
#+BEGIN_SRC nix
-sha256-0000000000000000000000000000000000000000000=
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
-#+NAME: assumed_hash
+#+NAME: blank_hash
#+BEGIN_SRC nix
-sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
-** version info SET VERSION :version:set:project:
-*** spine project VERSION :version:set:project:
+* org includes
+** spine project VERSION
#+NAME: spine_version
#+HEADER: :noweb yes
#+BEGIN_SRC emacs-lisp
<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:spine_project_version()>>
#+END_SRC
+
+** year
+
+#+NAME: year
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:year()>>
+#+END_SRC
+
+** document header including copyright & license
+
+#+NAME: doc_header_including_copyright_and_license
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:spine_doc_header_including_copyright_and_license()>>
+#+END_SRC
+
+* __END__