floret: fix buildpaths QA error and simplify do_install

Preserve existing CMAKE_CXX_FLAGS in the cross-compilation patch so
Yocto's -ffile-prefix-map flags are not discarded, fixing the
do_package_qa buildpaths check.  Replace the custom do_install with
do_install:append that only fixes the SONAME symlink layout, letting
cmake_do_install handle the standard installation.  Drop the
now-unnecessary INSANE_SKIP:buildpaths overrides.

Signed-off-by: Varun Singhal <varusing@qti.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Varun Singhal authored and Khem Raj committed 2026-09-29 07:59:03 -07:00
1 parent 9ba7936d93
commit 42ba9aedf5
2 files changed
+26 -52

No files matched your search

@@ -1,17 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Varun Singhal <varusing@qti.qualcomm.com>
Date: Tue, 27 Jan 2026 21:37:55 +0530
Date: Mon, 21 Sep 2026 10:57:00 +0530
Subject: [PATCH] floret: Adjust CMake flags for cross-compilation
- Update cmake_minimum_required from 2.8.9 to 3.5
- Add missing #include <cstdint> to args.cc for GCC 15.x
- Preserve existing CMAKE_CXX_FLAGS instead of replacing them so that
Yocto's -ffile-prefix-map flags are not discarded; without this the
compiled binaries retain references to TMPDIR and fail the
do_package_qa buildpaths check.
Upstream-Status: Inappropriate [cross-compilation fix for Yocto/OE]
Upstream-Status: Pending [cross-compilation fix for Yocto/OE]
Signed-off-by: Varun Singhal <varusing@qti.qualcomm.com>
---
CMakeLists.txt | 2 +-
CMakeLists.txt | 4 ++--
src/args.cc | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
@@ -25,7 +29,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
project(floret)
# The version number.
@@ -15,7 +15,7 @@ set (floret_VERSION_MINOR 1)
include_directories(fasttext)
-set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11 -funroll-loops -O3")
set(HEADER_FILES
src/MurmurHash3.h
diff --git a/src/args.cc b/src/args.cc
--- a/src/args.cc
+++ b/src/args.cc
@@ -37,6 +49,5 @@ diff --git a/src/args.cc b/src/args.cc
namespace fasttext {
Args::Args() {
--
2.43.0
+10 -47
View File
@@ -31,65 +31,28 @@ EXTRA_OECMAKE = "\
-DBUILD_SHARED_LIBS=ON \
"
do_install() {
install -d ${D}${libdir}
install -d ${D}${includedir}/floret
install -d ${D}${bindir}
install -d ${D}${libdir}/pkgconfig
# Install the shared library under its real SONAME, then recreate the
# unversioned dev symlink. Installing through the libfloret.so symlink
# would leave ${libdir}/libfloret.so as an ELF file rather than a link,
# which makes debian.bbclass rename both ${PN} and ${PN}-dev to libfloret0
# (two packages with one name), causing do_create_package_spdx to fail.
do_install:append() {
# cmake_do_install follows the libfloret.so build symlink and installs
# the ELF directly as ${libdir}/libfloret.so. Re-install under the real
# SONAME and recreate the unversioned dev symlink so debian.bbclass sees
# a proper shared-library layout and does not rename both ${PN} and
# ${PN}-dev to the same package name, which would cause
# do_create_package_spdx to fail.
if [ -e ${B}/libfloret.so ]; then
soname=$(${OBJDUMP} -p ${B}/libfloret.so | awk '/SONAME/ { print $2 }')
rm -f ${D}${libdir}/libfloret.so
install -m 0755 ${B}/libfloret.so ${D}${libdir}/$soname
ln -sf $soname ${D}${libdir}/libfloret.so
fi
# Install static library
if [ -f ${B}/libfloret.a ]; then
install -m 0644 ${B}/libfloret.a ${D}${libdir}/libfloret.a
fi
# Install floret CLI binary
if [ -f ${B}/floret ]; then
install -m 0755 ${B}/floret ${D}${bindir}/floret
fi
# Install headers
if [ -d ${S}/src ]; then
cp -r ${S}/src/*.h ${D}${includedir}/floret/
fi
# Generate and install pkg-config file
cat > ${D}${libdir}/pkgconfig/floret.pc << EOF
prefix=/usr
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: floret
Description: fastText + Bloom embeddings for compact, full-coverage vectors
Version: ${PV}
Libs: -L\${libdir} -lfloret
Cflags: -I\${includedir}/floret
EOF
}
PACKAGES =+ "${PN}-cli"
FILES:${PN}-cli = "${bindir}/floret"
FILES:${PN}-dev += "${libdir}/libfloret.so ${includedir}/floret ${libdir}/pkgconfig/floret.pc"
FILES:${PN}-staticdev = "${libdir}/libfloret.a"
FILES:${PN}-dev += "${libdir}/libfloret.so"
FILES:${PN}-staticdev = "${libdir}/libfloret.a ${libdir}/libfloret_pic.a"
FILES:${PN} += "${libdir}/libfloret.so.*"
INSANE_SKIP:${PN} += "buildpaths"
INSANE_SKIP:${PN}-dev += "buildpaths"
INSANE_SKIP:${PN}-staticdev += "buildpaths"
INSANE_SKIP:${PN}-cli += "buildpaths"
SUMMARY:${PN} = "floret runtime library"
SUMMARY:${PN}-cli = "floret command-line tool for training Bloom embeddings"
SUMMARY:${PN}-dev = "floret development headers and shared library"