Skip to content

Commit

Permalink
dtc: 1.6.1 -> 1.7.0
Browse files Browse the repository at this point in the history
The package now uses Meson and Ninja as the build system.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
  • Loading branch information
otavio authored and AndersonTorres committed May 29, 2023
1 parent 37f7c78 commit 280160b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 131 deletions.

This file was deleted.

61 changes: 48 additions & 13 deletions pkgs/development/compilers/dtc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
, lib
, fetchgit
, fetchpatch
, meson
, ninja
, flex
, bison
, pkg-config
Expand All @@ -14,35 +16,68 @@

stdenv.mkDerivation rec {
pname = "dtc";
version = "1.6.1";
version = "1.7.0";

src = fetchgit {
url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git";
rev = "refs/tags/v${version}";
sha256 = "sha256-gx9LG3U9etWhPxm7Ox7rOu9X5272qGeHqZtOe68zFs4=";
sha256 = "sha256-FMh3VvlY3fUK8fbd0M+aCmlUrmG9YegiOOQ7MOByffc=";
};

patches = [
# fix python 3.10 compatibility
# based on without requiring the setup.py rework
# https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=383e148b70a47ab15f97a19bb999d54f9c3e810f
./python-3.10.patch
# meson: Fix cell overflow tests when running from meson
(fetchpatch {
url = "https://github.com/dgibson/dtc/commit/32174a66efa4ad19fc6a2a6422e4af2ae4f055cb.patch";
sha256 = "sha256-C7OzwY0zq+2CV3SB5unI7Ill2M3deF7FXeQE3B/Kx2s=";
})

# fix dtc static building
./0001-Depend-on-.a-instead-of-.so-when-building-static.patch
# meson.build: bump version to 1.7.0
(fetchpatch {
url = "https://github.com/dgibson/dtc/commit/64a907f08b9bedd89833c1eee674148cff2343c6.patch";
sha256 = "sha256-p2KGS5GW+3uIPgXfuIx6aDC54csM+5FZDkK03t58AL8=";
})

# Fix version in libfdt/meson.build
(fetchpatch {
url = "https://github.com/dgibson/dtc/commit/723545ebe9933b90ea58dc125e4987c6bcb04ade.patch";
sha256 = "sha256-5Oq7q+62ZObj3e7rguN9jhSpYoQkwjSfo/N893229dQ=";
})

# Use #ifdef NO_VALGRIND
(fetchpatch {
url = "https://github.com/dgibson/dtc/commit/41821821101ad8a9f83746b96b163e5bcbdbe804.patch";
sha256 = "sha256-7QEFDtap2DWbUGqtyT/RgJZJFldKB8oSubKiCtLZ0w4=";
})
];

nativeBuildInputs = [ flex bison pkg-config which ]
++ lib.optionals pythonSupport [ python swig ];
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

nativeBuildInputs = [
meson
ninja
flex
bison
pkg-config
which
] ++ lib.optionals pythonSupport [
python
python.pkgs.setuptools-scm
swig
];

buildInputs = [ libyaml ];

postPatch = ''
patchShebangs pylibfdt/
patchShebangs setup.py
'';

makeFlags = [ "PYTHON=python" "STATIC_BUILD=${toString stdenv.hostPlatform.isStatic}" ];
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
# Required for installation of Python library and is innocuous otherwise.
env.DESTDIR = "/";

mesonAutoFeatures = "auto";
mesonFlags = [
(lib.mesonBool "static-build" stdenv.hostPlatform.isStatic)
];

postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -id $out/lib/libfdt.dylib $out/lib/libfdt-${version}.dylib
Expand Down
28 changes: 0 additions & 28 deletions pkgs/development/compilers/dtc/python-3.10.patch

This file was deleted.

0 comments on commit 280160b

Please sign in to comment.