public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <rosset.filipe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/highlight] rawhide: move to meson: complete GUI sources, gate on Qt6, install lsp.conf/l10n
Date: Fri, 13 Nov 2026 16:08:30 GMT	[thread overview]
Message-ID: <179458611046.1.12481280181325649704.rpms-highlight-646c08c9ff03@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/highlight
Branch : rawhide
Commit : 646c08c9ff03bb7163bc99982a004e2124ac894a
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date   : 2026-11-10T12:45:27-03:00
Stats  : +93/-23 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/highlight/c/646c08c9ff03bb7163bc99982a004e2124ac894a?branch=rawhide

Log:
move to meson: complete GUI sources, gate on Qt6, install lsp.conf/l10n

---
diff --git a/highlight.spec b/highlight.spec
index 6617fae..02a0aaf 100644
--- a/highlight.spec
+++ b/highlight.spec
@@ -9,13 +9,17 @@ License:        GPL-3.0-only
 URL:            http://www.andre-simon.de/
 Source0:        %{forgesource}
 
+# https://gitlab.com/saalen/highlight/-/merge_requests/177
+Patch0:         meson-gui-lspconf.patch
+
+# The meson GUI is built with Qt; disable it on RHEL < 10 (no Qt6).
 %bcond qt %[%{undefined rhel} || 0%{?rhel} < 10]
 
 BuildRequires:  boost-devel
 BuildRequires:  desktop-file-utils
 BuildRequires:  gcc-c++
 BuildRequires:  lua-devel
-BuildRequires:  make
+BuildRequires:  meson
 %if %{with qt}
 BuildRequires:  qt6-qtbase-devel
 %endif
@@ -41,7 +45,7 @@ A Qt-based GUI for the highlight source code formatter source.
 %endif
 
 %prep
-%forgeautosetup
+%forgeautosetup -p1
 # Fix line endings of extra batch files to avoid rpmlint warnings
 find extras/ -type f -name "*.bat" -exec sed -i 's/\r$//' {} +
 find extras/ -type f -name "*.pb" -exec sed -i 's/\r$//' {} +
@@ -51,27 +55,12 @@ rm -f extras/themes-resources/css-themes/UNLICENCE
 ln -s ../../langDefs-resources/UNLICENCE extras/themes-resources/css-themes/UNLICENCE
 
 %build
-%set_build_flags
-# The makefile compiles C++ files using CFLAGS, so we add CXXFLAGS to CFLAGS in the environment
-export CFLAGS="$CFLAGS $CXXFLAGS -fPIC"
-
-%make_build all \
-    PREFIX="%{_prefix}" \
-    conf_dir="%{_sysconfdir}/"
-
-%if %{with qt}
-cd src/gui-qt
-%qmake_qt6
-%make_build
-cd ../..
-%endif
+# The GUI build is gated on Qt6 availability (see meson-gui-lspconf.patch)
+%meson
+%meson_build
 
 %install
-%make_install PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/"
-
-%if %{with qt}
-make install-gui DESTDIR=%{buildroot} PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/"
-%endif
+%meson_install
 
 mkdir -p %{buildroot}%{_licensedir}/%{name}
 mv %{buildroot}%{_docdir}/%{name}/COPYING %{buildroot}%{_licensedir}/%{name}/
@@ -79,7 +68,7 @@ mv %{buildroot}%{_docdir}/%{name}/COPYING %{buildroot}%{_licensedir}/%{name}/
 %check
 # Upstream test suite (src/ci_test.sh) requires network (git clone), so run a
 # basic smoke test of the built binary instead
-printf 'print(\"hello\")' > test.py
+printf 'print("hello")' > test.py
 %{buildroot}%{_bindir}/highlight --version
 grep -q 'hello' <(%{buildroot}%{_bindir}/highlight test.py)
 
@@ -107,6 +96,5 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/highlight.desktop
 %{_datadir}/icons/hicolor/256x256/apps/highlight.png
 %endif
 
-
 %changelog
 %autochangelog

