Bug 270594 - textproc/fcitx5 ignores the options
Summary: textproc/fcitx5 ignores the options
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ka Ho Ng
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-02 06:13 UTC by hellomao
Modified: 2023-04-02 09:23 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (khng)


Attachments
The patch to the Makefile in textproc/fcitx5 (702 bytes, patch)
2023-04-02 06:13 UTC, hellomao
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hellomao 2023-04-02 06:13:15 UTC
Created attachment 241256 [details]
The patch to the Makefile in textproc/fcitx5

textproc/fcitx5 port provides three options ENCHANT, WAYLAND, and X11. If I explicitly mark WAYLAND or X11 off, the build still look for WAYLAND or X11 and fails if they doesn't exist.

Repro steps:
1. Make WAYLAND off. For example, below is the config I'm using
```
fcitx5 $ sudo make showconfig
Password:
===> The following configuration options are available for fcitx5-5.0.11_2:
     ENCHANT=on: Dictionary/spellchecking framework
     WAYLAND=off: Wayland (graphics) support
     X11=on: X11 (graphics) support
===> Use 'make config' to modify these settings
```

2. Build it (the machine must not have wayland install)
Here is the error
```
-- Could NOT find Wayland_Client (missing: Wayland_Client_LIBRARY Wayland_Client_INCLUDE_DIR) (found version "") -- Could NOT find Wayland_Egl (missing: Wayland_Egl_LIBRARY Wayland_Egl_INCLUDE_DIR Wayland_Client_FOUND) (found version "") CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Wayland (missing: Wayland_LIBRARIES Client Egl) Call Stack (most recent call first):

/usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/ECM/find-modules/FindWayland.cmake:110 (find_package_handle_standard_args) CMakeLists.txt:157 (find_package)

-- Configuring incomplete, errors occurred!
```

Root Cause

fcitx5 source code uses the options `ENABLE_X11` and `ENABLE_WAYLAND`. As shown in the code at https://github.com/fcitx/fcitx5/blob/master/CMakeLists.txt
Here is the code snippet
```
option(ENABLE_X11 "Enable X11 support" On)
option(ENABLE_WAYLAND "Enable wayland support" On)
```

By default FreeBSD port convert the option using the option name. fcitxt5 source code has "ENABLE_" before the name. So neither ENABLE_X11 or ENABLE_WAYLAND is set and they're always "On" even if I mark them off in FreeBSD port.

I added the following two lines in the Makefile in the port and it builds without WAYLAND
```
X11_CMAKE_BOOL=         ENABLE_X11
WAYLAND_CMAKE_BOOL=     ENABLE_WAYLAND
```
I also attach the diff of the Makefile for the port textproc/fcitx5.