summary refs log tree commit diff
path: root/.config/yamlfs/meson.yml
diff options
context:
space:
mode:
Diffstat (limited to '.config/yamlfs/meson.yml')
-rw-r--r--.config/yamlfs/meson.yml203
1 files changed, 99 insertions, 104 deletions
diff --git a/.config/yamlfs/meson.yml b/.config/yamlfs/meson.yml
index a15c9e1..4204c86 100644
--- a/.config/yamlfs/meson.yml
+++ b/.config/yamlfs/meson.yml
@@ -1,105 +1,113 @@
+README.md: |-
+  # {% .name %}
+
+  TODO
+
 meson.build: |-
   project(
-      '{% .name %}',
-      'c',
-      version: '0.0.0+unknown',
-      license: 'MIT',
-      default_options: [
-        'c_std=c99',
-        'warning_level=2',
-        'werror=true',
-      ],
-      meson_version: '>= 0.47',
+  	'{% .name %}',
+  	'c',
+  	version: '0.0.0+unknown',
+  	license: 'MIT',
+  	meson_version: '>=0.50.0',
+  	default_options: [
+  		'c_std=c99',
+  		'warning_level=2',
+  		'werror=true',
+  	],
   )
 
   cc = meson.get_compiler('c')
   add_project_arguments(cc.get_supported_arguments([
-    '-D_POSIX_C_SOURCE=200809L',
-
-    '-Wundef',
-    '-Wlogical-op',
-    '-Wmissing-include-dirs',
-    '-Wold-style-definition',
-    '-Wpointer-arith',
-    '-Winit-self',
-    '-Wfloat-equal',
-    '-Wstrict-prototypes',
-    '-Wredundant-decls',
-    '-Wimplicit-fallthrough=2',
-    '-Wendif-labels',
-    '-Wstrict-aliasing=2',
-    '-Woverflow',
-    '-Wformat=2',
-  
-    '-Wno-missing-braces',
-    '-Wno-missing-field-initializers',
-    '-Wno-unused-parameter',
+  	'-D_POSIX_C_SOURCE 200112L',
+
+  	'-Wundef',
+  	'-Wlogical-op',
+  	'-Wmissing-include-dirs',
+  	'-Wold-style-definition',
+  	'-Wpointer-arith',
+  	'-Winit-self',
+  	'-Wfloat-equal',
+  	'-Wstrict-prototypes',
+  	'-Wredundant-decls',
+  	'-Wimplicit-fallthrough=2',
+  	'-Wendif-labels',
+  	'-Wstrict-aliasing=2',
+  	'-Woverflow',
+  	'-Wformat=2',
+
+  	'-Wno-missing-braces',
+  	'-Wno-missing-field-initializers',
+  	'-Wno-unused-parameter',
   ]), language: 'c')
 
   version = '"@0@ (" __DATE__ ")"'.format(meson.project_version())
   # embed version sourced from git ref
   git = find_program('git', native: true, required: false)
   if git.found()
-      git_commit_hash = run_command([
-        git, 'describe', '--always', '--tags'
-      ])
-      git_branch = run_command([
-        git, 'rev-parse', '--abbrev-ref', 'HEAD'
-      ])
-      if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0
-        version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(
-          git_commit_hash.stdout().strip(),
-          git_branch.stdout().strip(),
-        )
-      endif
+  	git_commit_hash = run_command([
+  		git, 'describe', '--always', '--tags'
+  	])
+  	git_branch = run_command([
+  		git, 'rev-parse', '--abbrev-ref', 'HEAD'
+  	])
+  	if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0
+  		version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(
+  			git_commit_hash.stdout().strip(),
+  			git_branch.stdout().strip(),
+  		)
+  	endif
   endif
   add_project_arguments('-DVERSION=@0@'.format(version), language: 'c')
 
   {%- if .man %}
 
   scdoc = dependency(
-    'scdoc',
-    version: '>=1.9.2',
-    native: true,
-    required: get_option('man-pages'),
+  	'scdoc',
+  	version: '>=1.9.2',
+  	native: true,
+  	required: get_option('man-pages'),
   )
   if scdoc.found()
