Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
106
package/utils/dtc/Makefile
Normal file
106
package/utils/dtc/Makefile
Normal file
@@ -0,0 +1,106 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
# Copyright (C) 2016-2019 Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dtc
|
||||
PKG_VERSION:=1.7.0
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4
|
||||
PKG_SOURCE_URL:=@KERNEL/software/utils/dtc
|
||||
|
||||
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=GPL
|
||||
PKG_CPE_ID:=cpe:/a:dtc_project:dtc
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
define Package/dtc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Device Tree Compiler
|
||||
URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
|
||||
endef
|
||||
|
||||
define Package/dtc/description
|
||||
Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
|
||||
as input a device-tree in a given format and outputs a device-tree in another
|
||||
format for booting kernels on embedded systems.
|
||||
endef
|
||||
|
||||
define Package/dtc/config
|
||||
config DTC_STATIC_BUILD
|
||||
depends on PACKAGE_dtc
|
||||
bool "Build dtc as static binary"
|
||||
default n
|
||||
help
|
||||
Builds dtc as a static binary.
|
||||
This is usefull in order to export live DTS from a device running
|
||||
various vendor modified OpenWrt versions.
|
||||
endef
|
||||
|
||||
define Package/dtc/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/dtc $(1)/usr/bin
|
||||
endef
|
||||
|
||||
|
||||
# See Documentation/manual.txt for details about each utility
|
||||
define Package/fdt-utils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Flat Device Tree Utilities
|
||||
URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
|
||||
DEPENDS:=+libfdt
|
||||
endef
|
||||
|
||||
define Package/fdt-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/convert-dtsv0 $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtdump $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtget $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtput $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtoverlay $(1)/usr/bin
|
||||
endef
|
||||
|
||||
|
||||
define Package/libfdt
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=a utility library for reading and manipulating dtb files
|
||||
URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
|
||||
endef
|
||||
|
||||
define Package/libfdt/description
|
||||
This is a library containing functions for manipulating Flat Device Trees.
|
||||
endef
|
||||
|
||||
define Package/libfdt/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfdt*.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dtools=true \
|
||||
-Dyaml=disabled \
|
||||
-Dvalgrind=disabled \
|
||||
-Dpython=disabled \
|
||||
-Dstatic-build=$(if $(CONFIG_DTC_STATIC_BUILD),true,false)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dtc))
|
||||
$(eval $(call BuildPackage,fdt-utils))
|
||||
$(eval $(call BuildPackage,libfdt))
|
||||
48
package/utils/dtc/patches/010-both-libraries.patch
Normal file
48
package/utils/dtc/patches/010-both-libraries.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From da39ee0e68b6d9293133a7c41c6cf73354dce337 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Wed, 21 Feb 2024 13:57:56 -0800
|
||||
Subject: [PATCH] libfdt: rework shared/static libraries
|
||||
|
||||
Instead of creating 2 libraries manualy, just call both_libraries and
|
||||
link to the appropriate one as requested.
|
||||
|
||||
Fixes compilation when passing -Ddefault_libraries=both as the
|
||||
static_library name is duplicated.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
---
|
||||
libfdt/meson.build | 17 +++++------------
|
||||
1 file changed, 5 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/libfdt/meson.build
|
||||
+++ b/libfdt/meson.build
|
||||
@@ -16,7 +16,7 @@ sources = files(
|
||||
'fdt_wip.c',
|
||||
)
|
||||
|
||||
-libfdt = library(
|
||||
+libfdt = both_libraries(
|
||||
'fdt', sources,
|
||||
version: '1.6.0',
|
||||
link_args: ['-Wl,--no-undefined', version_script],
|
||||
@@ -24,17 +24,12 @@ libfdt = library(
|
||||
install: true,
|
||||
)
|
||||
|
||||
-libfdt_a = static_library(
|
||||
- 'fdt', sources,
|
||||
- install: true,
|
||||
-)
|
||||
-
|
||||
libfdt_inc = include_directories('.')
|
||||
|
||||
if static_build
|
||||
- link_with = libfdt_a
|
||||
+ link_with = libfdt.get_static_lib()
|
||||
else
|
||||
- link_with = libfdt
|
||||
+ link_with = libfdt.get_shared_lib()
|
||||
endif
|
||||
|
||||
libfdt_dep = declare_dependency(
|
||||
Reference in New Issue
Block a user