diff mbox series

tools: add yaml library

Message ID 20200730082623.3923819-1-mail@aparcar.org
State Rejected
Headers show
Series tools: add yaml library | expand

Commit Message

Paul Spooren July 30, 2020, 8:26 a.m. UTC
libyaml is used to process YAML files, a popular human readable
configuration format. If available during compilation, the
device-tree-compiler (dtc) will enable YAML as export format.

The exported YAML files can be validated using dt-schema[0].

Once available this can be used within a CI to reduce human resources
spent on reviewing DTS files.

[0]: https://github.com/robherring/dt-schema

Signed-off-by: Paul Spooren <mail@aparcar.org>
---
v3:
* rename to yaml (was libyaml)
* follow Makefile style from packages.git

 tools/Makefile      |  2 +-
 tools/yaml/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 tools/yaml/Makefile

Comments

Moritz Warning July 30, 2020, 8:48 a.m. UTC | #1
On 7/30/20 10:26 AM, Paul Spooren wrote:
> libyaml is used to process YAML files, a popular human readable
> configuration format. If available during compilation, the
> device-tree-compiler (dtc) will enable YAML as export format.
>
> The exported YAML files can be validated using dt-schema[0].
>
> Once available this can be used within a CI to reduce human resources
> spent on reviewing DTS files.
>
> [0]: https://github.com/robherring/dt-schema
>
> Signed-off-by: Paul Spooren <mail@aparcar.org>
> ---
> v3:
> * rename to yaml (was libyaml)
> * follow Makefile style from packages.git
>
>  tools/Makefile      |  2 +-
>  tools/yaml/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 tools/yaml/Makefile
>
> diff --git a/tools/Makefile b/tools/Makefile
> index f038c90ba9..467640fac5 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -26,7 +26,7 @@ tools-y += m4 libtool autoconf autoconf-archive automake flex bison pkgconf mkli
>  tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
>  tools-y += firmware-utils patch-image quilt padjffs2
>  tools-y += mm-macros missing-macros cmake bc findutils gengetopt patchelf
> -tools-y += mtools dosfstools libressl fakeroot
> +tools-y += mtools dosfstools libressl yaml
>  tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>  tools-$(CONFIG_TARGET_x86) += qemu
>  tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
> diff --git a/tools/yaml/Makefile b/tools/yaml/Makefile
> new file mode 100644
> index 0000000000..7ae7aa700f
> --- /dev/null
> +++ b/tools/yaml/Makefile
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2020 Paul Spooren <mail@aparcar.org>
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=yaml
> +PKG_VERSION:=0.2.5
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=https://pyyaml.org/download/libyaml/
> +PKG_HASH:=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4
> +
> +PKG_LICENSE:=MIT
> +PKG_LICENSE_FILES:=COPYING
> +PKG_CPE_ID:=cpe:/a:pyyaml_project:pyyaml
> +
> +HOST_BUILD_PARALLEL:=1
> +
> +include $(INCLUDE_DIR)/host-build.mk
> +
> +define Host/Install
> +	$(INSTALL_DIR) $(1)/usr/include
> +	$(CP) $(HOST_BUILD_DIR)/include/yaml.h $(STAGING_DIR_HOST)/include/
> +	$(CP) $(HOST_BUILD_DIR)/src/.libs/libyaml*.{a,so*} $(STAGING_DIR_HOST)/lib/
> +	$(CP) $(HOST_BUILD_DIR)/yaml*.pc $(STAGING_DIR_HOST)/lib/pkgconfig/
> +endef
> +
> +define Host/Clean
> +	rm -f $(STAGING_DIR_HOST)/include/yaml.h
> +	rm -f $(STAGING_DIR_HOST)/lib/libyaml*.{a,so*}
> +	rm -f $(STAGING_DIR_HOST)/lib/pkgconfig/yaml*.pc
> +	$(call Host/Clean/Default)
> +endef
> +
> +$(eval $(call HostBuild))
>

