From 2c95e88e40ff3cf021eb9e2e0b7a87f68d5e1e37 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 6 Mar 2020 15:11:55 -0500 Subject: meson using dub - the good - works - project looks pretty clean - the bad - subprojects built externally - not suitable for debian packaging --- org/spine_build_scaffold.org | 264 +++++++++++++++++++------------------------ 1 file changed, 119 insertions(+), 145 deletions(-) (limited to 'org/spine_build_scaffold.org') diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index e594fe0..863dd25 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -200,37 +200,20 @@ all_debug: dmd_debug gdc_debug ldc_debug ******** _meson_ build :meson: -- bug in build of imageformats > v7.0.0 (currently at 7.0.2) - (try fix meson/ninja/ld.gold for imageformats HEAD) +meson using dub +- works & looks pretty clean +- but subprojects built externally & not suitable for debian packaging #+BEGIN_SRC makefile :tangle ../makefile meson_clean_build_dir: rm -r build; mkdir build -meson_get_subprojects: meson_clean_build_dir - rm -rf subprojects/d2sqlite3; rm -rf subprojects/imageformats - rm -rf subprojects/dyaml; rm -rf subprojects/tinyendian - git clone https://github.com/biozic/d2sqlite3.git subprojects/d2sqlite3 - git clone https://github.com/lgvz/imageformats.git subprojects/imageformats - cd subprojects/d2sqlite3; \ - git checkout -b add_meson_build_patch; \ - cp ../d2sqlite3.meson.build meson.build; \ - git add . ; git commit -m"project meson.build added"; \ - cd ../.. - cd subprojects/imageformats; \ - git checkout -b add_meson_build_patch; \ - cp ../imageformats.meson.build meson.build; \ - git add . ; git commit -m"project meson.build added"; \ - cd ../.. -mesonclean: clean skel tangle dub_upgrade - meson --buildtype=debugoptimized build - ninja -C 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_upgrade: dub_upgrade meson_get_subprojects -meson_upgrade_and_build: dub_upgrade meson_get_subprojects meson_clean_build_dir meson_build -meson: meson_clean_build_dir meson_build +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 ******* clean & tangle :clean:tangle: @@ -386,7 +369,6 @@ skel: mkdir -p $(PRG_BINDIR); \ mkdir -p $(PRG_BINDIR)-archive; \ mkdir -p build; \ - mkdir -p subprojects; \ mkdir -p views; \ mkdir -p data; \ mkdir -p util; \ @@ -400,7 +382,6 @@ skel: init: skel clean: rm -rf build; \ - rm -rf subprojects; \ rm -rf $(PRG_SRCDIR); \ rm -rf $(PRG_DOCDIR); clean_bin: @@ -412,7 +393,6 @@ clean_docs: expunge: rm -f dub.selections.json; \ rm -rf build; \ - rm -rf subprojects; \ rm -rf $(PRG_SRCDIR); \ rm -rf $(PRG_BINDIR); \ rm -rf $(PRG_DOCDIR); @@ -1086,15 +1066,17 @@ spine_sources = [ source_root = meson.source_root() sources_dir = include_directories('src/') # Dependencies -dep_dyaml = dependency('dyaml', version: '>= 0.8.0', fallback: ['dyaml', 'dyaml_dep']) -dep_d2sqlite3 = dependency('d2sqlite3', version: '>= 0.18.3', fallback: ['d2sqlite3', 'd2sqlite3_dep']) -dep_imageformats = dependency('imageformats', version: '>= 7.0.2', fallback: ['imageformats', 'imageformats_dep']) +dep_tinyendian = dependency('tinyendian', version: '>= 0.2.0', fallback: ['tinyendian', 'tinyendian_dep'], method: 'dub') +dep_dyaml = dependency('dyaml', version: '>= 0.8.0', fallback: ['dyaml', 'dyaml_dep'], method: 'dub') +dep_d2sqlite3 = dependency('d2sqlite3', version: '>= 0.18.3', fallback: ['d2sqlite3', 'd2sqlite3_dep'], method: 'dub') +dep_imageformats = dependency('imageformats', version: '>= 7.0.2', fallback: ['imageformats', 'imageformats_dep'], method: 'dub') # Executable spine_exe = executable('spine', [spine_sources], include_directories : [sources_dir], d_import_dirs: [include_directories('views')], dependencies : [ + dep_tinyendian, dep_dyaml, dep_d2sqlite3, dep_imageformats, @@ -1105,7 +1087,7 @@ spine_exe = executable('spine', ** subprojects -#+BEGIN_SRC txt :tangle ../subprojects/README +#+BEGIN_SRC txt :NO-tangle ../subprojects/README - d2sqlite3 - dub - https://code.dlang.org/packages/d2sqlite3 @@ -1130,6 +1112,110 @@ spine_exe = executable('spine', - https://github.com/dlang-community/tinyendian.git #+END_SRC +* .gitignore :gitignore: + +#+BEGIN_SRC sh :tangle ../.gitignore +# git ls-files --others --exclude-from=.git/info/exclude +#./.dub/** +* +!.gitignore +!COPYRIGHT +!README +!makefile +!version.txt +!dub.json +!dub.sdl +!meson.build +!tangle +!*.org +!*.d +!*.rb +!conf.sdl +!org +!util +!src +!src/doc_reform +!src/doc_reform/* +!src_yaml +!src_yaml/doc_reform +!src_yaml/doc_reform/* +!data +!data/* +!data/src/** +!data/src_yaml/** +!data/pod/** +!data/pod_yaml/** +!*.sst +!*.ssm +!**/*.sst +!**/*.ssm +!pod.manifest +!sisu_document_make +!config_local_site +!sisudoc +!views +!docs/*.html +!notes +notes/** +!notes/*.org +!notes/sisu-description.sst +!notes/reminders +!notes/reminders/** +.dub/** +tmp/** +*_.org +*_.d +*_.txt +*_ +*~ +\#* +*.\#* +#!*/ +#*~ +#\#* +#*.\#* +#!debian +#!debian/** +#.reggae/** +#+END_SRC + +* sh script to batch process _emacs org babel tangle_ :shell_script:tangle: + [[http://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) + +#+BEGIN_SRC sh :tangle ../tangle :tangle-mode (identity #o755) :shebang #!/bin/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 + +* __END__ + +** meson subprojects [now taken care of using dub] *** d2sqlite3 **** wrap @@ -1138,12 +1224,11 @@ spine_exe = executable('spine', directory = d2sqlite3 url = https://github.com/biozic/d2sqlite3.git revision = head -# revision = add_meson_build_patch #+END_SRC **** meson.build -#+BEGIN_SRC sh :tangle ../subprojects/d2sqlite3.meson.build +#+BEGIN_SRC sh :NO-tangle ../subprojects/d2sqlite3.meson.build project('d2sqlite3', 'd', meson_version: '>=0.46', license: 'BSL-1.0', @@ -1197,7 +1282,7 @@ d2sqlite3_dep = declare_dependency( *** dyaml **** wrap -#+BEGIN_SRC sh :tangle ../subprojects/dyaml.wrap +#+BEGIN_SRC sh :NO-tangle ../subprojects/dyaml.wrap [wrap-git] directory = dyaml url = https://github.com/dlang-community/D-YAML.git @@ -1287,12 +1372,11 @@ dyaml_dep = declare_dependency( directory = imageformats url = https://github.com/lgvz/imageformats.git revision = head -# revision = add_meson_build_patch #+END_SRC **** meson.build -#+BEGIN_SRC sh :tangle ../subprojects/imageformats.meson.build +#+BEGIN_SRC sh :NO-tangle ../subprojects/imageformats.meson.build project('imageformats', 'd', meson_version: '>=0.46', license: 'BSL-1.0', @@ -1391,116 +1475,6 @@ tinyendian_dep = declare_dependency( ) #+END_SRC -* .gitignore :gitignore: - -#+BEGIN_SRC sh :tangle ../.gitignore -# git ls-files --others --exclude-from=.git/info/exclude -#./.dub/** -* -!.gitignore -!COPYRIGHT -!README -!makefile -!version.txt -!dub.json -!dub.sdl -!meson.build -!tangle -!*.org -!*.d -!*.rb -!conf.sdl -!org -!util -!src -!src/doc_reform -!src/doc_reform/* -!src_yaml -!src_yaml/doc_reform -!src_yaml/doc_reform/* -!data -!data/* -!data/src/** -!data/src_yaml/** -!data/pod/** -!data/pod_yaml/** -!*.sst -!*.ssm -!**/*.sst -!**/*.ssm -!subprojects -!subprojects/*.wrap -!subprojects/*.meson.build -# !subprojects/dyaml -# !subprojects/d2sqlite3 -# !subprojects/imageformats -# !subprojects/tinyendian -subprojects/*/.gitignore -!pod.manifest -!sisu_document_make -!config_local_site -!sisudoc -!views -!docs/*.html -!notes -notes/** -!notes/*.org -!notes/sisu-description.sst -!notes/reminders -!notes/reminders/** -.dub/** -tmp/** -*_.org -*_.d -*_.txt -*_ -*~ -\#* -*.\#* -#!*/ -#*~ -#\#* -#*.\#* -#!debian -#!debian/** -#.reggae/** -#+END_SRC - -* sh script to batch process _emacs org babel tangle_ :shell_script:tangle: - [[http://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) - -#+BEGIN_SRC sh :tangle ../tangle :tangle-mode (identity #o755) :shebang #!/bin/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 - -* __END__ ** build *** dub -- cgit v1.2.3