|
2 | 2 | , lib |
3 | 3 | , fetchgit |
4 | 4 | , fetchpatch |
| 5 | +, meson |
| 6 | +, ninja |
5 | 7 | , flex |
6 | 8 | , bison |
7 | 9 | , pkg-config |
|
14 | 16 |
|
15 | 17 | stdenv.mkDerivation rec { |
16 | 18 | pname = "dtc"; |
17 | | - version = "1.6.1"; |
| 19 | + version = "1.7.0"; |
18 | 20 |
|
19 | 21 | src = fetchgit { |
20 | 22 | url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git"; |
21 | 23 | rev = "refs/tags/v${version}"; |
22 | | - sha256 = "sha256-gx9LG3U9etWhPxm7Ox7rOu9X5272qGeHqZtOe68zFs4="; |
| 24 | + sha256 = "sha256-FMh3VvlY3fUK8fbd0M+aCmlUrmG9YegiOOQ7MOByffc="; |
23 | 25 | }; |
24 | 26 |
|
25 | 27 | 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 | + }) |
30 | 33 |
|
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 | + }) |
33 | 51 | ]; |
34 | 52 |
|
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 | + ]; |
37 | 67 |
|
38 | 68 | buildInputs = [ libyaml ]; |
39 | 69 |
|
40 | 70 | postPatch = '' |
41 | | - patchShebangs pylibfdt/ |
| 71 | + patchShebangs setup.py |
42 | 72 | ''; |
43 | 73 |
|
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 | + ]; |
46 | 81 |
|
47 | 82 | postFixup = lib.optionalString stdenv.isDarwin '' |
48 | 83 | install_name_tool -id $out/lib/libfdt.dylib $out/lib/libfdt-${version}.dylib |
|
0 commit comments