mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
cxx_rust_cssparser, new recipe (#13783)
This commit is contained in:
77
dev-rust/cxx-rust-cssparser/cxx_rust_cssparser-1.0.0.recipe
Normal file
77
dev-rust/cxx-rust-cssparser/cxx_rust_cssparser-1.0.0.recipe
Normal file
@@ -0,0 +1,77 @@
|
||||
SUMMARY="Library for parsing CSS that uses the Rust cssparser"
|
||||
DESCRIPTION="A C++ library for parsing CSS that uses the Rust cssparser crate internally"
|
||||
HOMEPAGE="https://invent.kde.org/libraries/cxx-rust-cssparser"
|
||||
COPYRIGHT="2010-2026 KDE Organisation"
|
||||
LICENSE="BSD (2-clause)
|
||||
GNU LGPL v2.1
|
||||
GNU LGPL v3"
|
||||
REVISION="1"
|
||||
srcGitRev="22911f564b7769948c2d7ff1098aa26f8fba0380"
|
||||
SOURCE_URI="https://invent.kde.org/libraries/cxx-rust-cssparser/-/archive/$srcGitRev.tar.gz"
|
||||
CHECKSUM_SHA256="1c7ae226e0b6cb225aabc13d5a66324a40c0f15e46d6da817ed78baed1c608c3"
|
||||
SOURCE_FILENAME="cxx-rust-cssparser-$portVersion.tar.gz"
|
||||
SOURCE_DIR="cxx-rust-cssparser-$srcGitRev"
|
||||
PATCHES="cxx_rust_cssparser-$portVersion.patchset"
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libVersion="$portVersion"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
cxx_rust_cssparser$secondaryArchSuffix = $portVersion
|
||||
cmd:cxx_rust_cssparser_parse$secondaryArchSuffix = $portVersion
|
||||
lib:libcxx_rust_cssparser$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
cxx_rust_cssparser${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libcxx_rust_cssparser$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
cxx_rust_cssparser$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
extra_cmake_modules$secondaryArchSuffix
|
||||
devel:libQt6Core$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cargo
|
||||
cmd:clang >= 20
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake -Bbuild -S. $cmakeDirArgs \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-Wno-dev
|
||||
|
||||
make -C build $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make -C build install
|
||||
|
||||
prepareInstalledDevelLib \
|
||||
libcxx-rust-cssparser
|
||||
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
ctest --test-dir build --output-on-failure
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
From 30ea08923967eb5b6359c40db00b1dac96625f1c Mon Sep 17 00:00:00 2001
|
||||
From: Luc Schrijvers <begasus@gmail.com>
|
||||
Date: Mon, 2 Mar 2026 11:51:30 +0100
|
||||
Subject: Link with libbsd and libnetwork instead of libdl on Haiku
|
||||
|
||||
|
||||
diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt
|
||||
index e5a3b76..d149640 100644
|
||||
--- a/rust/CMakeLists.txt
|
||||
+++ b/rust/CMakeLists.txt
|
||||
@@ -54,7 +54,7 @@ add_custom_command(
|
||||
set_target_properties(cxx-rust-cssparser-impl PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
target_include_directories(cxx-rust-cssparser-impl PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
-target_link_libraries(cxx-rust-cssparser-impl pthread dl ${RUST_LIB})
|
||||
+target_link_libraries(cxx-rust-cssparser-impl pthread network bsd ${RUST_LIB})
|
||||
|
||||
if (BUILD_TESTING)
|
||||
add_test(NAME rust COMMAND cargo test)
|
||||
--
|
||||
2.52.0
|
||||
|
||||
|
||||
From 64021169d4d03c933fdcd99d78032a05bf42ad4d Mon Sep 17 00:00:00 2001
|
||||
From: Luc Schrijvers <begasus@gmail.com>
|
||||
Date: Mon, 2 Mar 2026 15:38:51 +0100
|
||||
Subject: Fix build for -Wl,--fatal-warnings
|
||||
|
||||
|
||||
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
|
||||
index 2f9074d..c74d1a6 100644
|
||||
--- a/cpp/CMakeLists.txt
|
||||
+++ b/cpp/CMakeLists.txt
|
||||
@@ -29,6 +29,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
string(REPLACE "-Wl,--no-undefined " " " CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
+if (CMAKE_SYSTEM_NAME MATCHES "Haiku")
|
||||
+ string(REPLACE "-Wl,--fatal-warnings " " " CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
+endif()
|
||||
+
|
||||
set_target_properties(cxx-rust-cssparser PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
--
|
||||
2.52.0
|
||||
|
||||
Reference in New Issue
Block a user