aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/config_make.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-12-19 21:27:17 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-12-31 21:55:43 -0500
commitda6f5d079e01906fb5dc558390659557a869df8f (patch)
tree35b99248cf1ba78b52474bea960f92984ff721c7 /org/config_make.org
parentsort how you want this to be (diff)
nix flake, things nix
Diffstat (limited to 'org/config_make.org')
-rw-r--r--org/config_make.org748
1 files changed, 748 insertions, 0 deletions
diff --git a/org/config_make.org b/org/config_make.org
new file mode 100644
index 0000000..f2ea5af
--- /dev/null
+++ b/org/config_make.org
@@ -0,0 +1,748 @@
+-*- mode: org -*-
+#+TITLE: spine (doc_reform) (project) makefile
+#+DESCRIPTION: makefile for spine
+#+FILETAGS: :spine:build:tools:
+#+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
+
+- [[./doc-reform.org][doc-reform.org]] [[../org/][org/]]
+
+* project
+** version info SET VERSION :version:set:project:
+*** project SET VERSION
+
+#+NAME: spine_version_set
+#+BEGIN_SRC sh
+0.12.0
+#+END_SRC
+
+*** build tools if specified
+
+- meson
+
+#+NAME: meson_version_set
+#+BEGIN_SRC sh
+0.46
+#+END_SRC
+
+- soversion
+
+#+NAME: soversion_version_set
+#+BEGIN_SRC sh
+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'
+
+# nix build
+build:
+ nix-build
+
+# 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
+
+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_get_project_cgi_search_dependencies_github>>
+#+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'
+SpineSearchAction := 'https://sisudoc.org/spine_search'
+SpineCGIform := 'spine_search'
+SpineSQLdb := 'spine.search.db'
+
+# nix build
+build:
+ nix-build
+
+# 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" && \
+ 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
+
+** .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
+
+** make
+
+** 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