Skip to content

Commit

Permalink
meta-balena-warrior: use cmake 3.20.1
Browse files Browse the repository at this point in the history
Use cmake 3.20.1 to build rust v1.73.0 successfully.

Change-type: patch
  • Loading branch information
jaomaloy authored and alexgg committed Jul 26, 2024
1 parent 41336b8 commit b69546f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 170 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require cmake.inc
inherit native

DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native"
DEPENDS += "bzip2-replacement-native xz-native zlib-native curl-native ncurses-native"

SRC_URI += "file://OEToolchainConfig.cmake \
file://environment.d-cmake.sh \
Expand All @@ -13,22 +13,22 @@ SRC_URI += "file://OEToolchainConfig.cmake \
B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

# Disable ccmake since we don't depend on ncurses
CMAKE_EXTRACONF = "\
-DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
-DBUILD_CursesDialog=0 \
-DBUILD_CursesDialog=1 \
-DCMAKE_USE_SYSTEM_LIBRARIES=1 \
-DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \
-DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
-DHAVE_SYS_ACL_H=0 \
"

do_configure () {
${S}/configure --verbose --prefix=${prefix} \
${@ '${PARALLEL_MAKE}'.replace('-j ', '--parallel=')} \
${S}/configure --verbose --prefix=${prefix} \
${@oe.utils.parallel_make_argument(d, '--parallel=%d')} \
${@bb.utils.contains('CCACHE', 'ccache ', '--enable-ccache', '', d)} \
-- ${CMAKE_EXTRACONF}
}
Expand Down
18 changes: 12 additions & 6 deletions meta-balena-warrior/recipes-devtools/cmake/cmake.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@
# Released under the MIT license (see packages/COPYING)

SUMMARY = "Cross-platform, open-source make system"
DESCRIPTION = "CMake is used to control the software compilation process \
using simple platform and compiler independent configuration files. CMake \
generates native makefiles and workspaces that can be used in the compiler \
environment of your choice."
HOMEPAGE = "http://www.cmake.org/"
BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php"
SECTION = "console/utils"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://Copyright.txt;md5=f61f5f859bc5ddba2b050eb10335e013 \
file://Source/cmake.h;md5=4494dee184212fc89c469c3acd555a14;beginline=1;endline=3 \
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://Copyright.txt;md5=31023e1d3f51ca90a58f55bcee8e2339 \
file://Source/cmake.h;beginline=1;endline=2;md5=a5f70e1fef8614734eae0d62b4f5891b \
"

CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"

SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \
file://0002-cmake-Prevent-the-detection-of-Qt5.patch \
file://0003-cmake-support-OpenEmbedded-Qt4-tool-binary-names.patch \
file://0004-Fail-silently-if-system-Qt-installation-is-broken.patch \
"

SRC_URI[md5sum] = "b5a544ffc73f6922a6cf371fcb6bae22"
SRC_URI[sha256sum] = "fdd928fee35f472920071d1c7f1a6a2b72c9b25e04f7a37b409349aef3f20e9b"
SRC_URI[sha256sum] = "3f1808b9b00281df06c91dd7a021d7f52f724101000da7985a401678dfe035b0"

UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"

# This is specific to the npm package that installs cmake, so isn't
# relevant to OpenEmbedded
CVE_CHECK_WHITELIST += "CVE-2016-10642"
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
From 71085723f8028b3e1c4029fc1abe1243ac49ffc6 Mon Sep 17 00:00:00 2001
From ac9b8d316ff3e013bc9d3c063db99aa1f064ce6a Mon Sep 17 00:00:00 2001
From: Cody P Schafer <[email protected]>
Date: Thu, 27 Apr 2017 11:35:05 -0400
Subject: [PATCH 1/5] CMakeDetermineSystem: use oe environment vars to load
default toolchain file in sdk
Organization: O.S. Systems Software LTDA.
Subject: [PATCH] CMakeDetermineSystem: use oe environment vars to load default
toolchain file in sdk

Passing the toolchain by:

Expand All @@ -20,15 +19,16 @@ because '-D' options are cache entries themselves.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Cody P Schafer <[email protected]>
Signed-off-by: Otavio Salvador <[email protected]>

---
Modules/CMakeDetermineSystem.cmake | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 600d5580e..32d7f1945 100644
index bae270d..5bb6bc0 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -82,6 +82,13 @@ else()
@@ -111,6 +111,13 @@ else()
endif()
endif()