diff --git a/meson-gui-lspconf.patch b/meson-gui-lspconf.patch
new file mode 100644
index 0000000..0a76515
--- /dev/null
+++ b/meson-gui-lspconf.patch
@@ -0,0 +1,82 @@
+From: Filipe Rosset <rosset.filipe@gmail.com>
+Subject: meson: complete GUI sources, gate on Qt6, install lsp.conf/l10n
+
+The meson build (new in 4.22) differs from the makefile in four ways that
+would break or regress the package:
+  - the new 4.22 GUI sources (syntaxpalette, thememodel, themeswatchdelegate)
+    are missing from gui_objects and moc_headers, so the GUI fails to link
+  - the GUI is built unconditionally, breaking the %bcond qt gate on RHEL < 10
+  - lsp.conf is not installed (the makefile installs all *.conf to the config dir)
+  - the GUI l10n translations (gui_files/l10n/*.qm) are not installed
+
+Fix all four by adding the missing GUI sources/moc headers, gating the GUI
+build and its installed files on qt6 being present (the spec controls Qt
+availability via BuildRequires), dropping the now unneeded qt5 fallback,
+installing lsp.conf alongside filetypes.conf, and installing the l10n directory.
+--- a/meson.build	2026-11-09 00:02:57.338676377 -0300
++++ b/meson.build	2026-11-09 00:30:08.581064809 -0300
+@@ -112,22 +112,24 @@
+ 
+ qt_version = 'qt6'
+ qt = dependency('qt6', modules : ['Core', 'Gui', 'Widgets'], required: false)
+-if not qt.found()
+-  qt = dependency('qt5', version : '>=5.15', modules : ['Core', 'Gui', 'Widgets'])
+-  qt_version = 'qt5'
+-endif
+ 
++gui_enable = qt.found()
++
++if gui_enable
+ gui_objects = files(
+   'src/gui-qt/main.cpp',
+   'src/gui-qt/mainwindow.cpp',
+   'src/gui-qt/io_report.cpp',
+   'src/gui-qt/showtextfile.cpp',
+-  'src/gui-qt/syntax_chooser.cpp'
++  'src/gui-qt/syntax_chooser.cpp',
++  'src/gui-qt/syntaxpalette.cpp',
++  'src/gui-qt/thememodel.cpp',
++  'src/gui-qt/themeswatchdelegate.cpp'
+ )
+ 
+ qt5_mod = import(qt_version)
+ processed = qt5_mod.preprocess(
+-  moc_headers : ['src/gui-qt/mainwindow.h', 'src/gui-qt/io_report.h', 'src/gui-qt/showtextfile.h', 'src/gui-qt/syntax_chooser.h'],   # Only headers that need moc should be put here
++  moc_headers : ['src/gui-qt/mainwindow.h', 'src/gui-qt/io_report.h', 'src/gui-qt/showtextfile.h', 'src/gui-qt/syntax_chooser.h', 'src/gui-qt/syntaxpalette.h', 'src/gui-qt/thememodel.h', 'src/gui-qt/themeswatchdelegate.h'],   # Only headers that need moc should be put here
+   # moc_sources : 'helperFile.cpp', # must have #include"moc_helperFile.cpp"
+   ui_files    : ['src/gui-qt/mainwindow.ui', 'src/gui-qt/io_report.ui', 'src/gui-qt/showtextfile.ui', 'src/gui-qt/syntax_chooser.ui'],
+   qresources  : 'src/gui-qt/highlight-gui.qrc',
+@@ -140,6 +142,7 @@
+   link_with: highlight_lib,
+   install: true
+ )
++endif
+ 
+ bash_comp_dir = data_dir / 'bash-completion' / 'completions'
+ fish_comp_dir = data_dir / 'fish' / 'vendor_completions.d'
+@@ -149,7 +152,7 @@
+ desktop_icons_dir = data_dir / 'icons' / 'hicolor' / '256x256' / 'apps'
+ 
+ # Install files and directories
+-install_data('filetypes.conf', install_dir: highlight_conf_dir)
++install_data(['filetypes.conf', 'lsp.conf'], install_dir: highlight_conf_dir)
+ install_subdir('langDefs', install_dir: highlight_data_dir)
+ install_subdir('themes', install_dir: highlight_data_dir)
+ install_subdir('plugins', install_dir: highlight_data_dir)
+@@ -168,10 +171,12 @@
+   rename: '_highlight',
+   install_dir: zsh_comp_dir,
+ )
+-install_data('highlight.desktop', install_dir: desktop_apps_dir)
+-install_data('src/gui-qt/highlight.png', install_dir: desktop_icons_dir)
+-install_data('gui_files/ext/fileopenfilter.conf', install_dir: gui_files_dir / 'ext')
+-#install_subdir('gui_files/l10n', install_dir: join_paths(gui_files_dir, 'l10n'), files: '*.qm')
++if gui_enable
++  install_data('highlight.desktop', install_dir: desktop_apps_dir)
++  install_data('src/gui-qt/highlight.png', install_dir: desktop_icons_dir)
++  install_data('gui_files/ext/fileopenfilter.conf', install_dir: gui_files_dir / 'ext')
++  install_subdir('gui_files/l10n', install_dir: gui_files_dir)
++endif
+ 
+ # Platform-specific configurations
+ if host_machine.system() == 'windows'

                 reply	other threads:[~2026-11-13 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179458611046.1.12481280181325649704.rpms-highlight-646c08c9ff03@fedoraproject.org \
    --to=rosset.filipe@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox