Skip to contentSkip to conversation

package/chawan: new package

PATCH Applied Waldemar Brodkorb 2 participants 7 messages Sep 19 – Oct 23

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 package/chawan: new package

Chawan is a text-mode web browser and pager for Unix-like systems, with a focus on implementing modern web standards while remaining self-contained, easy to understand and extensible.

It includes functionality such as CSS, inline images inside the terminal, and JavaScript through a small, independent browser engine.

---
v1->v2:
- add comments from dowan gullient
- add comments from Thomas Petazzoni

---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/chawan/Config.in   | 14 ++++++++++++++
 package/chawan/chawan.hash |  3 +++
 package/chawan/chawan.mk   | 39 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 package/chawan/Config.in
 create mode 100644 package/chawan/chawan.hash
 create mode 100644 package/chawan/chawan.mk
DEVELOPERS +1 -0
index 520e2a836d..bb449ded00 100644
@@ -3468,6 +3468,7 @@ F:	board/stmicroelectronics/stm32f746-disco/
 F:	configs/qemu_riscv32_nommu_virt_defconfig
 F:	configs/stm32f746_disco_sd_defconfig
 F:	package/asterisk/
+F:	package/chawan/
 F:	package/evilwm/
 F:	package/fbv/
 F:	package/libpam-pkcs11/
package/Config.in +1 -0
index 243b390d1c..76ae6f5810 100644
@@ -2441,6 +2441,7 @@ endif
 	source "package/casync/Config.in"
 	source "package/casync-nano/Config.in"
 	source "package/cfm/Config.in"
+	source "package/chawan/Config.in"
 	source "package/chrony/Config.in"
 	source "package/civetweb/Config.in"
 	source "package/cloudflared/Config.in"
package/chawan/Config.in new file +14 -0
new file mode 100644
index 0000000000..3dec3723af
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_CHAWAN
+	bool "chawan"
+	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_11
+	select BR2_PACKAGE_BROTLI
+	select BR2_PACKAGE_LIBSSH2
+	select BR2_PACKAGE_OPENSSL
+	help
+	  A TUI Web-Browser.
+
+	  https://chawan.net/
+
+comment "chawan needs a toolchain w/ gcc >= 11"
+	depends on BR2_USE_MMU && !BR2_TOOLCHAIN_GCC_AT_LEAST_11
package/chawan/chawan.hash new file +3 -0
new file mode 100644
index 0000000000..95f996d10a
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  e0a06e1504e10a51c6009751d79b798c98d8274e559fe195d4b4b7ddadf91bb8  v0.4.4.tar.gz
+sha256  7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  UNLICENSE
package/chawan/chawan.mk new file +39 -0
new file mode 100644
index 0000000000..585a1fa0db
@@ -0,0 +1,39 @@
+################################################################################
+#
+# chawan
+#
+################################################################################
+
+CHAWAN_VERSION = 0.4.4
+CHAWAN_SITE = https://git.sr.ht/~bptato/chawan/archive
+CHAWAN_SOURCE = v$(CHAWAN_VERSION).tar.gz
+CHAWAN_LICENSE = Unlicense
+CHAWAN_LICENSE_FILES = UNLICENSE
+
+CHAWAN_DEPENDENCIES = brotli host-nim libssh2 openssl
+
+ifeq ($(BR2_aarch64),y)
+CHAWAN_TARGET_ARCH = arm64
+else ifeq ($(BR2_x86_64),y)
+CHAWAN_TARGET_ARCH = amd64
+else
+CHAWAN_TARGET_ARCH = $(BR2_ARCH)
+endif
+
+TARGET_CONFIGURE_OPTS += \
+	FLAGS="--os=linux \
+	--cpu:$(CHAWAN_TARGET_ARCH) \
+	--gcc.exe:$(TARGET_CROSS)gcc \
+	--gcc.linkerexe:$(TARGET_CROSS)gcc" \
+	PREFIX="/usr"
+
+define CHAWAN_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all
+endef
+
+define CHAWAN_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+	DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Quoted 8 lines · Waldemar Brodkorb

Chawan is a text-mode web browser and pager for Unix-like systems, with a focus on implementing modern web standards while remaining self-contained, easy to understand and extensible.

It includes functionality such as CSS, inline images inside the terminal, and JavaScript through a small, independent browser engine.

I've applied to master, with some changes.

Quoted 7 lines
package/chawan/chawan.mk new file +7 -0
+CHAWAN_VERSION = 0.4.4
+CHAWAN_SITE = https://git.sr.ht/~bptato/chawan/archive
+CHAWAN_SOURCE = v$(CHAWAN_VERSION).tar.gz
+CHAWAN_LICENSE = Unlicense
+CHAWAN_LICENSE_FILES = UNLICENSE
+
+CHAWAN_DEPENDENCIES = brotli host-nim libssh2 openssl