Expand All @@ -42,6 +42,3 @@ index 600d5580e..32d7f1945 100644
# if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
# variables around so they can be used in CMakeLists.txt.
--
2.18.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From c783ceeef485c23e13c3d9f0418719cb0e0b86ee Mon Sep 17 00:00:00 2001
From 2d02ac91d5a5d72eaddba4894eaa6db3ed8fee62 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <[email protected]>
Date: Thu, 12 May 2011 15:36:03 +0000
Subject: [PATCH 3/5] cmake: support OpenEmbedded Qt4 tool binary names
Organization: O.S. Systems Software LTDA.
Subject: [PATCH] cmake: support OpenEmbedded Qt4 tool binary names

The FindQt4 module looks for Qt4 binaries to be able to gather the
paths used for compilation and also to be using during other processes
Expand All @@ -20,15 +19,16 @@ Instead of find_program, _find_qt4_program is now used.

Signed-off-by: Moritz Blume <[email protected]>
Signed-off-by: Otavio Salvador <[email protected]>

---
Modules/FindQt4.cmake | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 847a798af..7ad981879 100644
index 3993968..b2a8585 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -517,7 +517,7 @@ endfunction()
@@ -518,7 +518,7 @@ endfunction()

set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)

Expand All @@ -37,7 +37,7 @@ index 847a798af..7ad981879 100644
_qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)

if (QT_QMAKE_EXECUTABLE AND
@@ -1135,12 +1135,12 @@ if (QT_QMAKE_EXECUTABLE AND
@@ -1136,12 +1136,12 @@ if (QT_QMAKE_EXECUTABLE AND
_find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
_find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
_find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
Expand All @@ -54,6 +54,3 @@ index 847a798af..7ad981879 100644
_find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
_find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)

--
2.18.0

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From 9516fc4260f701c6d9db0c341bb36480362e1747 Mon Sep 17 00:00:00 2001
From 60864efbe52cc12018efaafbc4e4c3c8b4af2b65 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <[email protected]>
Date: Thu, 5 Jul 2018 10:26:48 -0300
Subject: [PATCH 4/5] Fail silently if system Qt installation is broken
Organization: O.S. Systems Software LTDA.
Subject: [PATCH] Fail silently if system Qt installation is broken

Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the
following error if the system Qt installation is broken:
Expand All @@ -23,15 +22,16 @@ within the if(QT_QTCORE_FOUND) statement.

Signed-off-by: Moritz Blume <[email protected]>
Signed-off-by: Otavio Salvador <[email protected]>

---
Modules/FindQt4.cmake | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 7ad981879..8b6f43cda 100644
index b2a8585..77c89aa 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -987,25 +987,26 @@ if (QT_QMAKE_EXECUTABLE AND
@@ -988,25 +988,26 @@ if (QT_QMAKE_EXECUTABLE AND
endif()
endmacro()

Expand Down Expand Up @@ -77,6 +77,3 @@ index 7ad981879..8b6f43cda 100644

foreach(QT_MODULE ${QT_MODULES})
_QT4_ADJUST_LIB_VARS(${QT_MODULE})
--
2.18.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From 0df8d46d14c371f21c327966a553c4c187a8acfe Mon Sep 17 00:00:00 2001
From fd9a04c1434e12f21c043385e306e0b52d38d749 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <[email protected]>
Date: Thu, 5 Jul 2018 10:28:04 -0300
Subject: [PATCH 5/5] Disable use of ext2fs/ext2_fs.h by cmake's internal
Subject: [PATCH] Disable use of ext2fs/ext2_fs.h by cmake's internal

libarchive copy
Organization: O.S. Systems Software LTDA.

Expand All @@ -12,15 +13,16 @@ Upstream-Status: Inappropriate [config]

Signed-off-by: Paul Eggleton <[email protected]>
Signed-off-by: Otavio Salvador <[email protected]>

---
Utilities/cmlibarchive/CMakeLists.txt | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 206f3c6a5..642fb0dd9 100644
index bfcaf30..2960683 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -430,12 +430,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
@@ -682,12 +682,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
Expand All @@ -34,7 +36,4 @@ index 206f3c6a5..642fb0dd9 100644
+SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0)
LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
--
2.18.0

LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
endif()

# Include the toolchain configuration subscripts
file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
file( GLOB toolchain_config_files "${CMAKE_CURRENT_LIST_FILE}.d/*.cmake" )
foreach(config ${toolchain_config_files})
include(${config})
endforeach()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require cmake.inc

inherit cmake
inherit cmake bash-completion

DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"

Expand Down Expand Up @@ -46,7 +46,7 @@ do_install_append_class-nativesdk() {

FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"

FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal"
FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal ${datadir}/emacs ${datadir}/vim"
FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
FILES_${PN}-dev = ""

Expand Down

0 comments on commit b69546f

Please sign in to comment.