1- project (
2- ' geopard' ,
3- ' rust' ,
4- version : ' 1.5.0' ,
5- meson_version : ' >= 0.59' ,
6- # license: MIT,
1+ project (' geopard' , ' rust' ,
2+ version : ' 1.5.0' ,
3+ license : ' GPL-3.0-or-later' ,
4+ meson_version : ' >= 0.62.0' ,
5+ default_options : [' warning_level=2' ,
6+ ' werror=false' ,
7+ ],
78)
89
10+ # Import modules
911i18n = import (' i18n' )
1012gnome = import (' gnome' )
1113
12- base_id = ' com.ranfdev.Geopard'
14+ # Project information
15+ PROJECT_URL = ' https://ranfdev.com/projects/Geopard'
16+ REPO_URL = ' https://github.com/ranfdev/Geopard'
17+ BUGTRACKER_URL = ' https://github.com/ranfdev/Geopard/issues'
18+ DONATIONS_URL = ' https://github.com/sponsors/ranfdev'
19+ #TRANSLATE_URL = 'https://hosted.weblate.org/projects/ranfdev/Geopard'
1320
14- dependency (' glib-2.0' , version : ' >= 2.66' )
15- dependency (' gio-2.0' , version : ' >= 2.66' )
16- dependency (' gtk4' , version : ' >= 4.0.0' )
17-
18- glib_compile_resources = find_program (' glib-compile-resources' , required : true )
19- glib_compile_schemas = find_program (' glib-compile-schemas' , required : true )
20- desktop_file_validate = find_program (' desktop-file-validate' , required : false )
21-
22- cargo = find_program (' cargo' , required : true )
21+ # Constants
22+ PROJECT_RDNN_NAME = ' com.ranfdev.Geopard'
23+ ROOT_PATH = ' /com/ranfdev/Geopard'
24+ BIN_DIR = join_paths (get_option (' prefix' ), get_option (' bindir' ))
25+ PKGDATA_DIR = join_paths (get_option (' prefix' ), get_option (' datadir' ), meson .project_name())
2326
24- version = meson .project_version()
25-
26- bindir = join_paths (get_option (' prefix' ), get_option (' bindir' ))
27- localedir = join_paths (get_option (' prefix' ), get_option (' localedir' ))
28- pkgdatadir = join_paths (get_option (' prefix' ), get_option (' datadir' ), meson .project_name())
29- iconsdir = join_paths (get_option (' prefix' ), get_option (' datadir' ), ' icons' )
30- podir = join_paths (meson .project_source_root(), ' po' )
31-
32- gettext_package = meson .project_name()
27+ # Check if cargo and git exist
28+ cargo_bin = find_program (' cargo' , required : true )
29+ git_bin = find_program (' git' , required : false )
3330
31+ # Set APPLICATION_ID and VERSION_SUFFIX
3432if get_option (' profile' ) == ' development'
35- profile = ' Devel'
36- vcs_tag = run_command (' git' , ' rev-parse' , ' --short' , ' HEAD' , check : true ).stdout().strip()
37- if vcs_tag == ''
38- version_suffix = ' -devel'
33+ if git_bin.found()
34+ VCS_TAG = run_command (' git' , ' rev-parse' , ' --short' , ' HEAD' , check : true ).stdout().strip()
35+ else
36+ VCS_TAG = ''
37+ endif
38+ if VCS_TAG == ''
39+ VERSION_SUFFIX = ' -devel'
3940 else
40- version_suffix = ' -@0@' .format(vcs_tag )
41+ VERSION_SUFFIX = ' -@0@' .format(VCS_TAG )
4142 endif
42- application_id = ' @0@.@1@ ' .format(base_id, profile )
43+ APPLICATION_ID = ' @0@.Devel ' .format(PROJECT_RDNN_NAME )
4344else
44- profile = ''
45- version_suffix = ''
46- application_id = base_id
45+ VERSION_SUFFIX = ''
46+ APPLICATION_ID = PROJECT_RDNN_NAME
4747endif
4848
49+ # Required dependencies
50+ dependency (' glib-2.0' , version : ' >= 2.66' )
51+ dependency (' gio-2.0' , version : ' >= 2.66' )
52+ dependency (' gtk4' , version : ' >= 4.12.0' )
53+ dependency (' libadwaita-1' , version : ' >= 1.5.0' )
4954
5055meson .add_dist_script(
5156 ' build-aux/dist-vendor.sh' ,
52- join_paths (meson .project_build_root(), ' meson-dist' , meson .project_name() + ' -' + version ),
57+ join_paths (meson .project_build_root(), ' meson-dist' , meson .project_name() + ' -' + meson .project_version() ),
5358 meson .project_source_root()
5459)
5560
61+ # Setup pre-commit hook to ensure the coding style is always consistent
5662if get_option (' profile' ) == ' development'
57- # Setup pre-commit hook for ensuring coding style is always consistent
58- message (' Setting up git pre-commit hook..' )
63+ message (' Setting up git pre-commit hook...' )
5964 run_command (' cp' , ' -f' , ' hooks/pre-commit.hook' , ' .git/hooks/pre-commit' , check : false )
6065 run_command (' chmod' , ' +x' , ' .git/hooks/pre-commit' , check : false )
6166endif
6267
68+ # Set configuration data
69+ conf = configuration_data ()
70+ conf.set(' APP_ID' , APPLICATION_ID)
71+ conf.set(' ROOT_PATH' , ROOT_PATH)
72+ conf.set(' PKGDATA_DIR' , PKGDATA_DIR)
73+ conf.set(' LOCALE_DIR' , join_paths (get_option (' prefix' ), get_option (' localedir' )))
74+ conf.set(' VERSION' , meson .project_version() + VERSION_SUFFIX)
75+ conf.set(' GETTEXT_PACKAGE' , meson .project_name())
76+
77+ # Subdirs
6378subdir (' data' )
6479subdir (' po' )
6580subdir (' src' )
6681
82+ # Create devenv if profile is set to 'development'
6783if get_option (' profile' ) == ' development'
6884 devenv = environment ()
6985
@@ -74,9 +90,9 @@ if get_option('profile') == 'development'
7490 meson .add_devenv(devenv)
7591endif
7692
93+ # Execute post-installation GTK/GNOME scripts
7794gnome.post_install(
78- gtk_update_icon_cache : true ,
7995 glib_compile_schemas : true ,
96+ gtk_update_icon_cache : true ,
8097 update_desktop_database : true ,
8198)
82-
0 commit comments