package/chawan/chawan.mk line 23

Quoted 10 lines
package/chawan/chawan.mk new file +10 -0
+
+ifeq ($(BR2_aarch64),y)
+CHAWAN_TARGET_ARCH = arm64
+else ifeq ($(BR2_x86_64),y)
+CHAWAN_TARGET_ARCH = amd64
+else
+CHAWAN_TARGET_ARCH = $(BR2_ARCH)
+endif
+
+TARGET_CONFIGURE_OPTS += \

This was very very wrong, as it means you're changing this variable for everyone in Buildroot. Variables are global.

"make check-package" actually warned about this:

WARNING: package/chawan/chawan.mk:23: possible typo, variable not properly prefixed: TARGET_CONFIGURE_OPTS -> *CHAWAN_XXXX* (https://nightly.buildroot.org/#_tips_and_tricks)

package/chawan/chawan.mk line 28

Quoted 5 lines
package/chawan/chawan.mk new file +5 -0
+	FLAGS="--os=linux \
+	--cpu:$(CHAWAN_TARGET_ARCH) \
+	--gcc.exe:$(TARGET_CROSS)gcc \
+	--gcc.linkerexe:$(TARGET_CROSS)gcc" \
+	PREFIX="/usr"

So I've changed this to:

+CHAWAN_MAKE_OPTS = \

+       $(TARGET_CONFIGURE_OPTS) \
+       FLAGS="--os=linux \
+       --cpu:$(CHAWAN_TARGET_ARCH) \
+       --gcc.exe:$(TARGET_CROSS)gcc \
+       --gcc.linkerexe:$(TARGET_CROSS)gcc" \
+       PREFIX="/usr"

and then used CHAWAN_MAKE_OPTS.

package/chawan/chawan.mk line 36

Quoted 7 lines
package/chawan/chawan.mk new file +7 -0
+define CHAWAN_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all
+endef
+
+define CHAWAN_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+	DESTDIR=$(TARGET_DIR) install

Continuation line should have had one more indentation level (minor nit).

Applied with those changes. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Thomas,
Thomas Petazzoni wrote,

Quoted 69 lines

Hello,

Quoted 8 lines · Waldemar Brodkorb

Chawan is a text-mode web browser and pager for Unix-like systems, with a focus on implementing modern web standards while remaining self-contained, easy to understand and extensible.

It includes functionality such as CSS, inline images inside the terminal, and JavaScript through a small, independent browser engine.

I've applied to master, with some changes.

Quoted 7 lines
package/chawan/chawan.mk new file +7 -0
+CHAWAN_VERSION = 0.4.4
+CHAWAN_SITE = https://git.sr.ht/~bptato/chawan/archive
+CHAWAN_SOURCE = v$(CHAWAN_VERSION).tar.gz
+CHAWAN_LICENSE = Unlicense
+CHAWAN_LICENSE_FILES = UNLICENSE
+
+CHAWAN_DEPENDENCIES = brotli host-nim libssh2 openssl

package/chawan/chawan.mk line 23

Quoted 10 lines
package/chawan/chawan.mk new file +10 -0
+
+ifeq ($(BR2_aarch64),y)
+CHAWAN_TARGET_ARCH = arm64
+else ifeq ($(BR2_x86_64),y)
+CHAWAN_TARGET_ARCH = amd64
+else
+CHAWAN_TARGET_ARCH = $(BR2_ARCH)
+endif
+
+TARGET_CONFIGURE_OPTS += \

This was very very wrong, as it means you're changing this variable for everyone in Buildroot. Variables are global.

"make check-package" actually warned about this:

WARNING: package/chawan/chawan.mk:23: possible typo, variable not properly prefixed: TARGET_CONFIGURE_OPTS -> *CHAWAN_XXXX* (https://nightly.buildroot.org/#_tips_and_tricks)

package/chawan/chawan.mk line 28

Quoted 5 lines
package/chawan/chawan.mk new file +5 -0
+	FLAGS="--os=linux \
+	--cpu:$(CHAWAN_TARGET_ARCH) \
+	--gcc.exe:$(TARGET_CROSS)gcc \
+	--gcc.linkerexe:$(TARGET_CROSS)gcc" \
+	PREFIX="/usr"

So I've changed this to:

package/chawan/chawan.mk new file +7 -0
+CHAWAN_MAKE_OPTS = \
+       $(TARGET_CONFIGURE_OPTS) \
+       FLAGS="--os=linux \
+       --cpu:$(CHAWAN_TARGET_ARCH) \
+       --gcc.exe:$(TARGET_CROSS)gcc \
+       --gcc.linkerexe:$(TARGET_CROSS)gcc" \
+       PREFIX="/usr"

and then used CHAWAN_MAKE_OPTS.

package/chawan/chawan.mk line 36

Quoted 7 lines
package/chawan/chawan.mk new file +7 -0
+define CHAWAN_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all
+endef
+
+define CHAWAN_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+	DESTDIR=$(TARGET_DIR) install

Continuation line should have had one more indentation level (minor nit).

Quoted 1 line

Applied with those changes. Thanks!

Thanks for fixing my bugs and applying!

best regards
Waldemar
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 1 line · Waldemar Brodkorb

Thanks for fixing my bugs and applying!

Could you have a look at the build failures caused by chawan and propose some fixes?

See:

    arm      |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/35f6ff053723bf0d16ac5b425cf943bac01a4418 |
    i686     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/16888bbe55bc290733c79a8cdd0517f5f4df2a30 |
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/553aca94416bcafabfe23d34d6907bdb9ebb84c3 |
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/41cab338af1c162d9d1444645020a20b2b0c05ae |
    i686     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/cf6a6cc4babb214f27f4f0e69ce915bf39d05042 |
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/cf6401afa998d5e131614bda67730a79526da784 |
    or1k     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/2aa8986b4161c9ce25d4bddf8c29d1b204893e0b |

All failures:

https://autobuild.buildroot.net/?reason=chawan%

Thanks,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Thomas,
Thomas Petazzoni wrote,

Quoted 10 lines · Waldemar Brodkorb
Quoted 2 lines

Thanks for fixing my bugs and applying!

Could you have a look at the build failures caused by chawan and propose some fixes?

See:

    arm      |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/35f6ff053723bf0d16ac5b425cf943bac01a4418 |

chawan needs fenv.h, which is only available for a hard-float uClibc-ng toolchain. Here arm soft-float is in use. How should I fix this? Any suggestion?

Quoted 2 lines
    i686     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/16888bbe55bc290733c79a8cdd0517f5f4df2a30 |
    i686     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/cf6a6cc4babb214f27f4f0e69ce915bf39d05042 |

Patch sent.

Quoted 3 lines
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/553aca94416bcafabfe23d34d6907bdb9ebb84c3 |
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/41cab338af1c162d9d1444645020a20b2b0c05ae |
powerpc64le  |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/cf6401afa998d5e131614bda67730a79526da784 |

Patch sent.

Quoted 1 line
    or1k     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/2aa8986b4161c9ce25d4bddf8c29d1b204893e0b |

OpenRISC is not supported. How would I express this in Config.in? Any suggestion?

Quoted 3 lines

All failures:

https://autobuild.buildroot.net/?reason=chawan%

I take a look.

Best regards
Waldemar
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Am 23.10.26 um 12:15 schrieb Waldemar Brodkorb:

Quoted 2 lines

Hi Thomas,
Thomas Petazzoni wrote,

[snip]

Quoted 4 lines
Quoted 1 line
     or1k     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/2aa8986b4161c9ce25d4bddf8c29d1b204893e0b |

OpenRISC is not supported. How would I express this in Config.in? Any suggestion?

If it's about the specific architecture:

depends on !BR2_or1k

Best regards,
Fiona

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
In reply to Waldemar Brodkorb
Quoted 5 lines · Waldemar Brodkorb
Quoted 1 line
    arm      |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/35f6ff053723bf0d16ac5b425cf943bac01a4418 |

chawan needs fenv.h, which is only available for a hard-float uClibc-ng toolchain. Here arm soft-float is in use. How should I fix this? Any suggestion?

So far we have ad-hoc dependencies in each package, so as a initial fix I would suggest to do the same: exclude architecture/toolchain combo that don't provide fenv.h.

On this initial fix is done, a better handling of fenv dependencies would be nice. If you "git grep -i fenv" in Buildroot, you will see that we have lots of packages that have custom dependencies to workaround fenv availability issues.

Having in toolchain/Config.in some nice BR2_TOOLCHAIN_HAS_FENV_xyz options (my understanding is that it cannot be just a single BR2_TOOLCHAIN_HAS_FENV, because there are multiple exceptions, and some architecture/toolchains support some which are sufficient for some packages, but lack others which are needed by other packages).

Quoted 4 lines
Quoted 1 line
    or1k     |          chawan-0.4.4          | NOK | https://autobuild.buildroot.org/results/2aa8986b4161c9ce25d4bddf8c29d1b204893e0b |

OpenRISC is not supported. How would I express this in Config.in? Any suggestion?

As usual:

config BR2_PACKAGE_CHAWAN_ARCH_SUPPORTS
bool
default y
depends on !BR2_or1k

config BR2_PACKAGE_CHAWAN
bool "chawan"
depends on BR2_PACKAGE_CHAWAN_ARCH_SUPPORTS

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot