summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-02-21 19:08:16 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2023-04-19 12:46:49 -0400
commitf842299086398f39cfa5fe90eb0aedadea04be0e (patch)
tree4a6c48222e6ecc44896f9b99dc2a6c13cfc2ec75
parentnix flake & build, devShells etc. (diff)
nix flake & build, temp. remove gdc
-rw-r--r--.envrc23
-rw-r--r--derivation.nix2
-rw-r--r--[-rwxr-xr-x]devenv.nix31
-rw-r--r--flake.lock30
-rw-r--r--flake.nix55
-rw-r--r--makefile26
-rw-r--r--org/config_make.org679
-rw-r--r--org/config_nix.org290
-rwxr-xr-xshell.nix72
9 files changed, 214 insertions, 994 deletions
diff --git a/.envrc b/.envrc
index 8286fa6..84c025e 100644
--- a/.envrc
+++ b/.envrc
@@ -1,34 +1,15 @@
use flake .
#use flake .#default
NIX_ENFORCE_PURITY=1
+# - https://github.com/nix-community/nix-direnv
NixDirEnvVersion="2.2.1"
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
-# - https://github.com/nix-community/nix-direnv
# source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-0000000000000000000000000000000000000000000="
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
watch_file flake.lock
watch_file flake.nix
-#nix flake update && nix flake check --show-trace && nix flake show
+watch_file makefile
if [ -f .envrc-local ]; then
source_env_if_exists .envrc-local || source .envrc-local
fi
-# echo "
-#
-# - nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
-#
-# - nix build .#default --print-build-logs
-# - nix build .#spine-search-ldc --print-build-logs
-# - nix build .#spine-search-dmd --print-build-logs
-# - nix build .#spine-search-gdc --print-build-logs
-#
-# nix-shell '<nixpkgs>' -A nix --pure
-#
-# nix run .#default --print-build-logs
-#
-# nix develop --build .#default --print-build-logs
-#
-# nix shell .#default --print-build-logs --command spine -v
-# nix shell .#default --print-build-logs --command spine --very-verbose --epub --html --html-link-search --html-link-curate --curate --output=\"\$SpineOUT\" ./markup/pod
-# nix shell .#default --print-build-logs --command spine --very-verbose --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename=\"spine.search.db\" --cgi-sqlite-search-filename=\"spine_search\" --sqlite-db-path=\"\$SpineDBpath\" --output=\"\$SpineOUT\" ./markup/pod
-# "
diff --git a/derivation.nix b/derivation.nix
index 42605bc..a1e712a 100644
--- a/derivation.nix
+++ b/derivation.nix
@@ -109,7 +109,7 @@ mkDubDerivation rec {
homepage = "https://sisudoc.org";
description = "cgi sqlite search form for document object search";
longDescription = ''
- a sisu like parser and document generator
+ a sisu like parser & document generator
'';
homepage = "https://sisudoc.org";
license = licenses.agpl3Plus;
diff --git a/devenv.nix b/devenv.nix
index 98a02b5..02cca28 100755..100644
--- a/devenv.nix
+++ b/devenv.nix
@@ -1,43 +1,42 @@
-{ pkgs ? import <nixpkgs> { }, name ? "user-env" }: with pkgs;
+{ pkgs ? import <nixpkgs> { }, name ? "user-env" }:
+with pkgs;
buildEnv {
inherit name;
extraOutputsToInstall = [ "out" "man" "lib" ]; # to get all needed symlinks
paths = [
+ # ❯❯❯ nix_related
#nix # if not on NixOS, this is needed
direnv
+ #cachix
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
- nix-tree jq nix-output-monitor
+ nix-output-monitor
+ nix-tree
+ jq
git
+ gnumake
ps
- ### d_build_related
+ # ❯❯❯ d_build_related
+ # ❯❯ package manager
dub
- ## compiler
+ # ❯❯ compiler
dmd
ldc
- #gdc
- #rund
- ## linker
- #lld
- #mold
- ## builder
- #ninja
- #meson
- ### sqlite search related
+ # ❯❯❯ sqlite search related
sqlite
# this will create a script that will rebuild and upgrade your setup; using shell script syntax
(writeScriptBin "nix-rebuild" ''
#!${stdenv.shell}
- cd <path-to-flake> || exit 1
+ #cd <path-to-flake> || exit 1
nix flake update
nix profile upgrade '.*'
'')
# puts in your root the nixpkgs version
- (writeTextFile {
+ (writeTextFile {
name = "nixpkgs-version";
destination = "/nixpkgs-version";
text = lib.version;
- })
+ })
];
}
diff --git a/flake.lock b/flake.lock
index 49ab5de..33c7ddb 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,12 +1,15 @@
{
"nodes": {
"flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1681202837,
+ "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
@@ -17,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1674807565,
- "narHash": "sha256-zOLE1YXf2RhYhtNv4n8C0xPaSjduchLlCxZaAeoAvxU=",
+ "lastModified": 1681753173,
+ "narHash": "sha256-MrGmzZWLUqh2VstoikKLFFIELXm/lsf/G9U9zR96VD4=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62",
+ "rev": "0a4206a51b386e5cda731e8ac78d76ad924c7125",
"type": "github"
},
"original": {
@@ -36,6 +39,21 @@
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 6c6c331..b362da7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -37,7 +37,7 @@
inherit shell;
inherit devEnv;
buildInputs = [ sqlite ];
- nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ];
+ nativeBuildInputs = [ dub ldc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ];
buildPhase = ''
runHook preBuild
for DC_ in dmd ldmd2 ldc2 gdc gdmd; do
@@ -92,25 +92,25 @@
inherit installPhase;
inherit postInstall;
};
- spine-search-gdc = stdenv.mkDerivation {
- inherit pname;
- inherit version;
- meta.mainProgram = "spine_search-gdc";
- executable = true;
- src = self;
- inherit shell;
- inherit devEnv;
- buildInputs = [ sqlite ];
- nativeBuildInputs = [ dub gdc gnumake ];
- buildPhase = ''
- runHook preBuild
- dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all
- runHook postBuild
- '';
- inherit checkPhase;
- inherit installPhase;
- inherit postInstall;
- };
+ #spine-search-gdc = stdenv.mkDerivation {
+ # inherit pname;
+ # inherit version;
+ # meta.mainProgram = "spine_search-gdc";
+ # executable = true;
+ # src = self;
+ # inherit shell;
+ # inherit devEnv;
+ # buildInputs = [ sqlite ];
+ # nativeBuildInputs = [ dub gdc gnumake ];
+ # buildPhase = ''
+ # runHook preBuild
+ # dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all
+ # runHook postBuild
+ # '';
+ # inherit checkPhase;
+ # inherit installPhase;
+ # inherit postInstall;
+ #};
#vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000=";
});
devShells = forAllSystems (system:
@@ -141,28 +141,29 @@
#export spineSqlite="spine --very-verbose --sqlite-update --sqlite-db-path=\"$SpineDBpath\" --sqlite-db-filename=\"spine.search.db\" --output=\"\$SpineOUT\" $SpinePOD/*"
'';
in with pkgs; {
- devShell = mkShell rec {
- name = "spine dev shell default";
+ devShell = mkShell {
+ name = "spine base dev shell";
inherit shell;
inherit devEnv;
#buildInputs = [ sqlite ];
#nativeBuildInputs = [ dub dmd ldc gdc gnumake ];
packages = [
sqlite
- dub dmd ldc gdc gnumake
+ dub dmd ldc gnumake
];
inherit shellHook;
};
- devShell-sqlite = mkShell rec {
- name = "spine dev shell for latex & pdf output";
+ devShell-sqlite = mkShell {
+ name = "spine dev shell for latex & pdf output";
inherit shell;
inherit devEnv;
- packages = [
+ packages = [
+ dub dmd ldc gnumake
sqlite
- dub dmd ldc gdc gnumake
];
inherit shellHook;
};
+ default = import ./shell.nix { inherit pkgs; };
});
};
}
diff --git a/makefile b/makefile
index 17ab590..27fdd31 100644
--- a/makefile
+++ b/makefile
@@ -5,25 +5,39 @@ SpineSearchAction := 'https://sisudoc.org/spine_search'
SpineCGIform := 'spine_search'
SpineSQLdb := 'spine.search.db'
+default: flake-check
+
+flake-check:
+ nix flake update; \
+ nix flake check; \
+ echo -e 'nix flake show ❯❯\n'; \
+ nix flake show; \
+ echo -e '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh\n'; \
+ echo -e '❯❯ nix develop\n❯❯ nix develop -c zsh\n'; \
+ echo -e '❯❯ nix build ".#spine-ldc" --print-build-logs |& nom\n❯❯ nix build ".#spine-dmd" --print-build-logs |& nom\n'; \
+ echo -e '❯❯ make -s\n❯❯ make -s nix-build-ldc\n❯❯ make -s nix-build-dmd\n'; \
+ echo -e '❯❯ make -s ldc\n❯❯ make -s dmd\n'; \
+ echo -e '❯❯ $(DUB) --compiler=ldc2 --build=ldc2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n';
+
nix-devshell:
- echo -ne "\n- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell\n\n- nix build .#default --print-build-logs\n- nix build .#spine-search-dmd --print-build-logs\n- nix build .#spine-search-ldc --print-build-logs\n- nix build .#spine-search-gdc --print-build-logs\n\n"; \
- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+ echo -ne '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"\n\n❯❯ nix build ".#default" --print-build-logs\n❯❯ nix build ".#spine-search-dmd" --print-build-logs\n❯❯ nix build ".#spine-search-ldc" --print-build-logs\n❯❯ nix build ".#spine-search-gdc" --print-build-logs\n\n'; \
+ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"
# nix build
build:
nix-build
nix-build-default:
- nix build .#default --print-build-logs
+ nix build ".#default" --print-build-logs
nix-build-dmd:
- nix build .#spine-dmd --print-build-logs
+ nix build ".#spine-search-dmd" --print-build-logs
nix-build-ldc:
- nix build .#spine-ldc --print-build-logs
+ nix build ".#spine-search-ldc" --print-build-logs
nix-build-gdc:
- nix build .#spine-gdc --print-build-logs
+ nix build ".#spine-search-gdc" --print-build-logs
get_depends:
hwd=$$(echo `pwd`) && \
diff --git a/org/config_make.org b/org/config_make.org
index 4f91db4..6e20002 100644
--- a/org/config_make.org
+++ b/org/config_make.org
@@ -41,622 +41,12 @@
0
#+END_SRC
-* spine
-** spine makefile :makefile:
-*** tangle
-
-#+HEADER: :noweb yes
-#+BEGIN_SRC makefile
-SpineBIN := "${SpineBIN}" # 'result/bin'
-SpineOUT := "${SpineOUT}" # '/srv/www/spine'
-SpinePOD := "${SpinePOD}" # '~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod'
-SpineSearchAction := 'https://sisudoc.org/spine_search'
-SpineCGIform := 'spine_search'
-SpineSQLdb := 'spine.search.db'
-
-get_depends:
- hwd=$$(echo `pwd`) && \
- gwd="$${hwd}/src/ext_depends" && \
- dirs=$$(echo `ls -gx $${gwd}`) && \
- license_bsl="Boost Software License 1.0 (BSL-1.0)" && \
- echo $${hwd} && \
- echo $${gwd} && \
- echo $${deps} && \
- dub upgrade; \
- cd $${gwd} && \
- for dir in $${deps}; do \
- if [ -d $${dir} ]; then \
- echo $${dir} && \
- if [[ "arsd" == $${dir} ]]; then \
- echo $${dir} && \
- rm -rf $${dir} && \
- mkdir $${dir} && \
- aria2c -o "$${dir}/cgi.d" "https://raw.githubusercontent.com/adamdruppe/arsd/master/cgi.d" && \
- cd $${gwd}; \
- elif [[ "d2sqlite3" == $${dir} ]]; then \
- echo $${dir} && \
- rm -rf $${dir} && \
- git clone --depth=1 https://github.com/dlang-community/$${dir} && \
- cd $${dir} && \
- echo "$${dir} `git rev-parse HEAD | cut -c 1-8`" > ../$${dir}.meta && \
- echo "https://github.com/dlang-community/$${dir}" >> ../$${dir}.meta && \
- echo "$${license_bsl}" >> ../$${dir}.meta && \
- cd $${gwd} && \
- rm -rf $${dir}/.git; \
- fi; \
- fi; \
- done; \
- cd $${hwd}
-
-set_depends: get_depends
- dub describe | sed 's~$(shell echo `pwd | sed 's_/_\\/_g'`)~.~g' > dub_describe.json
-#+END_SRC
-
-<<make_git_snapshot>>
-<<make_phony>>
-
-*** settings [+2] :settings:
-
-*** make archive
-
-#+NAME: make_project_zip_archive
-#+BEGIN_SRC makefile
-gitZip:
- git archive -v --format=tar --prefix=`echo spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)`/ HEAD | gzip > ./tarballGitHEAD/spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT).tar.gz && \
- echo "to unzip: tar -xzf spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT).tar.gz"
-
-# git archive project, produce current state .tar.gz
-gitArchive:
- git archive -v --format=tar --prefix=spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)/ HEAD | gzip > ./tarballGitHEAD/spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT).tar.gz && \
- echo "to unzip: tar -xzf spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT).tar.gz"
-
-# git archive project, produce current state .tar.gz
-# gitArchive:
-# git archive -v --format=tar --prefix="spine-{{PROG_VER_DECLARED}}-tag-{{PROG_VER_GIT}}/" HEAD | gzip > ./tarballGitHEAD/spine-{{PROG_VER_DECLARED}}-tag-{{PROG_VER_GIT}}.tar.gz && \
-# echo "to unzip: tar -xzf spine-{{PROG_VER_DECLARED}}-tag-{{PROG_VER_GIT}}.tar.gz"
-
-#+END_SRC
-
-*** nixGitHEADtarball
-
-#+NAME: nixGitHEADtarball
-#+HEADER: :noweb yes
-#+BEGIN_SRC makefile
-# remove test tarball dir
-nixGitHEADtarballClean:
- if [ -d "./tarballGitHEAD" ]; then \
- rm -rv ./tarballGitHEAD; \
- fi;
-
-# create test tarball
-nixGitHEADtarballTar:
- if [ ! -d "./tarballGitHEAD" ]; then \
- mkdir ./tarballGitHEAD; \
- fi; \
- git archive -v --format=tar --prefix="spine-${PROG_VER_DECLARED}/" HEAD | \
- gzip > ./tarballGitHEAD/spine-${PROG_VER_DECLARED}-tag-${PROG_VER_GIT}.tar.gz && \
- cp -v ./tarballGitHEAD/spine-${PROG_VER_DECLARED}-tag-${PROG_VER_GIT}.tar.gz ./tarballGitHEAD/spine-${PROG_VER_DECLARED}.tar.gz && \
- echo "to unzip: tar -xzf spine-${PROG_VER_DECLARED}-tag-${PROG_VER_GIT}.tar.gz"; \
- echo "to unzip: tar -xzf spine-${PROG_VER_DECLARED}.tar.gz"
-
-# check test tarball
-nixGitHEADtarballCheck:
- nix flake check <<nixGitUrl>>/spine-${PROG_VER_DECLARED}.tar.gz; \
- nix flake lock <<nixGitUrl>>/spine-${PROG_VER_DECLARED}.tar.gz; \
- nix flake show <<nixGitUrl>>/spine-${PROG_VER_DECLARED}.tar.gz;
-
-# build test tarball
-nixGitHEADtarballBuild:
- echo "nix build <<nixGitUrl>>/spine-${PROG_VER_DECLARED}.tar.gz#spine --print-build-logs"
- nix build <<nixGitUrl>>/spine-${PROG_VER_DECLARED}.tar.gz#spine --print-build-logs
- #nix build "./tarballGitHEAD/spine-${PROG_VER_DECLARED}.tar.gz#spine" --print-build-logs
-
-# clean create check & build test tarball
-nixGitHEADtarball: nixGitHEADtarballClean nixGitHEADtarballTar nixGitHEADtarballCheck nixGitHEADtarballBuild
-
-#+END_SRC
-
-**** Url nixGitHEADtarball
-
-#+NAME: nixGitUrl
-#+BEGIN_SRC makefile
-file://${hwd}/tarballGitHEAD
-#+END_SRC
-
-*** _make_ commands [+2] :make:commands:
-
-- build commands
- - build
- - debug
- - release
-- init, clean, distclean etc.
- - init
- - clean
- - expunge
- - distclean
- - distclean_and_init
-- org babel tangle
- - tangle
-- git snapshot
- - gitsnapshot
-
-**** version tag, stamp
-
-#+NAME: make_version_tag
-#+HEADER: :noweb yes
-#+BEGIN_SRC makefile
-version_tag:
- echo "DRV=<<spine_version_set>>; git tag -f doc-reform_v$$\{DRV} -m\"doc-reform $$\{DRV}\" HEAD" && \
- echo "git tag -f doc-reform_v<<spine_version_set>> -m\"doc-reform spine-<<spine_version_set>>\" HEAD"
-
-#+END_SRC
-
-**** changelog
-
-#+NAME: make_changelog
-#+BEGIN_SRC makefile
-changelog_:
- git log --pretty=format:'---%+s %+as %ae%+h%d%+b' --no-merges | sed "/^\\s*$$/d" | sed "s/^---$$//" | sed "s/^\(\*\)\+/-/" | sed "s/ \+$$//" > CHANGELOG_
-
-# git changelog for project
-changelog:
- git log --pretty=format:'---%+s %+as %ae%+h%d%+b' --no-merges | sed "/^\\s*$$/d" | sed "s/^---$$//" | sed "s/^\(\*\)\+/-/" | sed "s/ \+$$//" | sed "s/ \+$//" > CHANGELOG_
-
-#+END_SRC
-
-**** build commands [+1] :build:compile:
-***** _dub_ build rebuild :dub:
-****** all compiler builds :all:dmd:gdc:ldc:
-******* all builds
-******** default
-
-#+NAME: make_dub_upgrade
-#+BEGIN_SRC makefile
-dub_upgrade:
- $(DUB) upgrade
-
-#+END_SRC
-
-#+NAME: make_compile_compiler_default
-#+BEGIN_SRC makefile
-default: ldc
-
-#+END_SRC
-
-******** quick :quick:
-********* default :default:
-
-#+NAME: make_compile_compiler_all
-#+BEGIN_SRC makefile
-all: dmd ldc gdc
-
-all_ver: dmd_ver ldc_ver gdc_ver
-
-all_debug: dmd_debug gdc_debug ldc_debug
-
-#+END_SRC
-******** clean & tangle :clean:tangle:
-********* default :default:
-
-#+NAME: make_clean_tangle_compile_all_clean
-#+BEGIN_SRC makefile
-all_clean: clean tangle dmd ldc gdc
-
-all_ver_clean: clean tangle dmd_ver ldc_ver gdc_ver
-
-all_debug_ver: dmd_debug_ver gdc_debug_ver ldc_debug_ver
-
-all_debug_clean_ver: clean tangle dmd_debug_ver gdc_debug_ver ldc_debug_ver
-
-#+END_SRC
-
-****** individual compiler builds :each:
-******* dmd :dmd:
-******** quick builds :quick:
-
-#+NAME: make_dub_compile_dmd_default
-#+BEGIN_SRC makefile
-dmd: dub_upgrade
- $(DUB) --compiler=dmd --config=dmd --build=release-nobounds
- notify-send -t 0 'D dmd compiled test release executable ready' 'spine-dmd'
-
-dmd_debug:
- $(DUB) --compiler=dmd --config=dmd --build=debug
-
-# assumes git tags with program version
-dmd_ver: dub_upgrade
- $(DUB) --compiler=dmd --config=dmd-version
- mv bin/spine-dmd-ver bin-archive/spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd
- notify-send -t 0 'D dmd compiled test release executable ready' 'spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd'
-
-#+END_SRC
-
-******** clean & tangle :clean:tangle:
-
-#+NAME: make_dub_compile_dmd_release
-#+BEGIN_SRC makefile
-dmd_clean_ver: clean tangle dmd_ver
-
-dmd_rel: expunge skel tangle
- $(DUB) --compiler=dmd --config=spine-release
-
-dmd_rel_tangle: tangle
- $(DUB) --compiler=dmd --config=spine-dmd
-
-dmd_rel_expunge_tangle: expunge skel tangle dmd_rel_tangle
-
-dmd_debug_tangle: tangle
- $(DUB) --compiler=dmd --config=spine-dmd-debug
-
-#+END_SRC
-
-******* gdc :gdc:
-******** quick builds :quick:
-
-#+NAME: make_dub_compile_gdc_default
-#+BEGIN_SRC makefile
-gdc: dub_upgrade
- $(DUB) --compiler=gdc --config=gdc
- notify-send -t 0 'D gdc compiled test release executable ready' 'spine-gdc'
-
-gdc_debug:
- $(DUB) --compiler=gdc --config=gdc --build=debug
-
-# assumes git tags with program version
-gdc_ver: dub_upgrade
- $(DUB) --compiler=gdc --config=gdc-version
- mv bin/spine-gdc-ver bin-archive/spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc
- notify-send -t 0 'D gdc compiled test release executable ready' 'spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc'
-
-#+END_SRC
-
-******** clean & tangle :clean:tangle:
-
-#+NAME: make_dub_compile_gdc_release
-#+BEGIN_SRC makefile
-gdc_clean_ver: clean tangle gdc_ver
-
-gdc_rel: expunge skel tangle
- $(DUB) --compiler=gdc --config=spine-release
-
-gdc_rel_tangle: tangle
- $(DUB) --compiler=gdc --config=spine-gdc
-
-gdc_rel_expunge_tangle: expunge skel tangle gdc_rel_tangle
-
-gdc_debug_tangle: tangle
- $(DUB) --compiler=gdc --config=spine-gdc-debug
-
-#+END_SRC
-
-******* ldc :ldc:
-******** quick builds :quick:
-
-#+NAME: make_dub_compile_ldc_default
-#+BEGIN_SRC makefile
-ldc: dub_upgrade
- $(DUB) --compiler=ldc2 --config=ldc --build=release
- notify-send -t 0 'D ldc compiled test release executable ready' 'spine-ldc'
-
-ldc_debug:
- $(DUB) --compiler=ldc2 --config=ldc --build=debug
-
-# assumes git tags with program version
-ldc_ver: dub_upgrade
- $(DUB) --compiler=ldc2 --config=ldc-version
- mv bin/spine-ldc-ver bin-archive/spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc
- notify-send -t 0 'D ldc2 compiled test release executable ready' 'spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc'
-
-ldc_clean_ver: clean tangle ldc_ver
-
-#+END_SRC
-
-******** clean & tangle :clean:tangle:
-
-#+NAME: make_dub_compile_ldc_release
-#+BEGIN_SRC makefile
-ldc_rel: expunge skel tangle
- $(DUB) --compiler=ldc2 --config=spine-release
-
-ldc_rel_tangle: tangle
- $(DUB) --compiler=ldc2 --config=spine-ldc
-
-ldc_rel_expunge_tangle: expunge skel tangle ldc_rel_tangle
-
-ldc_debug_tangle: tangle
- $(DUB) --compiler=ldc2 --config=spine-ldc-debug
-
-#+END_SRC
-
-****** generic
-******* init clean distclean etc. :clean:
-
-#+NAME: make_initialization_operations_parts
-#+BEGIN_SRC makefile
-reinit: clean skel tangle
-
-skel:
- mkdir -p $(PRG_BINDIR); \
- mkdir -p $(PRG_BINDIR)-archive; \
- mkdir -p build; \
- mkdir -p views; \
- mkdir -p data; \
- mkdir -p sundry/misc/util/d/cgi/search/cgi-bin/src; \
- mkdir -p sundry/misc/util/d/tools/markup_conversion; \
- mkdir -p sundry/misc/editor-syntax-etc/emacs; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/syntax; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/colors; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/ftplugin; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/rc; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/templates; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR)/conf; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR)/io_in; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR)/io_out; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR)/meta; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR)/share; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR); \
- mkdir -p $(PRG_BINDIR);
-
-init: skel
-
-clean:
- rm -rf build; \
- rm -rf $(PRG_SRCDIR); \
- rm -rf $(PRG_DOCDIR);
-
-clean_bin:
- rm $(PRG_BINDIR)/*
-
-clean_src:
- rm -rf $(PRG_SRCDIR);
-
-clean_docs:
- rm -rf $(PRG_DOCDIR)
-
-expunge:
- rm -f dub.selections.json; \
- rm -rf build; \
- rm -rf $(PRG_SRCDIR); \
- rm -rf $(PRG_BINDIR); \
- rm -rf $(PRG_DOCDIR);
-
-distclean: expunge
-
-distclean_and_init: expunge
- mkdir -p views; \
- mkdir -p sundry/misc/util/d/cgi/search/cgi-bin/src; \
- mkdir -p sundry/misc/util/d/tools/markup_conversion; \
- mkdir -p sundry/misc/editor-syntax-etc/emacs; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/syntax; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/colors; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/ftplugin; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/rc; \
- mkdir -p sundry/misc/editor-syntax-etc/vim/templates; \
- mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR); \
- mkdir -p $(PRG_BINDIR);
-
-#+END_SRC
-
-******* version :version:
-
-#+NAME: make_initialization_operations_git_version
-#+BEGIN_SRC makefile
-ver:
- echo spine-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)
-
-#+END_SRC
-
-******* tangle build rebuild :clean:tangle:build:
-
-#+NAME: make_initialization_operations_assemble
-#+BEGIN_SRC makefile
-clean_tangle_build: clean tangle build
-
-tangle_build: tangle build
-
-build: $(PRG_SRCDIR)/$(PRG_SRC)
- $(DC) $(DC_FLAGS) \
- $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \
- $(PRG_SRCDIR)/$(PRG_SRC)
-
-rebuild: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_BINDIR)/$(PRG_BIN).o clean build
-
-makefile_new:
- make -k tangle_maker
-
-restart: clean tangle
-
-#+END_SRC
-
-**** get project dependencies
-
-#+NAME: make_get_project_dependencies_github
-#+BEGIN_SRC makefile
-get_depends:
- hwd=$$(echo `pwd`) && \
- gwd="$${hwd}/src/ext_depends" && \
- dirs=$$(echo `ls -gx $${gwd}`) && \
- license_bsl="Boost Software License 1.0 (BSL-1.0)" && \
- echo $${hwd} && \
- echo $${gwd} && \
- echo $${deps} && \
- dub upgrade; \
- cd $${gwd} && \
- for dir in $${deps}; do \
- if [ -d $${dir} ]; then \
- echo $${dir} && \
- if [ "imageformats" == $${dir} ]; then \
- echo $${dir} && \
- rm -rf $${dir} && \
- git clone --depth=1 https://github.com/tjhann/$${dir} && \
- cd $${dir} && \
- echo $$PWD && \
- echo "$${dir} `git rev-parse HEAD | cut -c 1-8`" > ../$${dir}.meta && \
- echo "https://github.com/tjhann/$${dir}" >> ../$${dir}.meta && \
- echo "$${license_bsl}" >> ../$${dir}.meta && \
- cd $${gwd} && \
- rm -rf $${dir}/.git; \
- elif [[ "d2sqlite3" == $${dir} ]]; then \
- echo $${dir} && \
- rm -rf $${dir} && \
- git clone --depth=1 https://github.com/dlang-community/$${dir} && \
- cd $${dir} && \
- echo "$${dir} `git rev-parse HEAD | cut -c 1-8`" > ../$${dir}.meta && \
- echo "https://github.com/dlang-community/$${dir}" >> ../$${dir}.meta && \
- echo "$${license_bsl}" >> ../$${dir}.meta && \
- cd $${gwd} && \
- rm -rf $${dir}/.git; \
- fi; \
- fi; \
- done; \
- cd $${hwd}
-
-set_depends: get_depends
- dub describe | sed 's~$(shell echo `pwd | sed 's_/_\\/_g'`)~.~g' > dub_describe.json
-
-rm_flakelock:
- git reset HEAD flake.lock && \
- touch flake.lock \
- git rm -f flake.lock
-
-flake_update:
- git add .; \
- nix flake lock && \
- git reset HEAD flake.lock; \
- cp flake.lock flake.lock_
-
-flake_update_move_lock: flake_update
- touch flake.lock \
- git rm -f flake.lock
-
-set_latest: set_depends flake_update rm_flakelock
-
-#+END_SRC
-
-gitDir=dub2nix; git clone --depth=1 https://github.com/lionello/${gitDir} | rm -rf ${gitDir}/.git
-
-**** _meson_ build :meson:
-
-meson using dub
-- works & looks pretty clean
-- but subprojects built externally & not suitable for debian packaging
-
-#+NAME: make_meson_build
-#+BEGIN_SRC makefile
-meson_clean_build_dir:
- rm -r build; mkdir build
-
-meson_build: meson_clean_build_dir
- meson --buildtype=debugoptimized build
- ninja -C build
- notify-send -t 0 'D meson build ldc compiled test release executable ready' 'spine'
-
-meson_redo: meson_clean_build_dir meson_build
-
-meson_project_build_clean: clean skel tangle dub_upgrade meson_build
-
-meson: meson_clean_build_dir dub_upgrade meson_build
-
-#+END_SRC
-
-**** testrun (program against document markup) :markup:sample:
-***** pods :pod:
-******* find files
-
-#+NAME: make_project_testrun_0_find_pods
-#+BEGIN_SRC makefile
-find_pods:
- $(SiSU_MARKUP_SAMPLES_FIND_PODS)
-
-#+END_SRC
-
-**** org babel tangle batch process command :tangle:
-***** tangle: org babel tangle *.org
-
-#+NAME: make_tangle_0
-#+BEGIN_SRC makefile
-tangle: skel
- for f in $(ORGFILELIST); do \
- ORGFILES="$$ORGFILES \"$$f\""; \
- 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 \"$(ORGDIR)\")) \
- (setq-local org-src-preserve-indentation t) \
- (org-babel-tangle) \
- (kill-buffer)) '($$ORGFILES)))" 2>&1
-
-#+END_SRC
-
-***** tangle maker: org babel tangle makefile new
-
-#+NAME: make_tangle_1
-#+BEGIN_SRC makefile
-tangle_maker:
- for f in $(ORGFILELIST); do \
- ORGFILES="\"org/dr_build_scaffold.org\""; \
- 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 \".\")) \
- (setq-local org-src-preserve-indentation t) \
- (org-babel-tangle) \
- (kill-buffer)) '($$ORGFILES)))" 2>&1
-
-#+END_SRC
-
-**** git snapshot
-
-#+NAME: make_git_snapshot
-#+BEGIN_SRC makefile
-gitsnapshot: distclean tangle
- git commit -a
-
-#+END_SRC
-
-*** phony :phony:
-
-#+NAME: make_phony
-#+BEGIN_SRC makefile
-.PHONY : all build rebuild debug release \
- distclean init \
- tangle gitsnapshot
-
-#+END_SRC
-
* dr spine_search
** spine_search makefile :makefile
*** tangle
-
#+HEADER: :tangle ../makefile
#+HEADER: :noweb yes
#+BEGIN_SRC makefile
-<<make_cgi_search_makefile>>
-<<make_set_nix>>
-<<make_get_project_cgi_search_dependencies_github>>
-<<make_copy_cgi_search>>
-#+END_SRC
-
-*** make
-
-#+NAME: make_cgi_search_makefile
-#+BEGIN_SRC makefile
SpineBIN := "${SpineBIN}" # 'result/bin'
SpineOUT := "${SpineOUT}" # '/srv/www/spine'
SpinePOD := "${SpinePOD}" # '~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod'
@@ -664,49 +54,40 @@ SpineSearchAction := 'https://sisudoc.org/spine_search'
SpineCGIform := 'spine_search'
SpineSQLdb := 'spine.search.db'
-#+END_SRC
+default: flake-check
-**** nix
+flake-check:
+ nix flake update; \
+ nix flake check; \
+ echo -e 'nix flake show ❯❯\n'; \
+ nix flake show; \
+ echo -e '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh\n'; \
+ echo -e '❯❯ nix develop\n❯❯ nix develop -c zsh\n'; \
+ echo -e '❯❯ nix build ".#spine-ldc" --print-build-logs |& nom\n❯❯ nix build ".#spine-dmd" --print-build-logs |& nom\n'; \
+ echo -e '❯❯ make -s\n❯❯ make -s nix-build-ldc\n❯❯ make -s nix-build-dmd\n'; \
+ echo -e '❯❯ make -s ldc\n❯❯ make -s dmd\n'; \
+ echo -e '❯❯ $(DUB) --compiler=ldc2 --build=ldc2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n';
-#+NAME: make_set_nix
-#+BEGIN_SRC makefile
nix-devshell:
- echo -ne "\n- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell\n\n- nix build .#default --print-build-logs\n- nix build .#spine-search-dmd --print-build-logs\n- nix build .#spine-search-ldc --print-build-logs\n- nix build .#spine-search-gdc --print-build-logs\n\n"; \
- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+ echo -ne '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"\n\n❯❯ nix build ".#default" --print-build-logs\n❯❯ nix build ".#spine-search-dmd" --print-build-logs\n❯❯ nix build ".#spine-search-ldc" --print-build-logs\n❯❯ nix build ".#spine-search-gdc" --print-build-logs\n\n'; \
+ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"
# nix build
build:
nix-build
nix-build-default:
- nix build .#default --print-build-logs
+ nix build ".#default" --print-build-logs
nix-build-dmd:
- nix build .#spine-dmd --print-build-logs
+ nix build ".#spine-search-dmd" --print-build-logs
nix-build-ldc:
- nix build .#spine-ldc --print-build-logs
+ nix build ".#spine-search-ldc" --print-build-logs
nix-build-gdc:
- nix build .#spine-gdc --print-build-logs
-
-#+END_SRC
-
-**** post build copy
+ nix build ".#spine-search-gdc" --print-build-logs
-#+NAME: make_copy_cgi_search
-#+BEGIN_SRC makefile
-# cp cgi search form
-cp-cgi:
- sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \
- sudo cp -vi result/share/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search
-
-#+END_SRC
-
-*** get project dependencies
-
-#+NAME: make_get_project_cgi_search_dependencies_github
-#+BEGIN_SRC makefile
get_depends:
hwd=$$(echo `pwd`) && \
gwd="$${hwd}/src/ext_depends" && \
@@ -744,24 +125,8 @@ get_depends:
set_depends: get_depends
dub describe | sed 's~$(shell echo `pwd | sed 's_/_\\/_g'`)~.~g' > dub_describe.json
+# cp cgi search form
+cp-cgi:
+ sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \
+ sudo cp -vi result/share/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search
#+END_SRC
-
-** .env/local
-
-#+HEADER: :NO-tangle ../sundry/spine_search_cgi/.env/local
-#+BEGIN_SRC nix
-export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos
-#+END_SRC
-
-* www dr spine latex
-
-- /srv/www/spine/latex
-
-** notes
-
-- vim {the_wealth_of_networks.yochai_benkler,two_bits.christopher_kelty,viral_spiral.david_bollier}.en.a4.portrait.tex
-- emacs {the_wealth_of_networks.yochai_benkler,two_bits.christopher_kelty,viral_spiral.david_bollier}.en.a4.portrait.tex
-
-- evince the_wealth_of_networks.yochai_benkler.en.a4.portrait.pdf
-- evince two_bits.christopher_kelty.en.a4.portrait.pdf
-- evince viral_spiral.david_bollier.en.a4.portrait.pdf
diff --git a/org/config_nix.org b/org/config_nix.org
index 5950ee9..ab9f081 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -6,7 +6,7 @@
#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+COPYRIGHT: Copyright (C) 2015 - 2023 Ralph Amissah
#+LANGUAGE: en
-#+STARTUP: content hideblocks hidestars noindent entitiespretty
+#+STARTUP: show4levels hideblocks hidestars noindent entitiespretty
#+PROPERTY: header-args :exports code
#+PROPERTY: header-args+ :noweb yes
#+PROPERTY: header-args+ :results no
@@ -81,37 +81,18 @@ nix show-derivation /nix/store/q7n14bm8j5vzm62qaraczdb4bpyf59vv-spine-0.11.1.drv
use flake .
#use flake .#default
NIX_ENFORCE_PURITY=1
+# - https://github.com/nix-community/nix-direnv
NixDirEnvVersion="2.2.1"
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
-# - https://github.com/nix-community/nix-direnv
# source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-0000000000000000000000000000000000000000000="
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
watch_file flake.lock
watch_file flake.nix
-#nix flake update && nix flake check --show-trace && nix flake show
+watch_file makefile
if [ -f .envrc-local ]; then
source_env_if_exists .envrc-local || source .envrc-local
fi
-# echo "
-#
-# - nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
-#
-# - nix build .#default --print-build-logs
-# - nix build .#spine-search-ldc --print-build-logs
-# - nix build .#spine-search-dmd --print-build-logs
-# - nix build .#spine-search-gdc --print-build-logs
-#
-# nix-shell '<nixpkgs>' -A nix --pure
-#
-# nix run .#default --print-build-logs
-#
-# nix develop --build .#default --print-build-logs
-#
-# nix shell .#default --print-build-logs --command spine -v
-# nix shell .#default --print-build-logs --command spine --very-verbose --epub --html --html-link-search --html-link-curate --curate --output=\"\$SpineOUT\" ./markup/pod
-# nix shell .#default --print-build-logs --command spine --very-verbose --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename=\"spine.search.db\" --cgi-sqlite-search-filename=\"spine_search\" --sqlite-db-path=\"\$SpineDBpath\" --output=\"\$SpineOUT\" ./markup/pod
-# "
#+END_SRC
**** .envrc-local CHECK MODIFY
@@ -174,8 +155,7 @@ postInstall:
#+END_SRC
*** flake :flake:
-**** flake static :flake:static:
-***** flake.nix
+**** flake.nix
#+HEADER: :tangle ../flake.nix
#+HEADER: :noweb yes
@@ -219,7 +199,7 @@ postInstall:
inherit shell;
inherit devEnv;
buildInputs = [ sqlite ];
- nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ];
+ nativeBuildInputs = [ dub ldc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ];
buildPhase = ''
runHook preBuild
for DC_ in dmd ldmd2 ldc2 gdc gdmd; do
@@ -274,25 +254,25 @@ postInstall:
inherit installPhase;
inherit postInstall;
};
- spine-search-gdc = stdenv.mkDerivation {
- inherit pname;
- inherit version;
- meta.mainProgram = "spine_search-gdc";
- executable = true;
- src = self;
- inherit shell;
- inherit devEnv;
- buildInputs = [ sqlite ];
- nativeBuildInputs = [ dub gdc gnumake ];
- buildPhase = ''
- runHook preBuild
- dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all
- runHook postBuild
- '';
- inherit checkPhase;
- inherit installPhase;
- inherit postInstall;
- };
+ #spine-search-gdc = stdenv.mkDerivation {
+ # inherit pname;
+ # inherit version;
+ # meta.mainProgram = "spine_search-gdc";
+ # executable = true;
+ # src = self;
+ # inherit shell;
+ # inherit devEnv;
+ # buildInputs = [ sqlite ];
+ # nativeBuildInputs = [ dub gdc gnumake ];
+ # buildPhase = ''
+ # runHook preBuild
+ # dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all
+ # runHook postBuild
+ # '';
+ # inherit checkPhase;
+ # inherit installPhase;
+ # inherit postInstall;
+ #};
#vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000=";
});
devShells = forAllSystems (system:
@@ -323,28 +303,29 @@ postInstall:
#export spineSqlite="spine --very-verbose --sqlite-update --sqlite-db-path=\"$SpineDBpath\" --sqlite-db-filename=\"spine.search.db\" --output=\"\$SpineOUT\" $SpinePOD/*"
'';
in with pkgs; {
- devShell = mkShell rec {
- name = "spine dev shell default";
+ devShell = mkShell {
+ name = "spine base dev shell";
inherit shell;
inherit devEnv;
#buildInputs = [ sqlite ];
#nativeBuildInputs = [ dub dmd ldc gdc gnumake ];
packages = [
sqlite
- dub dmd ldc gdc gnumake
+ dub dmd ldc gnumake
];
inherit shellHook;
};
- devShell-sqlite = mkShell rec {
- name = "spine dev shell for latex & pdf output";
+ devShell-sqlite = mkShell {
+ name = "spine dev shell for latex & pdf output";
inherit shell;
inherit devEnv;
- packages = [
+ packages = [
+ dub dmd ldc gnumake
sqlite
- dub dmd ldc gdc gnumake
];
inherit shellHook;
};
+ default = import ./shell.nix { inherit pkgs; };
});
};
}
@@ -509,79 +490,55 @@ postInstall = ''
with pkgs;
mkShell {
buildInputs = [
+ # ❯❯❯ nix_related
+ #nix
direnv
+ #cachix
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
- nix-tree jq nix-output-monitor
+ nix-output-monitor
+ nix-tree
+ jq
git
gnumake
ps
- ### d_build_related
+ # ❯❯❯ d_build_related
+ # ❯❯ package manager
dub
- ## compiler
+ # ❯❯ compiler
ldc
rund
- ## linker
+ # ❯❯ linker
#lld
#mold
- ## builder
+ # ❯❯ builder
#ninja
#meson
- ### sqlite search related
+ # ❯❯❯ sqlite search related
sqlite
- ### tools
+ # ❯❯❯ tools
#aria #wget #curl
- ### candy
- #starship
];
shellHook = ''
- #if [[ -f ".envrc" ]]; then
- # source .envrc
- #fi
nix flake update
- echo ""
- echo "nix flake metadata:"
- nix flake metadata
- echo ""
- echo "nix flake check:"
nix flake check
- echo ""
- echo "nix flake show:"
nix flake show
- echo "
- nix flake update
- nix flake metadata
- nix flake check
- nix flake show
-
- nix build or nix develop? (suggestions):
-
- - nix build
- nix build .#default --print-build-logs
- nix build --print-build-logs
- nix build .#default --print-build-logs |& nom
-
- - nix run
- nix run .#default --print-build-logs
- nix run default.nix --print-build-logs
-
- - nix shell
- nix shell --print-build-logs
+ echo '
+ shell.nix echo ❯❯
- - nix develop
- nix develop --build .#default --print-build-logs
- nix develop --build -f derivation.nix -I .envrc --print-build-logs
- nix develop ; eval \$buildPhase
+ ❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh
- nix-build |& nom
+ ❯❯ nix develop
+ ❯❯ nix develop -c zsh
- nix-instantiate | nix show-derivation | jq
- nix-build . --no-out-link | xargs -o nix-tree
- nix-tree --derivation .#spine_search
+ ❯❯ nix build
+ ❯❯ nix build ".#default" --print-build-logs
+ ❯❯ nix build ".#spine-search-dmd" --print-build-logs |& nom
+ ❯❯ nix build ".#spine-search-ldc" --print-build-logs |& nom
- dub build --compiler=ldmd --build=release --combined --skip-registry=all
- "
+ ❯❯ dub build --compiler=ldmd --build=release --combined --skip-registry=all
+ '
'';
}
#+END_SRC
@@ -638,13 +595,13 @@ echo "ldc `${pkgs.ldc}/bin/ldc2 -v`"
# - nix build `nix-instantiate -I .envrc`
# - nix build -f default.nix && ./result/bin/spine -v && noti -t "spine build" -m "see ./result/bin/spine"
- # - nix build .#spine
+ # - nix build .#default
# [ nix run ]
# - nix run default.nix --print-build-logs
# - nix run -I .envrc default.nix --print-build-logs
- # - nix run .#spine
+ # - nix run .#default
# - nix-shell -I .envrc --pure
# - nix develop --build -f derivation.nix -I .envrc --print-build-logs
@@ -710,100 +667,6 @@ echo "ldc `${pkgs.ldc}/bin/ldc2 -v`"
./result/bin/spine
#+END_SRC
-**** shell parts (packages)
-***** packages nix related
-
-#+NAME: shell_packages_nix_related
-#+BEGIN_SRC nix
-### nix_related
-direnv
-nixVersions.unstable #nixFlakes
-nix-prefetch-git
-validatePkgConfig
-jq
-git
-ps
-#+END_SRC
-
-***** packages d build related
-
-#+NAME: shell_packages_d_build_related
-#+BEGIN_SRC nix
-### d_build_related
-## package manager
-dub
-## compiler
-ldc
-rund
-## linker
-#lld
-#mold
-## builder
-#ninja
-#meson
-#+END_SRC
-
-***** packages tools
-
-#+NAME: shell_packages_tool_download
-#+BEGIN_SRC nix
-### tools
-#curl
-#wget
-aria
-#+END_SRC
-
-***** packages candy
-
-#+NAME: shell_packages_candy
-#+BEGIN_SRC nix
-### candy
-starship
-#+END_SRC
-
-***** packages search sqlite related
-
-#+NAME: shell_packages_search_related_sqlite
-#+BEGIN_SRC nix
-### sqlite search related
-sqlite
-#+END_SRC
-
-***** packages pdf latex related
-
-#+NAME: shell_packages_pdf_latex_related
-#+BEGIN_SRC nix
-### pdf_latex_related
-source-sans-pro
-source-serif-pro
-source-code-pro
-texlive.combined.scheme-full
-#+END_SRC
-
-***** packages xml epub related
-
-#+NAME: shell_packages_xml_and_epub_related
-#+BEGIN_SRC nix
-### xml_and_epub_related
-libxml2
-html-tidy
-xmlstarlet
-epubcheck
-ebook_tools
-epr
-sigil
-calibre #(suite includes: ebook-viewer)
-foliate
-#+END_SRC
-
-***** packages i18n_translation related
-
-#+NAME: shell_packages_i18n_translation
-#+BEGIN_SRC nix
-### i18n translation related
-perl534Packages.Po4a
-#+END_SRC
-
*** default.nix :default:
- default.nix -I nixpkgs=<provide local nix path>
@@ -847,35 +710,34 @@ pkgs.callPackage ./derivation.nix {}
*** devenv.nix :default:devenv:
#+HEADER: :tangle ../devenv.nix
-#+HEADER: :tangle-mode (identity #o755)
+#+HEADER: :tangle-mode (identity #o644)
#+BEGIN_SRC nix
-{ pkgs ? import <nixpkgs> { }, name ? "user-env" }: with pkgs;
+{ pkgs ? import <nixpkgs> { }, name ? "user-env" }:
+with pkgs;
buildEnv {
inherit name;
extraOutputsToInstall = [ "out" "man" "lib" ]; # to get all needed symlinks
paths = [
+ # ❯❯❯ nix_related
#nix # if not on NixOS, this is needed
direnv
+ #cachix
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
- nix-tree jq nix-output-monitor
+ nix-output-monitor
+ nix-tree
+ jq
git
+ gnumake
ps
- ### d_build_related
+ # ❯❯❯ d_build_related
+ # ❯❯ package manager
dub
- ## compiler
+ # ❯❯ compiler
dmd
ldc
- #gdc
- #rund
- ## linker
- #lld
- #mold
- ## builder
- #ninja
- #meson
- ### sqlite search related
+ # ❯❯❯ sqlite search related
sqlite
# this will create a script that will rebuild and upgrade your setup; using shell script syntax
(writeScriptBin "nix-rebuild" ''
@@ -885,11 +747,11 @@ buildEnv {
nix profile upgrade '.*'
'')
# puts in your root the nixpkgs version
- (writeTextFile {
+ (writeTextFile {
name = "nixpkgs-version";
destination = "/nixpkgs-version";
text = lib.version;
- })
+ })
];
}
#+END_SRC
@@ -1011,7 +873,7 @@ mkDubDerivation rec {
homepage = "https://sisudoc.org";
description = "cgi sqlite search form for document object search";
longDescription = ''
- a sisu like parser and document generator
+ a sisu like parser & document generator
'';
homepage = "https://sisudoc.org";
license = licenses.agpl3Plus;
@@ -1144,6 +1006,8 @@ ldc
sqlite
nix-prefetch-git
validatePkgConfig
+nix-output-monitor
+nix-tree
jq
git
#+END_SRC
@@ -1285,6 +1149,8 @@ pkgs.mkShell {
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
+ nix-output-monitor
+ nix-tree
jq
git
fontconfig
diff --git a/shell.nix b/shell.nix
index d9a37e7..8d61170 100755
--- a/shell.nix
+++ b/shell.nix
@@ -4,78 +4,54 @@
with pkgs;
mkShell {
buildInputs = [
+ # ❯❯❯ nix_related
+ #nix
direnv
+ #cachix
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
- nix-tree jq nix-output-monitor
+ nix-output-monitor
+ nix-tree
+ jq
git
gnumake
ps
- ### d_build_related
+ # ❯❯❯ d_build_related
+ # ❯❯ package manager
dub
- ## compiler
+ # ❯❯ compiler
ldc
rund
- ## linker
+ # ❯❯ linker
#lld
#mold
- ## builder
+ # ❯❯ builder
#ninja
#meson
- ### sqlite search related
+ # ❯❯❯ sqlite search related
sqlite
- ### tools
+ # ❯❯❯ tools
#aria #wget #curl
- ### candy
- #starship
];
shellHook = ''
- #if [[ -f ".envrc" ]]; then
- # source .envrc
- #fi
nix flake update
- echo ""
- echo "nix flake metadata:"
- nix flake metadata
- echo ""
- echo "nix flake check:"
nix flake check
- echo ""
- echo "nix flake show:"
nix flake show
- echo "
- nix flake update
- nix flake metadata
- nix flake check
- nix flake show
+ echo '
+ shell.nix echo ❯❯
- nix build or nix develop? (suggestions):
+ ❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh
- - nix build
- nix build .#default --print-build-logs
- nix build --print-build-logs
- nix build .#default --print-build-logs |& nom
+ ❯❯ nix develop
+ ❯❯ nix develop -c zsh
- - nix run
- nix run .#default --print-build-logs
- nix run default.nix --print-build-logs
+ ❯❯ nix build
+ ❯❯ nix build ".#default" --print-build-logs
+ ❯❯ nix build ".#spine-search-dmd" --print-build-logs |& nom
+ ❯❯ nix build ".#spine-search-ldc" --print-build-logs |& nom
- - nix shell
- nix shell --print-build-logs
-
- - nix develop
- nix develop --build .#default --print-build-logs
- nix develop --build -f derivation.nix -I .envrc --print-build-logs
- nix develop ; eval \$buildPhase
-
- nix-build |& nom
-
- nix-instantiate | nix show-derivation | jq
- nix-build . --no-out-link | xargs -o nix-tree
- nix-tree --derivation .#spine_search
-
- dub build --compiler=ldmd --build=release --combined --skip-registry=all
- "
+ ❯❯ dub build --compiler=ldmd --build=release --combined --skip-registry=all
+ '
'';
}