1- project (' artemis' , [' c' , ' vala' ],
2- version : ' 0.1.0' ,
3- meson_version : ' >= 1.0.0' ,
4- default_options : [' werror=false' , ],
1+ project (
2+ ' com.k0vcz.Artemis' ,
3+ [' c' , ' vala' ],
4+ version : ' 0.1.0' ,
5+ meson_version : ' >= 1.0.0' ,
6+ default_options : [
7+ ' warning_level=2' ,
8+ ' werror=false' ,
9+ ],
510)
611
712i18n = import (' i18n' )
@@ -12,14 +17,39 @@ prefix = get_option('prefix')
1217data_dir = prefix / get_option (' datadir' )
1318srcdir = meson .project_source_root() / ' src'
1419
15- config_h = configuration_data ()
16- config_h.set_quoted(' PACKAGE_VERSION' , meson .project_version ())
17- config_h.set_quoted(' GETTEXT_PACKAGE' , ' artemis' )
18- config_h.set_quoted(' LOCALEDIR' , get_option (' prefix' ) / get_option (' localedir' ))
19- configure_file (output : ' config.h' , configuration : config_h)
20+ # https://gitlab.gnome.org/GNOME/vala/-/issues/1413#note_1707480
21+ if meson .get_compiler (' c' ).get_id () == ' clang'
22+ add_project_arguments (' -Wno-incompatible-function-pointer-types' , language : ' c' )
23+ endif
24+
25+ devel = get_option (' debug' )
26+
27+ # Setup configuration file
28+ config = configuration_data ()
29+ config.set(' EXEC_NAME' , meson .project_name())
30+ config.set(' GETTEXT_PACKAGE' , meson .project_name())
31+ config.set(' BINDIR' , join_paths (get_option (' prefix' ), get_option (' bindir' )))
32+ config.set(' LOCALEDIR' , join_paths (get_option (' prefix' ), get_option (' localedir' )))
33+ config.set(' DOMAIN' , meson .project_name ())
34+ config.set(' G_LOG_DOMAIN' , ' Artemis' )
35+ config.set(' RESOURCES' , ' /' + ' /' .join(meson .project_name().split(' .' )) + ' /' )
36+ config.set(' VERSION' , meson .project_version())
37+ config.set(' PREFIX' , get_option (' prefix' ))
38+ config.set(' NAME' , ' Artemis' )
39+ config.set(' WEBSITE' , '' )
40+ config.set(' DONATE_WEBSITE' , '' )
41+ config.set(' TRANSLATE_WEBSITE' , '' )
42+ config.set(' PROFILE' , devel ? ' development' : ' release' )
2043
21- config_dep = valac.find_library (' config' , dirs : srcdir)
22- config_inc = include_directories (' .' )
44+ if devel
45+ git = find_program (' git' )
46+ if git.found()
47+ branch = run_command (' git' , ' branch' , ' --show-current' , check : true ).stdout().strip()
48+ revision = run_command (' git' , ' rev-parse' , ' --short' , ' HEAD' , check : true ).stdout().strip()
49+ version = ' @0@-@1@' .format(branch, revision)
50+ config.set(' VERSION' , version)
51+ endif
52+ endif
2353
2454add_project_arguments (' -DGETTEXT_PACKAGE="' + meson .project_name() + ' "' , language : ' c' )
2555
@@ -31,7 +61,6 @@ subdir('po')
3161
3262executable (' artemis' , artemis_vala_sources,
3363 dependencies : artemis_vala_deps,
34- include_directories : config_inc,
3564 vala_args : [' -g' , ' --save-temps' , ' --pkg=RadioControl' , ' --vapidir=' + srcdir],
3665 link_with : [libradiocontrol],
3766 install : true ,
@@ -42,17 +71,3 @@ gnome.post_install(
4271 gtk_update_icon_cache : true ,
4372 update_desktop_database : true ,
4473)
45-
46- # Code formatting targets
47- uncrustify = find_program (' uncrustify' , required : false )
48- if uncrustify.found()
49- run_target (' format' ,
50- command : [find_program (' bash' ), files (' format.sh' )],
51- depends : []
52- )
53-
54- run_target (' check-format' ,
55- command : [find_program (' bash' ), files (' check-format.sh' )],
56- depends : []
57- )
58- endif
0 commit comments