Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/shlibs
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,10 @@ libkdecorations3private.so.2 kf6-kdecoration-6.5.1_1
libkwin.so.6 kwin-6.5.1_1
libkwin-x11.so.6 kwin-x11-6.5.1_1
libLayerShellQtInterface.so.6 layer-shell-qt-6.5.1_1
libcxx-rust-cssparser.so.1 cxx-rust-cssparser-1.0.0_1
libUnion.so.6 union-6.7.4_1
libUnionQuickStyle.so.6 union-6.7.4_1
libUnionQuickImpl.so.6 union-6.7.4_1
# KDE Gear
libKMahjongg6.so.6 libkmahjongg-24.08.2_1
libKF6BalooWidgets.so.6 baloo-widgets-24.02.0_1
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/cxx-rust-cssparser-devel
108 changes: 108 additions & 0 deletions srcpkgs/cxx-rust-cssparser/patches/cxxbridge.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
From 566b92ac4746d4c59eab14112efdc31737b922c7 Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Thu, 14 May 2026 22:35:52 +0200
Subject: [PATCH] Make an option for toggling using corrosion for bridge
building

Rather than only switching based on whether we're building a flatpak or
not.
---
CMakeLists.txt | 2 ++
cpp/CMakeLists.txt | 6 +++---
rust/CMakeLists.txt | 16 ++++++++--------
3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f91dbc6..536fb92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,8 @@ if (BUILD_DOCS)
include(ECMGenerateQDoc)
endif()

+option(USE_CORROSION_CXXBRIDGE "Use corrosion to build the CXX bridge" ON)
+
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTOMOC FALSE)
set(CMAKE_AUTORCC FALSE)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 16c46a0..a81165b 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -28,10 +28,10 @@ target_sources(cxx-rust-cssparser PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/cssparser_export.h
)

-if(DEFINED ENV{FLATPAK_ID})
- target_link_libraries(cxx-rust-cssparser PRIVATE cxx_rust_cssparser_impl)
-else()
+if (USE_CORROSION_CXXBRIDGE)
target_link_libraries(cxx-rust-cssparser PRIVATE cxx-rust-cssparser-impl-bridge)
+else()
+ target_link_libraries(cxx-rust-cssparser PRIVATE cxx_rust_cssparser_impl)
endif()

target_include_directories(cxx-rust-cssparser PUBLIC
diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt
index 594abb1..8f9f3d5 100644
--- a/rust/CMakeLists.txt
+++ b/rust/CMakeLists.txt
@@ -3,7 +3,14 @@

corrosion_import_crate(MANIFEST_PATH Cargo.toml)

-if(DEFINED ENV{FLATPAK_ID})
+if (USE_CORROSION_CXXBRIDGE)
+ corrosion_add_cxxbridge(cxx-rust-cssparser-impl-bridge
+ CRATE cxx_rust_cssparser_impl
+ FILES ffi.rs
+ )
+
+ set_target_properties(cxx-rust-cssparser-impl-bridge PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
+else()
# Flatpak: use cxx_build output directly instead of corrosion_add_cxxbridge.
string(SHA1 _cargo_path_hash ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)
string(SUBSTRING "${_cargo_path_hash}" 0 5 _cargo_path_hash)
@@ -17,13 +24,6 @@ if(DEFINED ENV{FLATPAK_ID})
)

target_include_directories(cxx_rust_cssparser_impl INTERFACE ${_bridge_include_dir})
-else()
- corrosion_add_cxxbridge(cxx-rust-cssparser-impl-bridge
- CRATE cxx_rust_cssparser_impl
- FILES ffi.rs
- )
-
- set_target_properties(cxx-rust-cssparser-impl-bridge PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()

if (BUILD_TESTING)
--
GitLab

From 17e12236d06b5c55d232856042ccc667a8a05955 Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Thu, 14 May 2026 22:36:22 +0200
Subject: [PATCH] Correct the include path used by the non-corrosion cxxbridge

The non-corrosion cxxbridge doesn't use underscores for the target name.
---
rust/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt
index 8f9f3d5..d174d72 100644
--- a/rust/CMakeLists.txt
+++ b/rust/CMakeLists.txt
@@ -20,7 +20,7 @@ else()
set(_bridge_include_dir ${CMAKE_CURRENT_BINARY_DIR}/corrosion_generated/cxxbridge)
file(MAKE_DIRECTORY ${_bridge_include_dir}/cxx-rust-cssparser-impl-bridge)
file(WRITE ${_bridge_include_dir}/cxx-rust-cssparser-impl-bridge/ffi.h
- "#pragma once\n#include \"${_cxxbridge_dir}/cxx_rust_cssparser_impl/src/ffi.rs.h\"\n"
+ "#pragma once\n#include \"${_cxxbridge_dir}/cxx-rust-cssparser-impl/src/ffi.rs.h\"\n"
)

target_include_directories(cxx_rust_cssparser_impl INTERFACE ${_bridge_include_dir})
--
GitLab

25 changes: 25 additions & 0 deletions srcpkgs/cxx-rust-cssparser/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Template file for 'cxx-rust-cssparser'
pkgname=cxx-rust-cssparser
version=1.0.0
revision=1
build_style=cmake
build_helper="rust"
configure_args="-DBUILD_TESTING=OFF -DUSE_CORROSION_CXXBRIDGE=OFF"
hostmakedepends="extra-cmake-modules qt6-base corrosion cargo"
makedepends="qt6-base-devel rust-std"
short_desc="Library for parsing CSS using the Rust cssparser crate"
maintainer="Nafis <mnabid.25@outlook.com>"
license="LGPL-2.1-only, LGPL-3.0-only"
homepage="https://invent.kde.org/libraries/cxx-rust-cssparser"
distfiles="${KDE_SITE}/cxx-rust-cssparser/cxx-rust-cssparser-${version}.tar.xz"
checksum=df233783cb017d352a7b96d9a0fefca5a1121b8fe384216c28f9544f682e6277

cxx-rust-cssparser-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove "usr/lib/*.so"
}
}
1 change: 1 addition & 0 deletions srcpkgs/union-devel
34 changes: 34 additions & 0 deletions srcpkgs/union/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Template file for 'union'
# group=kde-plasma
pkgname=union
version=6.7.4
revision=1
build_style=cmake
configure_args="-DBUILD_TESTING=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF
-DKDE_INSTALL_QMLDIR=lib/qt6/qml -DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins"
hostmakedepends="extra-cmake-modules pkg-config kf6-kconfig
qt6-base qt6-declarative-host-tools qt6-shadertools"
makedepends="breeze-qt6 cxx-rust-cssparser-devel kf6-kcolorscheme-devel
kf6-kconfig-devel kf6-kcoreaddons-devel kf6-kguiaddons-devel
kf6-kiconthemes-devel kf6-kirigami-devel qt6-base-devel
qt6-declarative-devel qt6-shadertools-devel"
short_desc="Qt style supporting both QtQuick and QtWidgets"
maintainer="Nafis <mnabid.25@outlook.com>"
license="LGPL-2.1-only, LGPL-3.0-only"
homepage="https://invent.kde.org/plasma/union"
distfiles="${KDE_SITE}/plasma/${version}/${pkgname}-${version}.tar.xz"
checksum=b1a83dc6b831fb3e46d18d4c6441822c94e386299ef37b816148215480d325ac

# stage builds
makedepends+=" kde-plasma-base"
shlib_requires="KDE_Plasma.${version}"

union-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove "usr/lib/*.so"
}
}