summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-10-04 15:12:33 +0200
committerGitHub <noreply@github.com>2022-10-04 15:12:33 +0200
commit5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7 (patch)
tree1e777035d6c92f277150ac80411c4f21af6acb69
parent445e6eec2043fd0b3024012d225b48bd6126355c (diff)
parent7994937ed20a50681738e1dd91619a6672e5ac19 (diff)
downloadnixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar.gz
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar.bz2
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar.lz
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar.xz
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.tar.zst
nixpkgs-5ecf65eb6f12d1e06cac7e1210f0fe64e8ca81e7.zip
Merge pull request #193680 from wegank/gimp-aarch64-darwin
-rw-r--r--pkgs/development/misc/resholve/resholve.nix14
-rw-r--r--pkgs/development/python-modules/pygobject/default.nix7
-rw-r--r--pkgs/development/python2-modules/pygtk/default.nix3
-rw-r--r--pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch28
-rw-r--r--pkgs/development/python2-modules/scandir/default.nix6
5 files changed, 44 insertions, 14 deletions
diff --git a/pkgs/development/misc/resholve/resholve.nix b/pkgs/development/misc/resholve/resholve.nix
index 959e7ee0cb5..435cca919da 100644
--- a/pkgs/development/misc/resholve/resholve.nix
+++ b/pkgs/development/misc/resholve/resholve.nix
@@ -19,24 +19,16 @@ python27Packages.buildPythonApplication {
 
   propagatedBuildInputs = [
     oildev
-    /*
-    Disable configargparse's tests on aarch64-darwin.
-    Several of py27 scandir's tests fail on aarch64-darwin. Chain:
-    configargparse -> pytest-check-hook -> pytest -> pathlib2 -> scandir
-    TODO: drop if https://github.com/NixOS/nixpkgs/issues/156807 resolves?
-    */
-    (python27Packages.configargparse.overridePythonAttrs (old: {
-      doCheck = stdenv.hostPlatform.system != "aarch64-darwin";
-    }))
+    python27Packages.configargparse
   ];
 
-  patchPhase = ''
+  postPatch = ''
     for file in setup.cfg _resholve/version.py; do
       substituteInPlace $file --subst-var-by version ${version}
     done
   '';
 
-   postInstall = ''
+  postInstall = ''
     installManPage resholve.1
   '';
 
diff --git a/pkgs/development/python-modules/pygobject/default.nix b/pkgs/development/python-modules/pygobject/default.nix
index bf42d17b4de..14acb15e03b 100644
--- a/pkgs/development/python-modules/pygobject/default.nix
+++ b/pkgs/development/python-modules/pygobject/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
+{ lib, stdenv, fetchurl, fetchpatch, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
 
 buildPythonPackage rec {
   pname = "pygobject";
@@ -15,6 +15,11 @@ buildPythonPackage rec {
 
   patches = lib.optionals stdenv.isDarwin [
     ./pygobject-2.0-fix-darwin.patch
+    (fetchpatch {
+      url = "https://github.com/macports/macports-ports/raw/f2975d5bbbc2459c661905c5a850cc661fa32f55/python/py-gobject/files/py-gobject-dynamic_lookup-11.patch";
+      sha256 = "sha256-mtlyu+La3+iC5iQAmVJzDA5E35XGaRQy/EKXzvrWRCg=";
+      extraPrefix = "";
+    })
   ];
 
   configureFlags = [ "--disable-introspection" ];
diff --git a/pkgs/development/python2-modules/pygtk/default.nix b/pkgs/development/python2-modules/pygtk/default.nix
index 20e9498ea30..de0a0a282cf 100644
--- a/pkgs/development/python2-modules/pygtk/default.nix
+++ b/pkgs/development/python2-modules/pygtk/default.nix
@@ -37,7 +37,8 @@ buildPythonPackage rec {
 
   buildPhase = "buildPhase";
 
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-ObjC";
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-ObjC"
+    ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "-lpython2.7";
 
   installPhase = "installPhase";
 
diff --git a/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch b/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch
new file mode 100644
index 00000000000..1b35a0b950c
--- /dev/null
+++ b/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch
@@ -0,0 +1,28 @@
+diff --git a/scandir.py b/scandir.py
+index 3f602fb..40af3e5 100644
+--- a/scandir.py
++++ b/scandir.py
+@@ -23,6 +23,7 @@ from os import listdir, lstat, stat, strerror
+ from os.path import join, islink
+ from stat import S_IFDIR, S_IFLNK, S_IFREG
+ import collections
++import platform
+ import sys
+ 
+ try:
+@@ -432,6 +433,15 @@ elif sys.platform.startswith(('linux', 'darwin', 'sunos5')) or 'bsd' in sys.plat
+                     ('__d_padding', ctypes.c_uint8 * 4),
+                     ('d_name', ctypes.c_char * 256),
+                 )
++            elif 'darwin' in sys.platform and 'arm64' in platform.machine():
++                _fields_ = (
++                    ('d_ino', ctypes.c_uint64),
++                    ('d_off', ctypes.c_uint64),
++                    ('d_reclen', ctypes.c_uint16),
++                    ('d_namlen', ctypes.c_uint16),
++                    ('d_type', ctypes.c_uint8),
++                    ('d_name', ctypes.c_char * 1024),
++                )
+             else:
+                 _fields_ = (
+                     ('d_ino', ctypes.c_uint32),  # must be uint32, not ulong
diff --git a/pkgs/development/python2-modules/scandir/default.nix b/pkgs/development/python2-modules/scandir/default.nix
index f92b1f5a6ed..e712cca8348 100644
--- a/pkgs/development/python2-modules/scandir/default.nix
+++ b/pkgs/development/python2-modules/scandir/default.nix
@@ -6,9 +6,13 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 ="1bkqwmf056pkchf05ywbnf659wqlp6lljcdb0y88wr9f0vv32ijd";
+    sha256 = "1bkqwmf056pkchf05ywbnf659wqlp6lljcdb0y88wr9f0vv32ijd";
   };
 
+  patches = [
+    ./add-aarch64-darwin-dirent.patch
+  ];
+
   checkPhase = "${python.interpreter} test/run_tests.py";
 
   meta = with lib; {