-    scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
-    sh = find_program('sh', native: true)
-    mandir = get_option('mandir')
-    man_files = [
-      '{% .name %}.1.scd',
-    ]
-    foreach fn : man_files
-      topic = fn.split('.')[-3].split('/')[-1]
-      section = fn.split('.')[-2]
-      output = '@0@.@1@'.format(topic, section)
-
-      custom_target(
-        output,
-        input: fn,
-        output: output,
-        command: [
-          sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
-        ],
-        install: true,
-        install_dir: '@0@/man@1@'.format(mandir, section),
-    )
-    endforeach
+  	scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
+  	sh = find_program('sh', native: true)
+  	mandir = get_option('mandir')
+  	man_files = [
+  		'{% .name %}.1.scd',
+  	]
+  	foreach fn : man_files
+  		topic = fn.split('.')[-3].split('/')[-1]
+  		section = fn.split('.')[-2]
+  		output = '@0@.@1@'.format(topic, section)
+
+  		custom_target(
+  			output,
+  			input: fn,
+  			output: output,
+  			command: [
+  				sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
+  			],
+  			install: true,
+  			install_dir: '@0@/man@1@'.format(mandir, section),
+  		)
+  	endforeach
   endif
   {%- end %}
 
+  src_inc = include_directories('include')
+  src_files = [
+  	'src/main.c',
+  ]
+
   executable(
-    meson.project_name(),
-    files(
-      'src/main.c',
-    ),
-    include_directories: include_directories('include'),
-    dependencies: [],
-    install: true,
+  	meson.project_name(),
+  	files(src_files),
+  	dependencies: [],
+  	include_directories: [src_inc],
+  	install: true,
   )
 
-{% if .man %}
+{% if (eq .man "true") %}
 meson_options.txt: |
   option('man-pages', type: 'feature', value: 'auto', description: 'Generate man pages using scdoc')
 
@@ -121,36 +129,37 @@ meson_options.txt: |
   # OPTIONS
 
   *-h, -help*
-    Show help message and quit.
+  	Show help message and quit.
 
   # SEE ALSO
 
-    *{% .name %}*(5)
+  	*{% .name %}*(5)
 
   # AUTHORS
 
   Maintained by TODO author <mail>.
-  For more information, see {% .pkg %}.
+  For more information, see <website>.
 {% end %}
 
 src:
   main.c: |-
-    #define _POSIX_C_SOURCE 200809L
+    #define _POSIX_C_SOURCE 200112L
+
     #include <stdlib.h>
     #include <stdio.h>
 
     #include "{% .name %}.h"
 
     int main(int argc, char **argv) {
-        printf("%s version %s\n\n", *argv, VERSION);
+    	printf("%s version %s\n\n", *argv, VERSION);
 
-        printf("args (len: %d)", argc-1);
-        for (int i=1; i < argc; ++i) {
-            printf(" '%s'", argv[i]);
-        }
-        printf("\n");
+    	printf("args (len: %d)", argc-1);
+    	for (int i=1; i < argc; ++i) {
+    		printf(" '%s'", argv[i]);
+    	}
+    	printf("\n");
 
-        return 0;
+    	return 0;
     }
 
 include:
@@ -171,33 +180,19 @@ include:
 
 .editorconfig: |-
   ; http://editorconfig.org/
-
   root = true
 
   [*]
   charset = utf-8
   end_of_line = lf
-  indent_style = space
-
-  [*.{c,h,cmake,txt}]
   indent_style = tab
-  indent_size = 4
+  insert_final_newline = true
+  trim_trailing_whitespace = true
 
   [*.md]
   trim_trailing_whitespace = false
 
-  [meson.build]
-  indent_size = 2
-
-  [Dockerfile]
-  indent_size = 4
-
-README.md: |-
-  # {% .name %}
-
-  TODO
-
-{% if .docker %}
+{% if (eq .docker "true") %}
 Dockerfile: |-
   TODO
 {% end %}