mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Merge pull request #325888 from Mrmaxmeier/python-unicorn-python312
python312Packages.unicorn: pull in a patch for missing `distutils` import
This commit is contained in:
commit
8d8476d3de
@ -0,0 +1,29 @@
|
||||
From bcc65c0be18fc6ea6ec39da89d0de77544fa18c7 Mon Sep 17 00:00:00 2001
|
||||
From: Mrmaxmeier <Mrmaxmeier@gmail.com>
|
||||
Date: Tue, 9 Jul 2024 17:41:08 +0200
|
||||
Subject: [PATCH] Drop removed `distutils` import in favor of `sysconfig`
|
||||
|
||||
This patch is available online as https://github.com/unicorn-engine/unicorn/pull/1973
|
||||
|
||||
diff --git a/unicorn/unicorn.py b/unicorn/unicorn.py
|
||||
index 2e6a938f43..7204b8215f 100644
|
||||
--- a/unicorn/unicorn.py
|
||||
+++ b/unicorn/unicorn.py
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import annotations
|
||||
import ctypes
|
||||
import ctypes.util
|
||||
-import distutils.sysconfig
|
||||
+import sysconfig
|
||||
from functools import wraps
|
||||
from typing import Any, Callable, List, Tuple, Union
|
||||
import pkg_resources
|
||||
@@ -85,7 +85,7 @@ def _load_lib(path, lib_name):
|
||||
pkg_resources.resource_filename(__name__, 'lib'),
|
||||
os.path.join(os.path.split(__file__)[0], 'lib'),
|
||||
'',
|
||||
- distutils.sysconfig.get_python_lib(),
|
||||
+ sysconfig.get_path('platlib'),
|
||||
"/usr/local/lib/" if sys.platform == 'darwin' else '/usr/lib64',
|
||||
os.getenv('PATH', '')]
|
||||
|
@ -15,6 +15,11 @@ buildPythonPackage rec {
|
||||
|
||||
sourceRoot = "${src.name}/bindings/python";
|
||||
|
||||
patches = [
|
||||
# Python 3.12 compatibility: Drop removed `distutils` import in favor of `sysconfig`
|
||||
./avoid-distutils-python312.patch
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
ln -s ${unicorn-emu}/lib/libunicorn.* prebuilt/
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user