Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Ismael Luceno <ismael@iodev.co.uk>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/pounce: New package
Date: Wed, 12 Jul 2023 21:38:31 +0200	[thread overview]
Message-ID: <20230712193831.GI188780@scaer> (raw)
In-Reply-To: <20230708193606.32014-1-ismael@iodev.co.uk>

Ismael, All,

On 2023-07-08 21:36 +0200, Ismael Luceno spake thusly:
> Simple IRC bouncer.
> 
> Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
> ---
[--SNIP--]
> diff --git a/package/pounce/Config.in b/package/pounce/Config.in
> new file mode 100644
> index 000000000000..83bb66643652
> --- /dev/null
> +++ b/package/pounce/Config.in
> @@ -0,0 +1,18 @@
> +config BR2_PACKAGE_POUNCE
> +	bool "pounce"
> +	select BR2_PACKAGE_LIBRESSL

    $ ./utils/docker-run make check-package
    package/pounce/Config.in:3: BR2_PACKAGE_LIBRESSL is part of a "choice" and should not be "select"ed

However, the situation is tricky: it seems that pounce does indeed
require libressl, and not libopenssl, because it really wants libtls.

In Buildroot, libopenssl and libressl are exclusive one to the other; we
then have two possible situations for a package:

  - works equally well with either libopenssl or libressl

  - only works with libopenssl

We have no way to represent this new case for pounce, which is:

  - only work with libressl.

So, the only solution is to actually depend on libressl:

    config BR2_PACKAGE_POUNCE
        bool "pounce"
        depends on BR2_PACKAGE_LIBRESSL
        [...]


    comment "pounce needs openssl support w/ libressl"
        depends on !BR2_PACKAGE_LIBRESSL

Unfortunately, for now, this is the only case, so we'll need a few other
cases before we look into providing a way to fore-se;ect libressl...

> +	help
> +	  pounce is a multi-client, TLS-only IRC bouncer. It maintains a
> +	  persistent connection to an IRC server, acting as a proxy and
> +	  buffer for a number of clients. When a client connects, any
> +	  messages received since it last disconnected will be relayed to
> +	  it. Unlike some other bouncers, pounce uses a single buffer for
> +	  all IRC messages, which acts as a queue from which each client
> +	  reads messages independently.
> +
> +	  pounce speaks regular modern IRC to both servers and clients, using
> +	  the server-time extension to indicate when messages originally
> +	  occurred. Clients identify themselves to pounce by their IRC
> +	  usernames.
> +
> +	  https://git.causal.agency/pounce/

    $ ./utils/docker-run make check-package
    package/pounce/Config.in:8: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/pounce/Config.in:9: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/pounce/Config.in:13: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)

Also, I think a better "homepage" would be:

    https://git.causal.agency/pounce/about/

> diff --git a/package/pounce/pounce.hash b/package/pounce/pounce.hash
> new file mode 100644
> index 000000000000..a827bd389f40
> --- /dev/null
> +++ b/package/pounce/pounce.hash
> @@ -0,0 +1,3 @@
> +# Locally computed
> +sha256  97f245556b1cc940553fca18f4d7d82692e6c11a30f612415e5e391e5d96604e  pounce-3.1.tar.gz
> +sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  LICENSE
> diff --git a/package/pounce/pounce.mk b/package/pounce/pounce.mk
> new file mode 100644
> index 000000000000..b0a28efd91bd
> --- /dev/null
> +++ b/package/pounce/pounce.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# pounce
> +#
> +################################################################################
> +
> +POUNCE_VERSION = 3.1
> +POUNCE_SITE = https://git.causal.agency/pounce/snapshot
> +POUNCE_SOURCE = pounce-$(POUNCE_VERSION).tar.gz

    $ ./utils/docker-run make check-package
    package/pounce/pounce.mk:9: remove default value of _SOURCE variable (http://nightly.buildroot.org/#generic-package-reference)

> +POUNCE_LICENSE = GPL-3.0+
> +POUNCE_LICENSE_FILES = LICENSE
> +POUNCE_DEPENDENCIES = libressl
> +
> +$(eval $(autotools-package))

It is not an autotools package: the configure script is hand-written, so
it should not use the autotools infra.

The configure script calls pkg-config, so you need it in the
dependencies.

The configure script is not playing nice with cross-compilation: it
calls 'uname' to decide what to do, which is incorrect. It happens that
we are running on linux and targetting linux, so it works by accident.
We should however make sure that this is going to always be the case.

    POUNCE_DEPENDENCIES = host=pkgconf libressl

    define POUNCE_FAKE_UNAME
        $(Q)mkdir -p $(@D)/bin
        $(Q)printf '#!/bin/sh\necho Linux\n' >$(@D)/bin/uname
        $(Q)chmod 755 $(@D)/bin/uname
    endef
    POUNCE_POST_EXTRACT_HOOKS += POUNCE_FAKE_UNAME

    define POUNCE_CONFIGURE_CMDS
        cd $(@D) && \
        PATH=$(@D)/bin:$(BR_PATH) \
        ./configure \
            --prefix=/usr
    endef

    define POUNCE_BUILD_CMDS
        $(TARGET_CONFIGURE_OPTS) \
        $(TARGET_MAKE_ENV) \
        $(MAKE) \
            -C $(@D)
    endef

    define POUNCE_INSTALL_TARGET_CMDS
        $(TARGET_CONFIGURE_OPTS) \
        $(TARGET_MAKE_ENV) \
        $(MAKE) \
            -C $(@D) \
            DESTDIR=$(TARGET_DIR) \
            install
    endef

    $(eval $(generic-package))

Of course, totally untested... ;-)

Can you update, check, and respin, please?

Regards,
Yann E. MORIN.

> -- 
> 2.40.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-07-12 19:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-08 19:36 [Buildroot] [PATCH] package/pounce: New package Ismael Luceno
2023-07-12 19:38 ` Yann E. MORIN [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-14 11:36 Ismael Luceno
2023-08-14 11:59 ` Yann E. MORIN
2023-08-14 12:12   ` Ismael Luceno
2023-07-08 19:35 Ismael Luceno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230712193831.GI188780@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=ismael@iodev.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox