Unverified Commit 86503de0 authored by Yorick's avatar Yorick Committed by GitHub
Browse files

libfdt: Rename the package to pylibfdt (#420985)

parents 1935165b 7bee2301
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
  which,
  pythonSupport ? false,
  python ? null,
  replaceVars,
  swig,
  libyaml,
}:
@@ -38,7 +39,15 @@ stdenv.mkDerivation (finalAttrs: {
      url = "https://github.com/dgibson/dtc/commit/ce1d8588880aecd7af264e422a16a8b33617cef7.patch";
      hash = "sha256-t1CxKnbCXUArtVcniAIdNvahOGXPbYhPCZiTynGLvfo=";
    })
  ];
  ]
  ++
    lib.optional pythonSupport
      # Make Meson use our Python version, not the one it was built with itself
      (
        replaceVars ./python-path.patch {
          python_bin = lib.getExe python;
        }
      );

  env.SETUPTOOLS_SCM_PRETEND_VERSION = finalAttrs.version;

@@ -60,6 +69,9 @@ stdenv.mkDerivation (finalAttrs: {

  postPatch = ''
    patchShebangs setup.py

    # Align the name with pypi
    sed -i "s/name='libfdt',/name='pylibfdt',/" setup.py
  '';

  # Required for installation of Python library and is innocuous otherwise.
+12 −0
Original line number Diff line number Diff line
diff --git a/meson.build b/meson.build
index 310699f..4e2b8a4 100644
--- a/meson.build
+++ b/meson.build
@@ -48,7 +48,7 @@ if not valgrind.found()
 endif
 
 py = import('python')
-py = py.find_installation(required: get_option('python'))
+py = py.find_installation('@python_bin@', required: get_option('python'))
 swig = find_program('swig', required: get_option('python'))
 pylibfdt_enabled = not meson.is_cross_build() and py.found() and swig.found() ? true : false
+1 −2
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ python3Packages.buildPythonApplication rec {
  ];

  pythonRemoveDeps = [
    "pylibfdt"
    "swig"
  ];

@@ -40,7 +39,7 @@ python3Packages.buildPythonApplication rec {
    pyserial
    tftpy
    crccheck
    # pylibfdt
    libfdt
    # swig
    packaging
  ];
+0 −5
Original line number Diff line number Diff line
@@ -25,11 +25,6 @@ buildPythonPackage rec {
    sha256 = "sha256-UJU8b9BzuuUSHRjnA6hOd1bMPNOlk4LNtrQV5aZmGhI=";
  };

  patches = [
    # Change name of pylibfdt to libfdt
    ./fix_libfdt_name.patch
  ];

  nativeBuildInputs = [ setuptools-scm ];

  propagatedBuildInputs = [
+0 −13
Original line number Diff line number Diff line
diff --git a/pyproject.toml b/pyproject.toml
index 2192a68..6a7ba95 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -27,7 +27,7 @@ dependencies = [
     "ruamel.yaml>0.15.69",
     "jsonschema>=4.1.2,<4.18",
     "rfc3987",
-    "pylibfdt",
+    "libfdt",
 ]
 
 [project.scripts]