Strange problem with meson installation path
Supposedly if I setup the project with a --prefix=/usr
option the installation of the file will be based on /usr
instead of /usr/local
. Surprisingly this isn't the case for the current ibus-cangjie setup.
Steps to Reproduce
Clone the Repository and Setup
Clone this repository. If there is a previous clone, remove all previous compilation artifacts by:
git clean -fdx
Setup the build to have a prefix --prefix=/usr
and then build it:
meson setup builddir --prefix=/usr --wipe && meson build
This is the output of my run:
Output
$ meson setup builddir --prefix /usr --wipe && meson build
The Meson build system
Version: 1.4.1
Source dir: /home/foobar/src/ibus-cangjie
Build dir: /home/foobar/src/ibus-cangjie/builddir
Build type: native build
Project name: ibus-cangjie
Project version: 2.4.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 (cangjie) found: YES (/usr/bin/python3) modules: cangjie
Configuring org.freedesktop.cangjie.ibus.Cangjie.metainfo.xml.in using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Configuring org.freedesktop.cangjie.ibus.Quick.metainfo.xml.in using configuration
Configuring org.freedesktop.cangjie.ibus.cangjie-setup.desktop.in using configuration
Configuring org.freedesktop.cangjie.ibus.quick-setup.desktop.in using configuration
Configuring org.freedesktop.cangjie.ibus.Cangjie.xml using configuration
Configuring org.freedesktop.cangjie.ibus.Quick.xml using configuration
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.1
Build-time dependency gio-2.0 found: YES 2.80.3
Program /usr/bin/glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Configuring ibus-engine-cangjie using configuration
Configuring ibus-setup-cangjie using configuration
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Configuring run_tests using configuration
Program coverage found: YES (/usr/bin/coverage)
Build targets in project: 11
ibus-cangjie 2.4.1
User defined options
prefix: /usr
Found ninja-1.12.1 at /usr/bin/ninja
The Meson build system
Version: 1.4.1
Source dir: /home/foobar/src/ibus-cangjie
Build dir: /home/foobar/src/ibus-cangjie/build
Build type: native build
Project name: ibus-cangjie
Project version: 2.4.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 (cangjie) found: YES (/usr/bin/python3) modules: cangjie
Configuring org.freedesktop.cangjie.ibus.Cangjie.metainfo.xml.in using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Configuring org.freedesktop.cangjie.ibus.Quick.metainfo.xml.in using configuration
Configuring org.freedesktop.cangjie.ibus.cangjie-setup.desktop.in using configuration
Configuring org.freedesktop.cangjie.ibus.quick-setup.desktop.in using configuration
Configuring org.freedesktop.cangjie.ibus.Cangjie.xml using configuration
Configuring org.freedesktop.cangjie.ibus.Quick.xml using configuration
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.1
Build-time dependency gio-2.0 found: YES 2.80.3
Program /usr/bin/glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Configuring ibus-engine-cangjie using configuration
Configuring ibus-setup-cangjie using configuration
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Configuring run_tests using configuration
Program coverage found: YES (/usr/bin/coverage)
Build targets in project: 11
Found ninja-1.12.1 at /usr/bin/ninja
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
Please note that in this section, we can confirm that meson indeed got the prefix option:
Build targets in project: 11
ibus-cangjie 2.4.1
User defined options
prefix: /usr
Check the Configuration for Install
At this stage, you can check your configuration by entering the ./build
folder and run meson configure
:
cd ./build
meson configure
The output I got:
Output
$ meson configure
Core properties:
Source dir /home/foobar/srd/ibus-cangjie
Build dir /home/foobar/srd/ibus-cangjie/build
Main project options:
Core options Current Value Possible Values Description
-------------- ------------- --------------- -----------
auto_features auto [enabled, disabled, auto] Override value of all 'auto' features
backend ninja [ninja, vs, vs2010, vs2012, Backend to use
vs2013, vs2015, vs2017, vs2019,
vs2022, xcode, none]
buildtype debug [plain, debug, debugoptimized, Build type to use
release, minsize, custom]
cmake_prefix_path [] [] List of additional prefixes for cmake to search
debug true [true, false] Enable debug symbols and other information
default_library shared [shared, static, both] Default library type
force_fallback_for [] [] Force fallback for those subprojects
genvslite vs2022 [vs2022] Setup multiple buildtype-suffixed ninja-backend build directories,
and a [builddir]_vs containing a Visual Studio meta-backend with
multiple configurations that calls into them
install_umask 0022 [preserve, 0000-0777] Default umask to apply on permissions of installed files
layout mirror [mirror, flat] Build directory layout
optimization 0 [plain, 0, g, 1, 2, 3, s] Optimization level
pkg_config_path [] [] List of additional paths for pkg-config to search
prefer_static false [true, false] Whether to try static linking before shared linking
strip false [true, false] Strip targets on install
unity off [on, off, subprojects] Unity build
unity_size 4 >=2 Unity block size
vsenv false [true, false] Activate Visual Studio environment
warning_level 1 [0, 1, 2, 3, everything] Compiler warning level to use
werror false [true, false] Treat warnings as errors
wrap_mode default [default, nofallback, nodownload, Wrap mode
forcefallback, nopromote]
Backend options Current Value Possible Values Description
----------------- ------------- --------------- -----------
backend_max_links 0 >=0 Maximum number of linker processes to run or 0 for no limit
python module options Current Value Possible Values Description
----------------------- ------------- --------------- -----------
python.allow_limited_api true [true, false] Whether to allow use of the Python Limited API
python.bytecompile 0 >=-1, <=2 Whether to compile bytecode
python.install_env prefix [auto, prefix, system, venv] Which python environment to install to
python.platlibdir Directory for site-specific, platform-specific files.
python.purelibdir Directory for site-specific, non-platform-specific files.
Directories Current Value Possible Values Description
------------- ------------- --------------- -----------
bindir bin Executable directory
datadir share Data file directory
includedir include Header file directory
infodir share/info Info page directory
libdir lib64 Library directory
libexecdir libexec Library executable directory
licensedir Licenses directory
localedir share/locale Locale data directory
localstatedir /var/local Localstate data directory
mandir share/man Manual page directory
prefix /usr/local Installation prefix
sbindir sbin System executable directory
sharedstatedir /var/local/lib Architecture-independent data directory
sysconfdir etc Sysconf data directory
Testing options Current Value Possible Values Description
----------------- ------------- --------------- -----------
errorlogs true [true, false] Whether to print the logs from failing tests
stdsplit true [true, false] Split stdout and stderr in test logs
Please note that in the output, you'll find these lines:
prefix /usr/local Installation prefix
This is really unexpected. And if I go ahead to install it, everything will go to /usr/local
.
Expected Behaviour
The resulting configuration should state that ibus-cangjie will be installed to /usr
. And installation would indeed install to that path.
Software Versions
- ibus-cangjie: d3bc7e93
- meson: 1.4.1
- ninja: 1.12.1
- python: 3.12.4
- OS: Fedora 40