You remove fakeroot, is there a reason for that?
Paul Spooren July 30, 2020, 9:02 a.m. UTC | #2
On 29.07.20 22:48, Moritz Warning wrote:
> On 7/30/20 10:26 AM, Paul Spooren wrote:
>> libyaml is used to process YAML files, a popular human readable
>> configuration format. If available during compilation, the
>> device-tree-compiler (dtc) will enable YAML as export format.
>>
>> The exported YAML files can be validated using dt-schema[0].
>>
>> Once available this can be used within a CI to reduce human resources
>> spent on reviewing DTS files.
>>
>> [0]: https://github.com/robherring/dt-schema
>>
>> Signed-off-by: Paul Spooren <mail@aparcar.org>
>> ---
>> v3:
>> * rename to yaml (was libyaml)
>> * follow Makefile style from packages.git
>>
>>   tools/Makefile      |  2 +-
>>   tools/yaml/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>   create mode 100644 tools/yaml/Makefile
>>
>> diff --git a/tools/Makefile b/tools/Makefile
>> index f038c90ba9..467640fac5 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -26,7 +26,7 @@ tools-y += m4 libtool autoconf autoconf-archive automake flex bison pkgconf mkli
>>   tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
>>   tools-y += firmware-utils patch-image quilt padjffs2
>>   tools-y += mm-macros missing-macros cmake bc findutils gengetopt patchelf
>> -tools-y += mtools dosfstools libressl fakeroot
>> +tools-y += mtools dosfstools libressl yaml
>>   tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>>   tools-$(CONFIG_TARGET_x86) += qemu
>>   tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
>> diff --git a/tools/yaml/Makefile b/tools/yaml/Makefile
>> new file mode 100644
>> index 0000000000..7ae7aa700f
>> --- /dev/null
>> +++ b/tools/yaml/Makefile
>> @@ -0,0 +1,41 @@
>> +# SPDX-License-Identifier: GPL-2.0-or-later
>> +#
>> +# Copyright (C) 2020 Paul Spooren <mail@aparcar.org>
>> +#
>> +# This is free software, licensed under the GNU General Public License v2.
>> +# See /LICENSE for more information.
>> +#
>> +
>> +include $(TOPDIR)/rules.mk
>> +
>> +PKG_NAME:=yaml
>> +PKG_VERSION:=0.2.5
>> +PKG_RELEASE:=1
>> +
>> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
>> +PKG_SOURCE_URL:=https://pyyaml.org/download/libyaml/
>> +PKG_HASH:=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4
>> +
>> +PKG_LICENSE:=MIT
>> +PKG_LICENSE_FILES:=COPYING
>> +PKG_CPE_ID:=cpe:/a:pyyaml_project:pyyaml
>> +
>> +HOST_BUILD_PARALLEL:=1
>> +
>> +include $(INCLUDE_DIR)/host-build.mk
>> +
>> +define Host/Install
>> +	$(INSTALL_DIR) $(1)/usr/include
>> +	$(CP) $(HOST_BUILD_DIR)/include/yaml.h $(STAGING_DIR_HOST)/include/
>> +	$(CP) $(HOST_BUILD_DIR)/src/.libs/libyaml*.{a,so*} $(STAGING_DIR_HOST)/lib/
>> +	$(CP) $(HOST_BUILD_DIR)/yaml*.pc $(STAGING_DIR_HOST)/lib/pkgconfig/
>> +endef
>> +
>> +define Host/Clean
>> +	rm -f $(STAGING_DIR_HOST)/include/yaml.h
>> +	rm -f $(STAGING_DIR_HOST)/lib/libyaml*.{a,so*}
>> +	rm -f $(STAGING_DIR_HOST)/lib/pkgconfig/yaml*.pc
>> +	$(call Host/Clean/Default)
>> +endef
>> +
>> +$(eval $(call HostBuild))
>>
> You remove fakeroot, is there a reason for that?
I started to look into SELinux and renaming libyaml to yaml ontop of the 
SELinux patches messed ob that line. Whoever merges this, please just 
ignore the fakeroot, it doesn't exist (yet) in OpenWrt.
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/tools/Makefile b/tools/Makefile
index f038c90ba9..467640fac5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -26,7 +26,7 @@  tools-y += m4 libtool autoconf autoconf-archive automake flex bison pkgconf mkli
 tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
 tools-y += firmware-utils patch-image quilt padjffs2
 tools-y += mm-macros missing-macros cmake bc findutils gengetopt patchelf
-tools-y += mtools dosfstools libressl fakeroot
+tools-y += mtools dosfstools libressl yaml
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
diff --git a/tools/yaml/Makefile b/tools/yaml/Makefile
new file mode 100644
index 0000000000..7ae7aa700f
--- /dev/null
+++ b/tools/yaml/Makefile
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2020 Paul Spooren <mail@aparcar.org>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=yaml
+PKG_VERSION:=0.2.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pyyaml.org/download/libyaml/
+PKG_HASH:=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:pyyaml_project:pyyaml
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Install
+	$(INSTALL_DIR) $(1)/usr/include
+	$(CP) $(HOST_BUILD_DIR)/include/yaml.h $(STAGING_DIR_HOST)/include/
+	$(CP) $(HOST_BUILD_DIR)/src/.libs/libyaml*.{a,so*} $(STAGING_DIR_HOST)/lib/
+	$(CP) $(HOST_BUILD_DIR)/yaml*.pc $(STAGING_DIR_HOST)/lib/pkgconfig/
+endef
+
+define Host/Clean
+	rm -f $(STAGING_DIR_HOST)/include/yaml.h
+	rm -f $(STAGING_DIR_HOST)/lib/libyaml*.{a,so*}
+	rm -f $(STAGING_DIR_HOST)/lib/pkgconfig/yaml*.pc
+	$(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))