diff --git a/meson.build b/meson.build index 26deafd562..19a441bfb7 100644 --- a/meson.build +++ b/meson.build @@ -631,34 +631,6 @@ endif ##################################################################### -version_tag = get_option('version-tag') -if version_tag != '' - vcs_data = configuration_data() - vcs_data.set('VCS_TAG', version_tag) - version_h = configure_file(configuration : vcs_data, - input : 'src/version/version.h.in', - output : 'version.h') -else - vcs_tagger = [ - project_source_root + '/tools/meson-vcs-tag.sh', - project_source_root, - meson.project_version()] - - version_h = vcs_tag( - input : 'src/version/version.h.in', - output : 'version.h', - command: vcs_tagger) -endif - -versiondep = declare_dependency( - sources: version_h, - include_directories : include_directories('.')) - -shared_lib_tag = get_option('shared-lib-tag') -if shared_lib_tag == '' - shared_lib_tag = meson.project_version() -endif - sh = find_program('sh') echo = find_program('echo') sed = find_program('sed') @@ -2145,6 +2117,42 @@ xml_helper_py = find_program('tools/xml_helper.py') ############################################################ +version_tag = get_option('version-tag') +if version_tag == '' + # Check that we have either .git/ (a normal clone) or a .git file (a work-tree) and that we don't + # get confused if a tarball is extracted in a higher-level git repository. + if git.found() and fs.exists(project_source_root / '.git') + # Apparently git describe has a bug where it always considers the work-tree dirty when + # invoked with --git-dir (even though 'git status' is happy). Work around this issue by + # cd-ing to the source directory. + version_tag = run_command( + sh, '-c', + 'cd "$MESON_SOURCE_ROOT"; git describe --abbrev=7 --dirty=^ 2>/dev/null | sed "s/^v//; s/-rc/~rc/"', + check : true, + ).stdout().strip() + else + version_tag = meson.project_version() + endif +endif + +vcs_data = configuration_data() +vcs_data.set('VCS_TAG', version_tag) +version_h = configure_file(configuration : vcs_data, + input : 'src/version/version.h.in', + output : 'version.h') + +versiondep = declare_dependency( + sources : version_h, + include_directories : include_directories('.'), +) + +shared_lib_tag = get_option('shared-lib-tag') +if shared_lib_tag == '' + shared_lib_tag = meson.project_version() +endif + +############################################################ + if get_option('b_coverage') userspace_c_args += ['-include', 'src/basic/coverage.h'] endif @@ -2162,6 +2170,7 @@ jinja2_cmdline = [meson_render_jinja2, config_h, version_h] userspace = declare_dependency( compile_args : userspace_c_args, link_args : userspace_c_ld_args, + dependencies : versiondep, ) man_page_depends = [] @@ -2251,8 +2260,7 @@ install_libsystemd_static = static_library( libxz, libzstd, threads, - userspace, - versiondep], + userspace], c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC'])) libudev = shared_library( @@ -2287,8 +2295,7 @@ install_libudev_static = static_library( link_depends : libudev_sym, dependencies : [libmount, libshared_deps, - userspace, - versiondep], + userspace], c_args : static_libudev_pic ? [] : ['-fno-PIC'], pic : static_libudev_pic) @@ -2304,8 +2311,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 libshared], dependencies : [libcryptsetup, tpm2, - userspace, - versiondep], + userspace], link_depends : cryptsetup_token_sym, install_rpath : pkglibdir, install : true, @@ -2323,8 +2329,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 libshared], dependencies : [libcryptsetup, libfido2, - userspace, - versiondep], + userspace], link_depends : cryptsetup_token_sym, install_rpath : pkglibdir, install : true, @@ -2342,8 +2347,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 libshared], dependencies : [libcryptsetup, libp11kit, - userspace, - versiondep], + userspace], link_depends : cryptsetup_token_sym, install_rpath : pkglibdir, install : true, @@ -2484,8 +2488,7 @@ exe = executable( link_with : [libcore, libshared], dependencies : [libseccomp, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2503,8 +2506,7 @@ exe = executable( link_with : [libcore, libshared], dependencies : [libseccomp, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : conf.get('ENABLE_ANALYZE') == 1) if conf.get('ENABLE_ANALYZE') == 1 @@ -2528,8 +2530,7 @@ executable( libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2541,8 +2542,7 @@ public_programs += executable( link_with : [libjournal_core, libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -2564,8 +2564,7 @@ public_programs += executable( libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -2677,8 +2676,7 @@ if conf.get('HAVE_BLKID') == 1 'src/dissect/dissect.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -2712,8 +2710,7 @@ if conf.get('ENABLE_RESOLVE') == 1 libidn, libm, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -2735,8 +2732,7 @@ if conf.get('ENABLE_LOGIND') == 1 libshared], dependencies : [libacl, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2750,8 +2746,7 @@ if conf.get('ENABLE_LOGIND') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -2760,8 +2755,7 @@ if conf.get('ENABLE_LOGIND') == 1 'src/login/inhibit.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -2779,8 +2773,7 @@ if conf.get('ENABLE_LOGIND') == 1 dependencies : [libpam_misc, libpam, threads, - userspace, - versiondep], + userspace], link_depends : pam_systemd_sym, install : true, install_tag : 'pam', @@ -2831,8 +2824,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1 include_directories : includes, link_with : [boot_link_with], dependencies : [libblkid, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) public_programs += exe @@ -2850,8 +2842,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1 include_directories : includes, link_with : [boot_link_with], dependencies : [libblkid, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2873,8 +2864,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1 include_directories : includes, link_with : [libshared], dependencies : [libopenssl, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2886,8 +2876,7 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1 dependencies : [libblkid, libopenssl, tpm2, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2900,8 +2889,7 @@ executable( include_directories : includes, link_with : [libshared], dependencies : [libblkid, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2912,8 +2900,7 @@ public_programs += executable( include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -2928,8 +2915,7 @@ systemctl = executable( libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) public_programs += systemctl @@ -2949,8 +2935,7 @@ if conf.get('ENABLE_PORTABLED') == 1 link_with : [portabled_link_with], dependencies : [libselinux, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2961,8 +2946,7 @@ if conf.get('ENABLE_PORTABLED') == 1 include_directories : includes, link_with : [portabled_link_with], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) endif @@ -2973,8 +2957,7 @@ if conf.get('ENABLE_SYSEXT') == 1 systemd_sysext_sources, include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) endif @@ -2986,8 +2969,7 @@ if conf.get('ENABLE_USERDB') == 1 include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -2998,8 +2980,7 @@ if conf.get('ENABLE_USERDB') == 1 include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3010,8 +2991,7 @@ if conf.get('ENABLE_USERDB') == 1 include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) endif @@ -3029,8 +3009,7 @@ if conf.get('ENABLE_HOMED') == 1 libopenssl, libp11kit, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3044,8 +3023,7 @@ if conf.get('ENABLE_HOMED') == 1 libm, libopenssl, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3060,8 +3038,7 @@ if conf.get('ENABLE_HOMED') == 1 libopenssl, libp11kit, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -3080,8 +3057,7 @@ if conf.get('ENABLE_HOMED') == 1 libpam_misc, libpam, threads, - userspace, - versiondep], + userspace], link_depends : pam_systemd_home_sym, install : true, install_tag : 'pam', @@ -3151,8 +3127,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1 dependencies : [libcryptsetup, libopenssl, libp11kit, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3173,8 +3148,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1 include_directories : includes, link_with : [libshared], dependencies : [libcryptsetup, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3184,8 +3158,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1 'src/veritysetup/veritysetup-generator.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : systemgeneratordir) @@ -3199,8 +3172,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1 libdl, libopenssl, libp11kit, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -3210,8 +3182,7 @@ if conf.get('HAVE_LIBCRYPTSETUP') == 1 include_directories : includes, link_with : [libshared], dependencies : [libcryptsetup, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3294,8 +3265,7 @@ if conf.get('ENABLE_HOSTNAMED') == 1 'src/hostname/hostnamectl.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) endif @@ -3307,8 +3277,7 @@ if conf.get('ENABLE_LOCALED') == 1 include_directories : includes, link_with : [libshared], dependencies : libxkbcommon_deps + - [userspace, - versiondep], + [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3318,8 +3287,7 @@ if conf.get('ENABLE_LOCALED') == 1 localectl_sources, include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) endif @@ -3344,8 +3312,7 @@ if conf.get('ENABLE_TIMEDATECTL') == 1 install_rpath : pkglibdir, link_with : [libshared], dependencies : [libm, - userspace, - versiondep], + userspace], install : true) endif @@ -3357,8 +3324,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1 link_with : [libtimesyncd_core], dependencies : [libm, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3395,8 +3361,7 @@ if conf.get('ENABLE_MACHINED') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) endif @@ -3408,8 +3373,7 @@ if conf.get('ENABLE_IMPORTD') == 1 include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3425,8 +3389,7 @@ if conf.get('ENABLE_IMPORTD') == 1 libcurl, libxz, libz, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3441,8 +3404,7 @@ if conf.get('ENABLE_IMPORTD') == 1 libcurl, libxz, libz, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3453,8 +3415,7 @@ if conf.get('ENABLE_IMPORTD') == 1 include_directories : includes, link_with : [libshared, lib_import_common], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3469,8 +3430,7 @@ if conf.get('ENABLE_IMPORTD') == 1 libcurl, libxz, libz, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3490,8 +3450,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3510,8 +3469,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3527,8 +3485,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3546,8 +3503,7 @@ if conf.get('ENABLE_COREDUMP') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3562,8 +3518,7 @@ if conf.get('ENABLE_COREDUMP') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) endif @@ -3579,8 +3534,7 @@ if conf.get('ENABLE_PSTORE') == 1 libxz, libzstd, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3592,8 +3546,7 @@ if conf.get('ENABLE_OOMD') == 1 include_directories : includes, link_with : [libshared], dependencies : [libatomic, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3603,8 +3556,7 @@ if conf.get('ENABLE_OOMD') == 1 oomctl_sources, include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) endif @@ -3615,8 +3567,7 @@ if conf.get('ENABLE_BINFMT') == 1 'src/binfmt/binfmt.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3640,8 +3591,7 @@ if conf.get('ENABLE_SYSUPDATE') == 1 libfdisk, libopenssl, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3666,8 +3616,7 @@ if conf.get('ENABLE_RANDOMSEED') == 1 'src/random-seed/random-seed.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3680,8 +3629,7 @@ if conf.get('ENABLE_FIRSTBOOT') == 1 include_directories : includes, link_with : [libshared], dependencies : [libcrypt, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) endif @@ -3691,8 +3639,7 @@ executable( 'src/remount-fs/remount-fs.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3702,8 +3649,7 @@ executable( 'src/machine-id-setup/machine-id-setup-main.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3712,8 +3658,7 @@ executable( 'src/fsck/fsck.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3723,8 +3668,7 @@ executable( 'src/partition/growfs.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3734,8 +3678,7 @@ executable( 'src/partition/makefs.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3745,8 +3688,7 @@ executable( 'src/sleep/sleep.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3761,8 +3703,7 @@ public_programs += executable( 'src/sysctl/sysctl.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -3772,8 +3713,7 @@ public_programs += executable( 'src/ac-power/ac-power.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3782,8 +3722,7 @@ public_programs += executable( 'src/detect-virt/detect-virt.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3792,8 +3731,7 @@ public_programs += executable( 'src/delta/delta.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3802,8 +3740,7 @@ public_programs += executable( 'src/escape/escape.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3812,8 +3749,7 @@ public_programs += executable( 'src/notify/notify.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3824,8 +3760,7 @@ public_programs += executable( link_with : [libshared], dependencies : [threads, libopenssl, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -3834,7 +3769,7 @@ public_programs += executable( 'src/battery-check/battery-check.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install_dir : libexecdir, install : true) @@ -3874,8 +3809,7 @@ systemd_id128 = executable( 'src/id128/id128.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) public_programs += systemd_id128 @@ -3893,8 +3827,7 @@ public_programs += executable( 'src/path/path.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3903,8 +3836,7 @@ public_programs += executable( 'src/ask-password/ask-password.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3923,8 +3855,7 @@ public_programs += executable( 'src/tty-ask-password-agent/tty-ask-password-agent.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3933,8 +3864,7 @@ public_programs += executable( 'src/cgls/cgls.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3943,8 +3873,7 @@ public_programs += executable( 'src/cgtop/cgtop.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3964,8 +3893,7 @@ public_programs += executable( include_directories : includes, link_with : [libshared], dependencies: [libmount, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -3977,8 +3905,7 @@ public_programs += executable( 'src/run/run.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3987,8 +3914,7 @@ public_programs += executable( 'src/stdio-bridge/stdio-bridge.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -3997,8 +3923,7 @@ public_programs += executable( busctl_sources, include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) @@ -4008,8 +3933,7 @@ if enable_sysusers 'src/sysusers/sysusers.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) public_programs += exe @@ -4030,8 +3954,7 @@ if enable_sysusers libbasic, libbasic_gcrypt, libsystemd_static], - dependencies : [userspace, - versiondep], + dependencies : [userspace], build_by_default: have_standalone_binaries, install : have_standalone_binaries) if have_standalone_binaries @@ -4053,8 +3976,7 @@ if conf.get('ENABLE_TMPFILES') == 1 include_directories : includes, link_with : [libshared], dependencies : [libacl, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) public_programs += exe @@ -4076,8 +3998,7 @@ if conf.get('ENABLE_TMPFILES') == 1 libbasic_gcrypt, libsystemd_static], dependencies : [libacl, - userspace, - versiondep], + userspace], build_by_default: have_standalone_binaries, install : have_standalone_binaries) if have_standalone_binaries @@ -4098,8 +4019,7 @@ if conf.get('ENABLE_HWDB') == 1 'src/hwdb/hwdb.c', include_directories : includes, link_with : udev_link_with, - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : udev_rpath, install : true) public_programs += systemd_hwdb @@ -4131,8 +4051,7 @@ public_programs += executable( include_directories : includes, link_with : [libshared], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4147,8 +4066,7 @@ udevadm = executable( libidn, libkmod, threads, - userspace, - versiondep], + userspace], install_rpath : udev_rpath, install : true) public_programs += udevadm @@ -4171,8 +4089,7 @@ if conf.get('ENABLE_REPART') == 1 libfdisk, libopenssl, threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) public_programs += exe @@ -4191,8 +4108,7 @@ if conf.get('ENABLE_REPART') == 1 libfdisk, libopenssl, threads, - userspace, - versiondep], + userspace], build_by_default: have_standalone_binaries, install_rpath : pkglibdir, install : have_standalone_binaries) @@ -4207,8 +4123,7 @@ executable( include_directories : includes, link_with : [libshared], dependencies : [libmount, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4222,8 +4137,7 @@ executable( libbasic, libsystemd_static], dependencies : [libmount, - userspace, - versiondep], + userspace], build_by_default: have_standalone_binaries, install_rpath : pkglibdir, install : have_standalone_binaries, @@ -4234,8 +4148,7 @@ executable( 'src/update-done/update-done.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4246,8 +4159,7 @@ executable( include_directories : includes, link_with : [libshared], dependencies : [libaudit, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : (conf.get('ENABLE_UTMP') == 1), install_dir : libexecdir) @@ -4259,8 +4171,7 @@ if conf.get('HAVE_KMOD') == 1 include_directories : includes, link_with : [libshared], dependencies : [libkmod, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4281,8 +4192,7 @@ public_programs += executable( libshared], dependencies : [libblkid, libseccomp, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true) @@ -4295,8 +4205,7 @@ if conf.get('ENABLE_NETWORKD') == 1 libsystemd_network, networkd_link_with], dependencies : [threads, - userspace, - versiondep], + userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4306,8 +4215,7 @@ if conf.get('ENABLE_NETWORKD') == 1 systemd_networkd_wait_online_sources, include_directories : includes, link_with : [networkd_link_with], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4318,8 +4226,7 @@ if conf.get('ENABLE_NETWORKD') == 1 include_directories : libsystemd_network_includes, link_with : [libsystemd_network, networkd_link_with], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true) endif @@ -4329,8 +4236,7 @@ exe = executable( network_generator_sources, include_directories : includes, link_with : [networkd_link_with], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4348,8 +4254,7 @@ executable( 'src/sulogin-shell/sulogin-shell.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : true, install_dir : libexecdir) @@ -4359,8 +4264,7 @@ kernel_install = executable( 'src/kernel-install/kernel-install.c', include_directories : includes, link_with : [libshared], - dependencies : [userspace, - versiondep], + dependencies : [userspace], install_rpath : pkglibdir, install : want_kernel_install) public_programs += kernel_install @@ -4426,11 +4330,12 @@ foreach test : tests deps = [ base.get('dependencies', []), test.get('dependencies', []), - versiondep, ] name = fs.name(sources[0]) - if not name.endswith('.cc') + if name.endswith('.cc') + deps += [versiondep] + else deps += [userspace] endif name = fs.stem(name) @@ -4580,7 +4485,6 @@ foreach fuzzer : fuzzers dependencies : [ dependencies, userspace, - versiondep, ], c_args : [test_cflags, fuzzer.get('c_args', [])], link_args: link_args, diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index eb5fceba8d..b7c852a08c 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -86,7 +86,6 @@ #include "unit-name.h" #include "verb-log-control.h" #include "verbs.h" -#include "version.h" DotMode arg_dot = DEP_ALL; char **arg_dot_from_patterns = NULL, **arg_dot_to_patterns = NULL; diff --git a/src/basic/build.h b/src/basic/build.h index 27d44111d4..5b7c83cad9 100644 --- a/src/basic/build.h +++ b/src/basic/build.h @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "version.h" - extern const char* const systemd_features; int version(void); diff --git a/src/basic/meson.build b/src/basic/meson.build index 3af013b014..f6e6b6ace5 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -270,8 +270,7 @@ libbasic = static_library( dependencies : [libcap, libm, threads, - userspace, - versiondep], + userspace], c_args : ['-fvisibility=default'], build_by_default : false) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index e99bdb8748..3eecaf474b 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -98,13 +98,9 @@ elif get_option('sbat-distro') != '' pkgver = get_option('sbat-distro-version') if pkgver == '' - efi_conf.set('SBAT_DISTRO_VERSION', 'GIT_VERSION') - # This is determined during build, not configuration, so we can't display it yet. - sbat_distro_version_display = '(git version)' - else - efi_conf.set_quoted('SBAT_DISTRO_VERSION', pkgver) - sbat_distro_version_display = pkgver + pkgver = version_tag endif + efi_conf.set_quoted('SBAT_DISTRO_VERSION', pkgver) endif summary({'UEFI architectures' : efi_arch + (efi_arch_alt == '' ? '' : ', ' + efi_arch_alt)}, @@ -114,7 +110,7 @@ if efi_conf.get('SBAT_DISTRO', '') != '' summary({ 'SBAT distro': efi_conf.get('SBAT_DISTRO'), 'SBAT distro generation': efi_conf.get('SBAT_DISTRO_GENERATION'), - 'SBAT distro version': sbat_distro_version_display, + 'SBAT distro version': efi_conf.get('SBAT_DISTRO_VERSION'), 'SBAT distro summary': efi_conf.get('SBAT_DISTRO_SUMMARY'), 'SBAT distro URL': efi_conf.get('SBAT_DISTRO_URL')}, section : 'UEFI') diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 1204b913c9..074de33eea 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -39,6 +39,7 @@ #include "strv.h" #include "syslog-util.h" #include "user-util.h" +#include "version.h" #include "virt.h" #include "watchdog.h" diff --git a/src/core/main.c b/src/core/main.c index a0e95b4373..822825ca6f 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -99,6 +99,7 @@ #include "time-util.h" #include "umask-util.h" #include "user-util.h" +#include "version.h" #include "virt.h" #include "watchdog.h" diff --git a/src/core/manager-dump.c b/src/core/manager-dump.c index e39aff5d89..4575a291e3 100644 --- a/src/core/manager-dump.c +++ b/src/core/manager-dump.c @@ -7,6 +7,7 @@ #include "manager-dump.h" #include "memstream-util.h" #include "unit-serialize.h" +#include "version.h" void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix) { Job *j; diff --git a/src/core/meson.build b/src/core/meson.build index 81dab61f82..c3a45dc3b1 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -130,8 +130,7 @@ libcore = shared_library( libseccomp, libselinux, threads, - userspace, - versiondep], + userspace], install : true, install_dir : pkglibdir) diff --git a/src/fundamental/sbat.h b/src/fundamental/sbat.h index a18da48038..b3c09dcb4c 100644 --- a/src/fundamental/sbat.h +++ b/src/fundamental/sbat.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "version.h" - #ifdef SBAT_DISTRO # define SBAT_SECTION_TEXT \ "sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\n" \ diff --git a/src/shared/meson.build b/src/shared/meson.build index 889d9a391f..2930e8c354 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -311,8 +311,7 @@ libshared_deps = [threads, libselinux, libxenctrl, libxz, - libzstd, - versiondep] + libzstd] libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir()) libshared_build_dir = meson.current_build_dir() diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index 1b2c00734a..12abc18524 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -17,7 +17,6 @@ #include "io-util.h" #include "log.h" #include "main-func.h" -#include "version.h" #define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket" diff --git a/src/test/test-cgroup-setup.c b/src/test/test-cgroup-setup.c index c377ff0a00..e669e9b5ab 100644 --- a/src/test/test-cgroup-setup.c +++ b/src/test/test-cgroup-setup.c @@ -9,7 +9,6 @@ #include "proc-cmdline.h" #include "string-util.h" #include "tests.h" -#include "version.h" static void test_is_wanted_print_one(bool header) { _cleanup_free_ char *cmdline = NULL; diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 4f430a1df2..afa6283011 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -15,7 +15,6 @@ #include "strv.h" #include "tests.h" #include "user-util.h" -#include "version.h" static void check_p_d_u(const char *path, int code, const char *result) { _cleanup_free_ char *unit = NULL; diff --git a/src/udev/meson.build b/src/udev/meson.build index dc490a5abf..01ec8b79bc 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -136,8 +136,7 @@ foreach prog : udev_progs name, prog, include_directories : includes, - dependencies : [userspace, - versiondep], + dependencies : [userspace], link_with : udev_link_with, install_rpath : udev_rpath, install : true, diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh deleted file mode 100755 index 3964a8e198..0000000000 --- a/tools/meson-vcs-tag.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eu -set -o pipefail - -dir="${1:?}" -fallback="${2:?}" - -# Apparently git describe has a bug where it always considers the work-tree -# dirty when invoked with --git-dir (even though 'git status' is happy). Work -# around this issue by cd-ing to the source directory. -cd "$dir" -# Check that we have either .git/ (a normal clone) or a .git file (a work-tree) -# and that we don't get confused if a tarball is extracted in a higher-level -# git repository. -[ -e .git ] && \ - git describe --abbrev=7 --dirty=^ 2>/dev/null | sed 's/^v//; s/-rc/~rc/' || \ - echo "$fallback"