All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Simon Glass <sjg@chromium.org>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
	Gua Guo <gua.guo@intel.com>
Subject: Re: [PATCH 5/6] setup: Move setting of srcdir down to the bottom
Date: Mon, 12 Aug 2024 11:50:04 +1000	[thread overview]
Message-ID: <ZrlqTE_uoCUiY8nP@zatzit.fritz.box> (raw)
In-Reply-To: <20240811150248.7537-5-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1979 bytes --]

On Sun, Aug 11, 2024 at 09:02:47AM -0600, Simon Glass wrote:
> Put this variable assignment next to the others. Pass it to
> get_top_builddir() instead of relying on the global variable.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied, thanks.

> ---
> 
>  setup.py | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/setup.py b/setup.py
> index be3cf90..52844ce 100755
> --- a/setup.py
> +++ b/setup.py
> @@ -14,8 +14,6 @@ from setuptools import setup, Extension
>  from setuptools.command.build_py import build_py as _build_py
>  
>  
> -srcdir = os.path.dirname(__file__)
> -
>  def scan_for_info(srcdir):
>      """Scan for the version and long_description fields
>  
> @@ -35,9 +33,12 @@ def scan_for_info(srcdir):
>      return version, long_description
>  
>  
> -def get_top_builddir():
> +def get_top_builddir(srcdir):
>      """Figure out the top-level directory containing the source code
>  
> +    Args:
> +        srcdir (str): Source-directory path
> +
>      Returns:
>          str: Directory to build in
>      """
> @@ -55,8 +56,8 @@ class BuildPy(_build_py):
>          return super().run()
>  
>  
> +srcdir = os.path.dirname(__file__)
>  version, long_description = scan_for_info(srcdir)
> -top_builddir = get_top_builddir()
>  
>  libfdt_module = Extension(
>      '_libfdt',
> @@ -64,7 +65,7 @@ libfdt_module = Extension(
>      define_macros=[('PY_SSIZE_T_CLEAN', None)],
>      include_dirs=[os.path.join(srcdir, 'libfdt')],
>      libraries=['fdt'],
> -    library_dirs=[os.path.join(top_builddir, 'libfdt')],
> +    library_dirs=[os.path.join(get_top_builddir(srcdir), 'libfdt')],
>      swig_opts=['-I' + os.path.join(srcdir, 'libfdt')],
>  )
>  

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-08-12  2:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 15:02 [PATCH 1/6] Require Python 3 Simon Glass
2024-08-11 15:02 ` [PATCH 2/6] Tidy up some pylint warnings Simon Glass
2024-08-12  1:40   ` David Gibson
2024-08-11 15:02 ` [PATCH 3/6] setup: Move version and full_description into a function Simon Glass
2024-08-12  1:42   ` David Gibson
2024-08-11 15:02 ` [PATCH 4/6] setup: Collect top-level code together Simon Glass
2024-08-11 15:02 ` [PATCH 5/6] setup: Move setting of srcdir down to the bottom Simon Glass
2024-08-12  1:50   ` David Gibson [this message]
2024-08-11 15:02 ` [PATCH 6/6] setup: Add dependencies for Windows Simon Glass
2024-08-12  1:51   ` David Gibson
2024-08-12  2:01     ` David Gibson
2024-08-14  2:15       ` Simon Glass
2024-08-11 15:05 ` [PATCH 1/6] Require Python 3 Simon Glass
2024-08-12  1:39 ` David Gibson

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=ZrlqTE_uoCUiY8nP@zatzit.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=gua.guo@intel.com \
    --cc=sjg@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.