From 6a5c473653f03aee818d835b53ca30b62a3be6c7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 May 2020 17:11:53 -0400 Subject: meson using subproject directory, not dub directly - will not work until meson.build files in - d2sqlite3 - imageformats (request adding upstream) - dyaml and its dependency tinyendian already provide their meson.build (should probably revert to meson dub until resolved) - based on 1468425 meson build (no issue now with imagefomats using 7.0.2) --- .gitignore | 3 + meson.build | 16 +-- org/spine_build_scaffold.org | 254 ++++++++++++++++++----------------- subprojects/README | 22 +++ subprojects/d2sqlite3.meson.build | 48 +++++++ subprojects/d2sqlite3.wrap | 4 + subprojects/dyaml.wrap | 4 + subprojects/imageformats.meson.build | 40 ++++++ subprojects/imageformats.wrap | 4 + subprojects/tinyendian.wrap | 4 + 10 files changed, 268 insertions(+), 131 deletions(-) create mode 100644 subprojects/README create mode 100644 subprojects/d2sqlite3.meson.build create mode 100644 subprojects/d2sqlite3.wrap create mode 100644 subprojects/dyaml.wrap create mode 100644 subprojects/imageformats.meson.build create mode 100644 subprojects/imageformats.wrap create mode 100644 subprojects/tinyendian.wrap diff --git a/.gitignore b/.gitignore index d95b6ee..f9f3687 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,9 @@ !*.ssm !**/*.sst !**/*.ssm +!subprojects +!subprojects/*.wrap +!subprojects/*.meson.build !pod.manifest !sisu_document_make !config_local_site diff --git a/meson.build b/meson.build index 74ad756..76e0782 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('spine', 'd', #if meson.get_compiler('d').get_id() == 'gcc' # error('spine cannot be compiled with GDC at time. Sorry.') #endif -spine_sources = [ +spine_src = [ 'src/doc_reform/spine.d', 'src/doc_reform/conf/compile_time_info.d', 'src/doc_reform/io_in/paths_source.d', @@ -48,16 +48,16 @@ spine_sources = [ 'src/doc_reform/share/defaults.d', ] source_root = meson.source_root() -sources_dir = include_directories('src/') +src_dir = include_directories('src/', 'subprojects/') # Dependencies -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') +dep_tinyendian = dependency('tinyendian', version: '>= 0.2.0', fallback: ['tinyendian', 'tinyendian_dep']) +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']) # Executable spine_exe = executable('spine', - [spine_sources], - include_directories : [sources_dir], + [spine_src], + include_directories : [src_dir], d_import_dirs: [include_directories('views')], dependencies : [ dep_tinyendian, diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index 22e156e..49716d9 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -1022,12 +1022,15 @@ http://mesonbuild.com/Dependencies.html#Dub ls -1 ./src/*/**/*.d tree -fi ./src |rg "\.d$" +fdfind -e .d tree -if src | rg ".+\.d$" > spine_sources.txt && \ for i in spine_sources.txt; do; \ sed -i "s/\(.\+\.d$\)/ '\1',/g" $i; done && \ cat spine_sources.txt +**** project meson.build + #+BEGIN_SRC sh :tangle ../meson.build project('spine', 'd', license: 'AGPL-3', @@ -1037,7 +1040,7 @@ project('spine', 'd', #if meson.get_compiler('d').get_id() == 'gcc' # error('spine cannot be compiled with GDC at time. Sorry.') #endif -spine_sources = [ +spine_src = [ 'src/doc_reform/spine.d', 'src/doc_reform/conf/compile_time_info.d', 'src/doc_reform/io_in/paths_source.d', @@ -1079,16 +1082,16 @@ spine_sources = [ 'src/doc_reform/share/defaults.d', ] source_root = meson.source_root() -sources_dir = include_directories('src/') +src_dir = include_directories('src/', 'subprojects/') # Dependencies -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') +dep_tinyendian = dependency('tinyendian', version: '>= 0.2.0', fallback: ['tinyendian', 'tinyendian_dep']) +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']) # Executable spine_exe = executable('spine', - [spine_sources], - include_directories : [sources_dir], + [spine_src], + include_directories : [src_dir], d_import_dirs: [include_directories('views')], dependencies : [ dep_tinyendian, @@ -1100,9 +1103,10 @@ spine_exe = executable('spine', ) #+END_SRC -** subprojects +** meson subprojects [can be taken care of using dub] +*** README -#+BEGIN_SRC txt :NO-tangle ../subprojects/README +#+BEGIN_SRC txt :tangle ../subprojects/README - d2sqlite3 - dub - https://code.dlang.org/packages/d2sqlite3 @@ -1127,117 +1131,10 @@ 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 -!doc -!doc/** -!man -!man/** -!org -!misc -!misc/** -!src -!src/** -!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/** -**/.dub/** -**/cgi-bin/** -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 -#+BEGIN_SRC sh :NO-tangle ../subprojects/d2sqlite3.wrap +#+BEGIN_SRC sh :tangle ../subprojects/d2sqlite3.wrap [wrap-git] directory = d2sqlite3 url = https://github.com/biozic/d2sqlite3.git @@ -1246,7 +1143,7 @@ revision = head **** meson.build -#+BEGIN_SRC sh :NO-tangle ../subprojects/d2sqlite3.meson.build +#+BEGIN_SRC sh :tangle ../subprojects/d2sqlite3.meson.build project('d2sqlite3', 'd', meson_version: '>=0.46', license: 'BSL-1.0', @@ -1300,7 +1197,7 @@ d2sqlite3_dep = declare_dependency( *** dyaml **** wrap -#+BEGIN_SRC sh :NO-tangle ../subprojects/dyaml.wrap +#+BEGIN_SRC sh :tangle ../subprojects/dyaml.wrap [wrap-git] directory = dyaml url = https://github.com/dlang-community/D-YAML.git @@ -1309,6 +1206,8 @@ revision = head **** meson.build (provided by upstream) +Upstream provides meson.build + #+BEGIN_SRC sh :NO-tangle ../subprojects/D-YAML/meson.build project('D-YAML', 'd', meson_version: '>=0.40.0', @@ -1385,7 +1284,7 @@ dyaml_dep = declare_dependency( *** imageformats **** wrap -#+BEGIN_SRC sh :NO-tangle ../subprojects/imageformats.wrap +#+BEGIN_SRC sh :tangle ../subprojects/imageformats.wrap [wrap-git] directory = imageformats url = https://github.com/lgvz/imageformats.git @@ -1394,7 +1293,7 @@ revision = head **** meson.build -#+BEGIN_SRC sh :NO-tangle ../subprojects/imageformats.meson.build +#+BEGIN_SRC sh :tangle ../subprojects/imageformats.meson.build project('imageformats', 'd', meson_version: '>=0.46', license: 'BSL-1.0', @@ -1440,7 +1339,7 @@ imageformats_dep = declare_dependency( *** tinyendian (dyaml dependency) **** wrap -#+BEGIN_SRC sh :NO-tangle ../subprojects/tinyendian.wrap +#+BEGIN_SRC sh :tangle ../subprojects/tinyendian.wrap [wrap-git] directory = tinyendian url = https://github.com/dlang-community/tinyendian.git @@ -1449,6 +1348,8 @@ revision = head **** meson.build (provided by upstream) +Upstream provides meson.build + #+BEGIN_SRC sh :NO-tangle ../subprojects/tinyendian/meson.build # -*- mode: python; -*- @@ -1493,6 +1394,113 @@ 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 +!doc +!doc/** +!man +!man/** +!org +!misc +!misc/** +!src +!src/** +!data +!data/* +!data/src/** +!data/src_yaml/** +!data/pod/** +!data/pod_yaml/** +!*.sst +!*.ssm +!**/*.sst +!**/*.ssm +!subprojects +!subprojects/*.wrap +!subprojects/*.meson.build +!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/** +**/.dub/** +**/cgi-bin/** +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 + ** build *** dub diff --git a/subprojects/README b/subprojects/README new file mode 100644 index 0000000..c4d9dcc --- /dev/null +++ b/subprojects/README @@ -0,0 +1,22 @@ +- d2sqlite3 + - dub + - https://code.dlang.org/packages/d2sqlite3 + - upstream + - https://github.com/biozic/d2sqlite3 +- dyaml + - dub + - https://code.dlang.org/packages/dyaml + - upstream + - https://github.com/dlang-community/D-YAML + - upstream git clone + - https://github.com/dlang-community/D-YAML.git +- imageformats + - dub + - https://code.dlang.org/packages/imageformats + - upstream git clone + - https://github.com/lgvz/imageformats +- tinyendian (dyaml dependency) + - dub + - http://code.dlang.org/packages/tinyendian + - upstream git clone + - https://github.com/dlang-community/tinyendian.git diff --git a/subprojects/d2sqlite3.meson.build b/subprojects/d2sqlite3.meson.build new file mode 100644 index 0000000..1685738 --- /dev/null +++ b/subprojects/d2sqlite3.meson.build @@ -0,0 +1,48 @@ +project('d2sqlite3', 'd', + meson_version: '>=0.46', + license: 'BSL-1.0', + version: '0.18.3' +) + +project_soversion = '0' + +src_dir = include_directories('source/') +pkgc = import('pkgconfig') + +sqlite_dep = dependency('sqlite3') + +d2sqlite3_src = [ + 'source/d2sqlite3/database.d', + 'source/d2sqlite3/internal/memory.d', + 'source/d2sqlite3/internal/util.d', + 'source/d2sqlite3/library.d', + 'source/d2sqlite3/package.d', + 'source/d2sqlite3/results.d', + 'source/d2sqlite3/sqlite3.d', + 'source/d2sqlite3/statement.d', +] +install_subdir('source/d2sqlite3/', install_dir: 'include/d/d2sqlite3/') + +d2sqlite3_lib = library('d2sqlite3', + [d2sqlite3_src], + include_directories: [src_dir], + dependencies: [sqlite_dep], + install: true, + version: meson.project_version(), + soversion: project_soversion +) + +pkgc.generate(name: 'd2sqlite3', + libraries: d2sqlite3_lib, + subdirs: 'd/d2sqlite3/', + version: meson.project_version(), + requires: ['sqlite3'], + description: 'A small wrapper around SQLite for the D programming language.' +) + +# for use by others which embed this as subproject +d2sqlite3_dep = declare_dependency( + link_with: [d2sqlite3_lib], + dependencies: [sqlite_dep], + include_directories: [src_dir] +) diff --git a/subprojects/d2sqlite3.wrap b/subprojects/d2sqlite3.wrap new file mode 100644 index 0000000..78643b5 --- /dev/null +++ b/subprojects/d2sqlite3.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = d2sqlite3 +url = https://github.com/biozic/d2sqlite3.git +revision = head diff --git a/subprojects/dyaml.wrap b/subprojects/dyaml.wrap new file mode 100644 index 0000000..8b3f503 --- /dev/null +++ b/subprojects/dyaml.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = dyaml +url = https://github.com/dlang-community/D-YAML.git +revision = head diff --git a/subprojects/imageformats.meson.build b/subprojects/imageformats.meson.build new file mode 100644 index 0000000..7c05434 --- /dev/null +++ b/subprojects/imageformats.meson.build @@ -0,0 +1,40 @@ +project('imageformats', 'd', + meson_version: '>=0.46', + license: 'BSL-1.0', + version: '7.0.2' +) + +project_soversion = '0' + +src_dir = include_directories('.') +pkgc = import('pkgconfig') + +imageformats_src = [ + 'imageformats/bmp.d', + 'imageformats/jpeg.d', + 'imageformats/package.d', + 'imageformats/png.d', + 'imageformats/tga.d' +] +install_subdir('imageformats/', install_dir: 'include/d/imageformats-d/') + +imageformats_lib = library('imageformats-d', + [imageformats_src], + include_directories: [src_dir], + install: true, + version: meson.project_version(), + soversion: project_soversion +) + +pkgc.generate(name: 'imageformats-d', + libraries: imageformats_lib, + subdirs: 'd/imageformats-d/', + version: meson.project_version(), + description: 'Decoders for PNG, TGA, BMP, JPEG and encoders for PNG, TGA, BMP.' +) + +# for use by others which embed this as subproject +imageformats_dep = declare_dependency( + link_with: [imageformats_lib], + include_directories: [src_dir] +) diff --git a/subprojects/imageformats.wrap b/subprojects/imageformats.wrap new file mode 100644 index 0000000..09f342c --- /dev/null +++ b/subprojects/imageformats.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = imageformats +url = https://github.com/lgvz/imageformats.git +revision = head diff --git a/subprojects/tinyendian.wrap b/subprojects/tinyendian.wrap new file mode 100644 index 0000000..331a753 --- /dev/null +++ b/subprojects/tinyendian.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = tinyendian +url = https://github.com/dlang-community/tinyendian.git +revision = head -- cgit v1.2.3