Skip to content

Commit 280160b

Browse files
otavioAndersonTorres
authored andcommitted
dtc: 1.6.1 -> 1.7.0
The package now uses Meson and Ninja as the build system. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
1 parent 37f7c78 commit 280160b

3 files changed

Lines changed: 48 additions & 131 deletions

File tree

pkgs/development/compilers/dtc/0001-Depend-on-.a-instead-of-.so-when-building-static.patch

Lines changed: 0 additions & 90 deletions
This file was deleted.

pkgs/development/compilers/dtc/default.nix

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
, lib
33
, fetchgit
44
, fetchpatch
5+
, meson
6+
, ninja
57
, flex
68
, bison
79
, pkg-config
@@ -14,35 +16,68 @@
1416

1517
stdenv.mkDerivation rec {
1618
pname = "dtc";
17-
version = "1.6.1";
19+
version = "1.7.0";
1820

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

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

31-
# fix dtc static building
32-
./0001-Depend-on-.a-instead-of-.so-when-building-static.patch
34+
# meson.build: bump version to 1.7.0
35+
(fetchpatch {
36+
url = "https://github.com/dgibson/dtc/commit/64a907f08b9bedd89833c1eee674148cff2343c6.patch";
37+
sha256 = "sha256-p2KGS5GW+3uIPgXfuIx6aDC54csM+5FZDkK03t58AL8=";
38+
})
39+
40+
# Fix version in libfdt/meson.build
41+
(fetchpatch {
42+
url = "https://github.com/dgibson/dtc/commit/723545ebe9933b90ea58dc125e4987c6bcb04ade.patch";
43+
sha256 = "sha256-5Oq7q+62ZObj3e7rguN9jhSpYoQkwjSfo/N893229dQ=";
44+
})
45+
46+
# Use #ifdef NO_VALGRIND
47+
(fetchpatch {
48+
url = "https://github.com/dgibson/dtc/commit/41821821101ad8a9f83746b96b163e5bcbdbe804.patch";
49+
sha256 = "sha256-7QEFDtap2DWbUGqtyT/RgJZJFldKB8oSubKiCtLZ0w4=";
50+
})
3351
];
3452

35-
nativeBuildInputs = [ flex bison pkg-config which ]
36-
++ lib.optionals pythonSupport [ python swig ];
53+
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
54+
55+
nativeBuildInputs = [
56+
meson
57+
ninja
58+
flex
59+
bison
60+
pkg-config
61+
which
62+
] ++ lib.optionals pythonSupport [
63+
python
64+
python.pkgs.setuptools-scm
65+
swig
66+
];
3767

3868
buildInputs = [ libyaml ];
3969

4070
postPatch = ''
41-
patchShebangs pylibfdt/
71+
patchShebangs setup.py
4272
'';
4373

44-
makeFlags = [ "PYTHON=python" "STATIC_BUILD=${toString stdenv.hostPlatform.isStatic}" ];
45-
installFlags = [ "INSTALL=install" "PREFIX=$(out)" "SETUP_PREFIX=$(out)" ];
74+
# Required for installation of Python library and is innocuous otherwise.
75+
env.DESTDIR = "/";
76+
77+
mesonAutoFeatures = "auto";
78+
mesonFlags = [
79+
(lib.mesonBool "static-build" stdenv.hostPlatform.isStatic)
80+
];
4681

4782
postFixup = lib.optionalString stdenv.isDarwin ''
4883
install_name_tool -id $out/lib/libfdt.dylib $out/lib/libfdt-${version}.dylib

pkgs/development/compilers/dtc/python-3.10.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)