srecord: fix install prefix
PATCH 1/1 srecord: fix install prefix
srecord's CMakeLists.txt was unconditionally setting CMAKE_INSTALL_PREFIX for non-WIN32 builds, which caused it to ignore OE-supplied prefix that contained the sysroot portion of the path. Fixed by removing the offending line.
--- ...rnally-supplied-CMAKE_INSTALL_PREFIX.patch | 27 +++++++++++++++++++ .../recipes-support/srecord/srecord_1.65.0.bb | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch
meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch new file +27 -0
@@ -0,0 +1,27 @@ +From 023b3de19a9c04858f34143d5d9b32bd0287f6d7 Mon Sep 17 00:00:00 2001 +From: "Ilya A. Kriveshko" <[email protected]> +Date: Fri, 29 Dec 2023 20:48:37 +0000 +Subject: [PATCH] Allow externally supplied CMAKE_INSTALL_PREFIX + +CMAKE_INSTALL_PREFIX variable is supposed to be left as a default, +or overwritten by the packager. In particular, OE-provided prefix +includes the sysroots path and should be used. + +Upstream-Status: Inappropriate [OE-specific] + +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74b8108..f149917 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,7 +32,6 @@ include(GNUInstallDirs) + # FHS compliant paths for Linux installation + if(NOT WIN32 AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # set(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}") +- set(CMAKE_INSTALL_PREFIX "/usr") + endif() + + # Pull in the rest of the pieces
meta-oe/recipes-support/srecord/srecord_1.65.0.bb +2 -1
@@ -4,11 +4,12 @@ LICENSE = "GPL-3.0-or-later & LGPL-3.0-or-later" LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504" SRC_URI = " \ https://sourceforge.net/projects/${BPN}/files/srecord/${@oe.utils.trim_version('${PV}', 2)}/${BP}-Source.tar.gz \ file://0001-Disable-doxygen.patch \ - file://0001-cmake-Do-not-try-to-compute-library-dependencies-dur.patch" + file://0001-cmake-Do-not-try-to-compute-library-dependencies-dur.patch \ + file://0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch" SRC_URI[sha256sum] = "81c3d07cf15ce50441f43a82cefd0ac32767c535b5291bcc41bd2311d1337644" S = "${WORKDIR}/${BP}-Source" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/srecord/files/releases"
Signature · 1 line
2.39.0
Quoted 19 lines · Ilya A. Kriveshko
srecord's CMakeLists.txt was unconditionally setting
CMAKE_INSTALL_PREFIXfor non-WIN32 builds, which caused it to ignore OE-supplied prefix that contained the sysroot portion of the path. Fixed by removing the offending line.Signed-off-by Ilya A. Kriveshko <[email protected]>--- ...rnally-supplied-CMAKE_INSTALL_PREFIX.patch | 27 +++++++++++++++++++ .../recipes-support/srecord/srecord_1.65.0.bb | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patchmeta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch new file +0
-0
meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch line 9
Quoted 9 lines
meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch new file +9
-0@@ -0,0 +1,27 @@ +From 023b3de19a9c04858f34143d5d9b32bd0287f6d7 Mon Sep 17 00:00:00 2001 +From: "Ilya A. Kriveshko" <[email protected]> +Date: Fri, 29 Dec 2023 20:48:37 +0000 +Subject: [PATCH] Allow externally supplied CMAKE_INSTALL_PREFIX + +CMAKE_INSTALL_PREFIX variable is supposed to be left as a default, +or overwritten by the packager. In particular, OE-provided prefix +includes the sysroots path and should be used. +
I think if we can change the logic to check for CMAKE_INSTALL_PREFIX before setting it to /usr here
could work here as well as become worth upstreaming too.
Quoted 48 lines
meta-oe/recipes-support/srecord/files/0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch new file +18
-0+Upstream-Status: Inappropriate [OE-specific] + +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74b8108..f149917 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,7 +32,6 @@ include(GNUInstallDirs) + # FHS compliant paths for Linux installation + if(NOT WIN32 AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + # set(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}") +- set(CMAKE_INSTALL_PREFIX "/usr") + endif() + + # Pull in the rest of the piecesmeta-oe/recipes-support/srecord/srecord_1.65.0.bb +2
-2@@ -4,11 +4,12 @@ LICENSE = "GPL-3.0-or-later & LGPL-3.0-or-later" LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504" SRC_URI = " \ https://sourceforge.net/projects/${BPN}/files/srecord/${@oe.utils.trim_version('${PV}', 2)}/${BP}-Source.tar.gz \ file://0001-Disable-doxygen.patch \ - file://0001-cmake-Do-not-try-to-compute-library-dependencies-dur.patch" + file://0001-cmake-Do-not-try-to-compute-library-dependencies-dur.patch \ + file://0001-allow-externally-supplied-CMAKE_INSTALL_PREFIX.patch" SRC_URI[sha256sum] = "81c3d07cf15ce50441f43a82cefd0ac32767c535b5291bcc41bd2311d1337644" S = "${WORKDIR}/${BP}-Source" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/srecord/files/releases" --2.39.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#108015): https://lists.openembedded.org/g/openembedded-devel/message/108015
Mute This Topic: https://lists.openembedded.org/mt/103487925/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 4 lines · Khem Raj
I think if we can change the logic to check for
CMAKE_INSTALL_PREFIXbefore setting it to /usr here
could work here as well as become worth upstreaming too.
OK, thanks for the suggestion. I previously struggled to write that check, since cmake defines CMAKE_INSTALL_PREFIX by default.
However, with your prodding, I found:
https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.html
I will re-create the patch with this, and make an upstream submission.