From 0ad57cc16d644cf614f128caf52273367dced16a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 27 Jul 2018 23:44:18 -0400 Subject: meson build related (reggae removed for now) --- .gitignore | 5 +- dub.sdl | 15 +-- dub.selections.json | 2 +- makefile | 7 +- maker.org | 239 +++++++++++++++++++++++++--------------- meson.build | 57 ++++++++++ reggaefile.d | 4 - subprojects/archived.wrap | 4 + subprojects/d2sqlite3.wrap | 4 + subprojects/imageformats-d.wrap | 4 + subprojects/toml-d.wrap | 4 + 11 files changed, 232 insertions(+), 113 deletions(-) create mode 100644 meson.build delete mode 100644 reggaefile.d create mode 100644 subprojects/archived.wrap create mode 100644 subprojects/d2sqlite3.wrap create mode 100644 subprojects/imageformats-d.wrap create mode 100644 subprojects/toml-d.wrap diff --git a/.gitignore b/.gitignore index f2a7b11..a07e483 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ !version.txt !dub*.json !dub.sdl +!meson.build !tangle !*.org !*.d @@ -23,6 +24,9 @@ !*.ssm !**/*.sst !**/*.ssm +!subprojects +!**/*.wrap +!subprojects/*.wrap !sisupod.manifest !sisu_document_make !config_local_site @@ -32,7 +36,6 @@ !views !docs/*.html .dub/** -.reggae/** tmp/** *_.org *_.d diff --git a/dub.sdl b/dub.sdl index 24a53da..0d03df5 100644 --- a/dub.sdl +++ b/dub.sdl @@ -8,21 +8,12 @@ targetPath "./bin" #sourcePath "./src/sdp" stringImportPaths "./views" buildRequirements "allowWarnings" -dependency "toml" version="~>0.4.0-rc.2" # https://code.dlang.org/packages/toml https://github.com/toml-lang/toml/wiki -dependency "toml:json" version="~>0.4.0-rc.2" -dependency "d2sqlite3" version="~>0.16.1" # https://code.dlang.org/packages/d2sqlite3 http://biozic.github.io/d2sqlite3/d2sqlite3.html +dependency "toml" version="~>1.0.0-rc.2" # https://code.dlang.org/packages/toml https://github.com/toml-lang/toml/wiki +dependency "toml:json" version="~>1.0.0-rc.2" +dependency "d2sqlite3" version="~>0.16.2" # https://code.dlang.org/packages/d2sqlite3 http://biozic.github.io/d2sqlite3/d2sqlite3.html subconfiguration "d2sqlite3" "all-included" dependency "archive" version="~>0.6.0" # http://code.dlang.org/packages/archive https://github.com/rcythr/archive dependency "imageformats" version="~>7.0.0" # https://code.dlang.org/packages/imageformats https://github.com/lgvz/imageformats -configuration "reggae" { - name "build" - targetType "executable" - platforms "posix" - targetName "bin/sdp-rg" - dflags "-J=views" "-I=src/sdp" - buildOptions "verbose" "releaseMode" "optimize" "inline" - postGenerateCommands "/usr/bin/notify-send -t 0 'D release executable ready' 'sdp-rg'" -} configuration "sdp-release" { name "release" targetType "executable" diff --git a/dub.selections.json b/dub.selections.json index 33a377b..ccb943a 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -7,7 +7,7 @@ "libinputvisitor": "1.2.2", "sdlang-d": "0.10.2", "taggedalgebraic": "0.10.9", - "toml": "0.4.0-rc.4", + "toml": "1.0.0-rc.2", "unit-threaded": "0.6.36" } } diff --git a/makefile b/makefile index bdacadc..ee2ba43 100644 --- a/makefile +++ b/makefile @@ -139,6 +139,8 @@ ldc_rel_expunge_tangle: expunge skel tangle ldc_rel_tangle ldc_debug_tangle: tangle $(DUB) --compiler=ldc2 --config=sdp-ldc-debug skel: + mkdir -p build; \ + mkdir -p subprojects; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/conf; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/meta; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/output; \ @@ -147,6 +149,7 @@ skel: mkdir -p $(PRG_BINDIR); init: skel clean: + rm -rf build; \ rm -rf $(PRG_SRCDIR); \ rm -rf $(PRG_DOCDIR); clean_bin: @@ -176,10 +179,6 @@ rebuild: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_BINDIR)/$(PRG_BIN).o clean build makefile_new: make -k tangle_maker restart: clean tangle -ragga: - reggae -b binary - reggae -b ninja - build find_pods: $(SiSU_MARKUP_SAMPLES_FIND_PODS) dmd_testrun_find: diff --git a/maker.org b/maker.org index 6f64604..4ffc4ef 100644 --- a/maker.org +++ b/maker.org @@ -327,6 +327,8 @@ ldc_debug_tangle: tangle #+BEGIN_SRC makefile :tangle makefile skel: + mkdir -p build; \ + mkdir -p subprojects; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/conf; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/meta; \ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/output; \ @@ -335,6 +337,7 @@ skel: mkdir -p $(PRG_BINDIR); init: skel clean: + rm -rf build; \ rm -rf $(PRG_SRCDIR); \ rm -rf $(PRG_DOCDIR); clean_bin: @@ -376,18 +379,12 @@ makefile_new: restart: clean tangle #+END_SRC -**** _reggae_ build :reggae: +**** _meson_ build :meson: -#+BEGIN_SRC makefile :tangle makefile -ragga: - reggae -b binary - reggae -b ninja - build -#+END_SRC - -#+BEGIN_SRC makefile -ragga: - reggae -b binary && reggae -b ninja && build +#+BEGIN_SRC makefile :tangle build/makefile +meson: + meson --buildtype=debugoptimized + ninja #+END_SRC *** testrun (program against document markup) @@ -820,9 +817,9 @@ targetPath "./bin" #sourcePath "./src/sdp" stringImportPaths "./views" buildRequirements "allowWarnings" -dependency "toml" version="~>0.4.0-rc.2" # https://code.dlang.org/packages/toml https://github.com/toml-lang/toml/wiki -dependency "toml:json" version="~>0.4.0-rc.2" -dependency "d2sqlite3" version="~>0.16.1" # https://code.dlang.org/packages/d2sqlite3 http://biozic.github.io/d2sqlite3/d2sqlite3.html +dependency "toml" version="~>1.0.0-rc.2" # https://code.dlang.org/packages/toml https://github.com/toml-lang/toml/wiki +dependency "toml:json" version="~>1.0.0-rc.2" +dependency "d2sqlite3" version="~>0.16.2" # https://code.dlang.org/packages/d2sqlite3 http://biozic.github.io/d2sqlite3/d2sqlite3.html subconfiguration "d2sqlite3" "all-included" dependency "archive" version="~>0.6.0" # http://code.dlang.org/packages/archive https://github.com/rcythr/archive dependency "imageformats" version="~>7.0.0" # https://code.dlang.org/packages/imageformats https://github.com/lgvz/imageformats @@ -843,20 +840,6 @@ configuration "build" { } #+END_SRC -*** reggae build (sdp) :release: - -#+BEGIN_SRC sh :tangle dub.sdl -configuration "reggae" { - name "build" - targetType "executable" - platforms "posix" - targetName "bin/sdp-rg" - dflags "-J=views" "-I=src/sdp" - buildOptions "verbose" "releaseMode" "optimize" "inline" - postGenerateCommands "/usr/bin/notify-send -t 0 'D release executable ready' 'sdp-rg'" -} -#+END_SRC - *** sdp-release (sdp) :release: #+BEGIN_SRC sh :tangle dub.sdl @@ -872,8 +855,7 @@ configuration "sdp-release" { #+END_SRC ** dmd :dmd: -*** sdp-dmd :default: -**** sdp-dmd +*** sdp-dmd #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-dmd" { @@ -888,7 +870,7 @@ configuration "sdp-dmd" { } #+END_SRC -**** sdp-dmd-version +*** sdp-dmd-version #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-dmd-version" { @@ -902,7 +884,7 @@ configuration "sdp-dmd-version" { } #+END_SRC -**** sdp-dmd-release +*** sdp-dmd-release #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-dmd-release" { @@ -917,8 +899,7 @@ configuration "sdp-dmd-release" { } #+END_SRC -*** sdp-dmd-debug :debug: -**** sdp-dmd-debug +*** sdp-dmd-debug #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-dmd-debug" { @@ -935,10 +916,8 @@ configuration "sdp-dmd-debug" { } #+END_SRC - ** ldc :ldc: -*** sdp-ldc :default: -**** sdp-ldc +*** sdp-ldc #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-ldc" { @@ -953,7 +932,7 @@ configuration "sdp-ldc" { } #+END_SRC -**** sdp-ldc-version +*** sdp-ldc-version #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-ldc-version" { @@ -967,7 +946,7 @@ configuration "sdp-ldc-version" { } #+END_SRC -**** sdp-ldc-release +*** sdp-ldc-release #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-ldc-release" { @@ -982,8 +961,7 @@ configuration "sdp-ldc-release" { } #+END_SRC -*** sdp-ldc-debug :debug: -**** sdp-ldc-debug +*** sdp-ldc-debug #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-ldc-debug" { @@ -1000,8 +978,7 @@ configuration "sdp-ldc-debug" { #+END_SRC ** gdc :gdc: -*** sdp-gdc :default: -**** sdp-gdc +*** sdp-gdc #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-gdc" { @@ -1017,7 +994,7 @@ configuration "sdp-gdc" { } #+END_SRC -**** sdp-gdc-version +*** sdp-gdc-version #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-gdc-version" { @@ -1032,7 +1009,7 @@ configuration "sdp-gdc-version" { } #+END_SRC -**** sdp-gdc-release +*** sdp-gdc-release #+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-gdc-release" { @@ -1048,10 +1025,9 @@ configuration "sdp-gdc-release" { } #+END_SRC -*** sdp-gdc-debug :debug: -**** sdp-gdc-debug +*** sdp-gdc-debug -#+BEGIN_SRC sh :tangle dub.sdl +#+BEGIN_SRC sh :tangle dub.sdl configuration "sdp-gdc-debug" { name "debuging" targetType "executable" @@ -1065,13 +1041,126 @@ configuration "sdp-gdc-debug" { } #+END_SRC -* reggaefile.d :reggae: - -#+BEGIN_SRC d :tangle reggaefile.d -import reggae; -alias _compile = dubDefaultTarget!(CompilerFlags("-g -O")); -alias _dub_conf = dubConfigurationTarget!(Configuration("reggae")); -mixin build!(_compile, _dub_conf); +* meson +** notes + +http://mesonbuild.com/D.html +http://mesonbuild.com/Dependencies.html#Dub +- create and move to subdirectory + rm -r build; mkdir build && cd build + +- build + + - regular build (faster compile time): + meson && ninja + + - optimized build (faster program run time): + meson --buildtype=debugoptimized && ninja + + - time build + time ( meson --buildtype=debugoptimized && ninja ) + +- other + - flags + DFLAGS= DC=ldc2 meson .. + +** * projects + +#+BEGIN_SRC sh :tangle meson.build +project('sdp', 'd', + license: 'GPL3', + version: '0.26.5', + meson_version: '>=0.46' +) +#if meson.get_compiler('d').get_id() == 'gcc' +# error('sdp cannot be compiled with GDC at time. Sorry.') +#endif +sdp_sources = [ 'src/sdp/sdp.d', + 'src/sdp/conf/compile_time_info.d', + 'src/sdp/meta/conf_make_meta_json.d', + 'src/sdp/meta/conf_make_meta_structs.d', + 'src/sdp/meta/conf_make_meta_toml.d', + 'src/sdp/meta/defaults.d', + 'src/sdp/meta/doc_debugs.d', + 'src/sdp/meta/metadoc.d', + 'src/sdp/meta/metadoc_from_src.d', + 'src/sdp/meta/metadoc_summary.d', + 'src/sdp/meta/object_setter.d', + 'src/sdp/meta/package.d', + 'src/sdp/meta/rgx.d', + 'src/sdp/output/create_zip_file.d', + 'src/sdp/output/defaults.d', + 'src/sdp/output/epub3.d', + 'src/sdp/output/html.d', + 'src/sdp/output/hub.d', + 'src/sdp/output/package.d', + 'src/sdp/output/paths_output.d', + 'src/sdp/output/rgx.d', + 'src/sdp/output/source_sisupod.d', + 'src/sdp/output/sqlite.d', + 'src/sdp/output/xmls_css.d', + 'src/sdp/output/xmls.d', + 'src/sdp/source/paths_source.d', + 'src/sdp/source/read_config_files.d', + 'src/sdp/source/read_source_files.d', +] +source_root = meson.source_root() +sources_dir = include_directories('src/') +# Dependencies +dep_toml = dependency('toml-d', version: '>= 1.0.0', fallback: ['toml-d', 'toml_dep']) +dep_d2sqlite3 = dependency('d2sqlite3', version: '>= 0.16.2', fallback: ['d2sqlite3', 'd2sqlite3_dep']) +dep_archive = dependency('archive', version: '>= 0.6.0', fallback: ['archived', 'archive_dep']) +dep_imageformats = dependency('imageformats-d', version: '>= 7.0.0', fallback: ['imageformats-d', 'imageformats_dep']) +# executable +sdp_exe = executable('sdp', + [sdp_sources], + include_directories : [sources_dir], + d_import_dirs: [include_directories('views')], + dependencies : [ + dep_toml, + dep_d2sqlite3, + dep_archive, + dep_imageformats + ], + install : true +) +#+END_SRC + +** * subprojects +*** toml-d + +#+BEGIN_SRC sh :tangle subprojects/toml-d.wrap +[wrap-git] +directory = toml-d +url = https://github.com/ximion/toml.git +revision = head +#+END_SRC + +*** d2sqlite3 + +#+BEGIN_SRC sh :tangle subprojects/d2sqlite3.wrap +[wrap-git] +directory = d2sqlite3 +url = https://github.com/ximion/d2sqlite3.git +revision = head +#+END_SRC + +*** archived + +#+BEGIN_SRC sh :tangle subprojects/archived.wrap +[wrap-git] +directory = archived +url = https://github.com/ximion/archive.git +revision = head +#+END_SRC + +*** imageformats-d + +#+BEGIN_SRC sh :tangle subprojects/imageformats-d.wrap +[wrap-git] +directory = imageformats-d +url = https://github.com/ximion/imageformats.git +revision = head #+END_SRC * .gitignore :gitignore: @@ -1085,6 +1174,7 @@ mixin build!(_compile, _dub_conf); !version.txt !dub*.json !dub.sdl +!meson.build !tangle !*.org !*.d @@ -1102,6 +1192,9 @@ mixin build!(_compile, _dub_conf); !*.ssm !**/*.sst !**/*.ssm +!subprojects +!**/*.wrap +!subprojects/*.wrap !sisupod.manifest !sisu_document_make !config_local_site @@ -1111,7 +1204,6 @@ mixin build!(_compile, _dub_conf); !views !docs/*.html .dub/** -.reggae/** tmp/** *_.org *_.d @@ -1192,8 +1284,6 @@ time make all time make all_ver time make dmd_ver ldc_ver gdc_ver -time make ragga - time make restart time make restart ldc time make tangle ldc @@ -1201,38 +1291,6 @@ time make tangle ldc time make ldc_testrun_find_pod_epub #+END_SRC -*** reggae - -touch src/sdp/sdp.d - -#+BEGIN_SRC sh -reggae -b binary && reggae -b ninja && build -#+END_SRC - -#+BEGIN_SRC sh -reggae -b binary && build -reggae -b ninja && build -# reggae -b ninja --dc=dmd && build -reggae -b binary --dc=ldmd2 && build -reggae -b ninja --dc=ldmd2 && build -# reggae -b ninja --dc=gdc && build -reggae -b binary --dc=gdmd && build -reggae -b ninja --dc=gdmd && build -#+END_SRC - -see/try: dub describe - -**** issues -issue with ldc2 -reggae -b ninja --dc ldc2 && build -https://github.com/atilaneves/reggae/issues/29 -use ldmd2 -reggae -b ninja --dc ldmd2 && build -https://stackoverflow.com/questions/35515138/ldc2-vs-ldmd2-whats-the-difference - -issue with gdc -reggae -b ninja --dc gdc && build - ** dub zfunc :zfunc: *** ,dubdmd :dmd: @@ -1331,7 +1389,6 @@ dub fetch sdlang-d dub fetch taggedalgebraic dub fetch libinputvisitor dub fetch unit-threaded ? -dub fetch reggae sdp ~master: /home/ralph/grotto/repo/git.repo/utils/sdp-x/ /home/ralph/.dub/packages/* diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..7561b55 --- /dev/null +++ b/meson.build @@ -0,0 +1,57 @@ +project('sdp', 'd', + license: 'GPL3', + version: '0.26.5', + meson_version: '>=0.46' +) +#if meson.get_compiler('d').get_id() == 'gcc' +# error('sdp cannot be compiled with GDC at time. Sorry.') +#endif +sdp_sources = [ 'src/sdp/sdp.d', + 'src/sdp/conf/compile_time_info.d', + 'src/sdp/meta/conf_make_meta_json.d', + 'src/sdp/meta/conf_make_meta_structs.d', + 'src/sdp/meta/conf_make_meta_toml.d', + 'src/sdp/meta/defaults.d', + 'src/sdp/meta/doc_debugs.d', + 'src/sdp/meta/metadoc.d', + 'src/sdp/meta/metadoc_from_src.d', + 'src/sdp/meta/metadoc_summary.d', + 'src/sdp/meta/object_setter.d', + 'src/sdp/meta/package.d', + 'src/sdp/meta/rgx.d', + 'src/sdp/output/create_zip_file.d', + 'src/sdp/output/defaults.d', + 'src/sdp/output/epub3.d', + 'src/sdp/output/html.d', + 'src/sdp/output/hub.d', + 'src/sdp/output/package.d', + 'src/sdp/output/paths_output.d', + 'src/sdp/output/rgx.d', + 'src/sdp/output/source_sisupod.d', + 'src/sdp/output/sqlite.d', + 'src/sdp/output/xmls_css.d', + 'src/sdp/output/xmls.d', + 'src/sdp/source/paths_source.d', + 'src/sdp/source/read_config_files.d', + 'src/sdp/source/read_source_files.d', +] +source_root = meson.source_root() +sources_dir = include_directories('src/') +# Dependencies +dep_toml = dependency('toml-d', version: '>= 1.0.0', fallback: ['toml-d', 'toml_dep']) +dep_d2sqlite3 = dependency('d2sqlite3', version: '>= 0.16.2', fallback: ['d2sqlite3', 'd2sqlite3_dep']) +dep_archive = dependency('archive', version: '>= 0.6.0', fallback: ['archived', 'archive_dep']) +dep_imageformats = dependency('imageformats-d', version: '>= 7.0.0', fallback: ['imageformats-d', 'imageformats_dep']) +# executable +sdp_exe = executable('sdp', + [sdp_sources], + include_directories : [sources_dir], + d_import_dirs: [include_directories('views')], + dependencies : [ + dep_toml, + dep_d2sqlite3, + dep_archive, + dep_imageformats + ], + install : true +) diff --git a/reggaefile.d b/reggaefile.d deleted file mode 100644 index 48188f2..0000000 --- a/reggaefile.d +++ /dev/null @@ -1,4 +0,0 @@ -import reggae; -alias _compile = dubDefaultTarget!(CompilerFlags("-g -O")); -alias _dub_conf = dubConfigurationTarget!(Configuration("reggae")); -mixin build!(_compile, _dub_conf); diff --git a/subprojects/archived.wrap b/subprojects/archived.wrap new file mode 100644 index 0000000..0cb238c --- /dev/null +++ b/subprojects/archived.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = archived +url = https://github.com/ximion/archive.git +revision = head diff --git a/subprojects/d2sqlite3.wrap b/subprojects/d2sqlite3.wrap new file mode 100644 index 0000000..04ce778 --- /dev/null +++ b/subprojects/d2sqlite3.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = d2sqlite3 +url = https://github.com/ximion/d2sqlite3.git +revision = head diff --git a/subprojects/imageformats-d.wrap b/subprojects/imageformats-d.wrap new file mode 100644 index 0000000..a5a9877 --- /dev/null +++ b/subprojects/imageformats-d.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = imageformats-d +url = https://github.com/ximion/imageformats.git +revision = head diff --git a/subprojects/toml-d.wrap b/subprojects/toml-d.wrap new file mode 100644 index 0000000..70f7adc --- /dev/null +++ b/subprojects/toml-d.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = toml-d +url = https://github.com/ximion/toml.git +revision = head -- cgit v1.2.3