Merge pull request #320965 from Aleksanaa/toPythonModule-correction

python3Packages: clean up toPythonModule
This commit is contained in:
OTABI Tomoya 2024-07-04 12:00:21 +09:00 committed by GitHub
commit fbf23f6af1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 83 additions and 29 deletions

View File

@ -1,6 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
fetchgit,
cmake,
pkgconfig,
@ -19,9 +19,10 @@ let
onOffBool = b: if b then "ON" else "OFF";
withMPI = (mpi != null);
in
stdenv.mkDerivation rec {
buildPythonPackage rec {
version = "2.3.4";
pname = "hoomd-blue";
pyproject = false; # Built with cmake
src = fetchgit {
url = "https://bitbucket.org/glotzer/hoomd-blue";

View File

@ -1,23 +1,24 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
python,
pyusb,
}:
stdenv.mkDerivation (finalAttrs: {
buildPythonPackage rec {
pname = "py3buddy";
version = "1.0";
pyproject = false; # manually installed
src = fetchFromGitHub {
owner = "armijnhemel";
repo = "py3buddy";
rev = finalAttrs.version;
rev = version;
hash = "sha256-KJ0xGEXHY6o2074WFZ0u7gATS+wrrjyzanYretckWYk=";
};
propagatedBuildInputs = [ pyusb ];
dependencies = [ pyusb ];
dontConfigure = true;
dontBuild = true;
@ -40,4 +41,4 @@ stdenv.mkDerivation (finalAttrs: {
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ prusnak ];
};
})
}

View File

@ -1,11 +1,10 @@
{ lib, stdenv, unbound, openssl, expat, libevent, swig, pythonPackages }:
{ lib, buildPythonPackage, unbound, openssl, expat, libevent, swig, python, stdenv }:
let
inherit (pythonPackages) python;
in
stdenv.mkDerivation rec {
buildPythonPackage rec {
pname = "pyunbound";
inherit (unbound) version src;
pyproject = false; # Built with configure script
patches = unbound.patches or null;
nativeBuildInputs = [ swig ];

View File

@ -0,0 +1,47 @@
From 64f06c0643f1f8691a8f2757496b60f1ab98c866 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sa=C3=AFd=20Benaissa?= <sbenaissa@shearwatergeo.com>
Date: Fri, 8 Dec 2023 21:51:32 +0100
Subject: [PATCH] Add include for cstdint, fix segyio build on fedora
---
lib/experimental/segyio/segyio.hpp | 1 +
python/segyio/segyio.cpp | 1 +
python/setup.py | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/experimental/segyio/segyio.hpp b/lib/experimental/segyio/segyio.hpp
index 706f07ff5..7ba3ffb99 100644
--- a/lib/experimental/segyio/segyio.hpp
+++ b/lib/experimental/segyio/segyio.hpp
@@ -13,6 +13,7 @@
#include <vector>
#include <segyio/segy.h>
+#include <cstdint>
/*
* KNOWN ISSUES AND TODOs:
diff --git a/python/segyio/segyio.cpp b/python/segyio/segyio.cpp
index 76da965c3..bd8a8622e 100644
--- a/python/segyio/segyio.cpp
+++ b/python/segyio/segyio.cpp
@@ -16,6 +16,7 @@
#include <cstring>
#include <sstream>
#include <stdexcept>
+#include <cstdint>
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
diff --git a/python/setup.py b/python/setup.py
index 6c6553bc7..654075be9 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,6 +1,6 @@
import os
import sys
-import skbuild
+import skbuild # pip install scikit-build
import setuptools
long_description = """

View File

@ -1,18 +1,23 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
cmake,
ninja,
python,
scikit-build,
pytest,
numpy,
}:
stdenv.mkDerivation rec {
buildPythonPackage rec {
pname = "segyio";
version = "1.9.12";
pyproject = false; # Built with cmake
patches = [
# https://github.com/equinor/segyio/pull/570
./add_missing_cstdint.patch
];
postPatch = ''
# Removing unecessary build dependency
@ -34,7 +39,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
cmake
ninja
python
scikit-build
];

View File

@ -2587,7 +2587,7 @@ self: super: with self; {
criticality-score = callPackage ../development/python-modules/criticality-score { };
crocoddyl = toPythonModule (callPackage ../development/libraries/crocoddyl {
crocoddyl = toPythonModule (pkgs.crocoddyl.override {
pythonSupport = true;
python3Packages = self;
});
@ -4932,7 +4932,8 @@ self: super: with self; {
gmpy = callPackage ../development/python-modules/gmpy { };
gmsh = toPythonModule (callPackage ../applications/science/math/gmsh {
gmsh = toPythonModule (pkgs.gmsh.override {
inherit (self) python;
enablePython = true;
});
@ -5522,9 +5523,7 @@ self: super: with self; {
homepluscontrol = callPackage ../development/python-modules/homepluscontrol { };
hoomd-blue = toPythonModule (callPackage ../development/python-modules/hoomd-blue {
inherit python;
});
hoomd-blue = callPackage ../development/python-modules/hoomd-blue { };
hopcroftkarp = callPackage ../development/python-modules/hopcroftkarp { };
@ -6513,6 +6512,7 @@ self: super: with self; {
kmsxx = toPythonModule (pkgs.kmsxx.override {
withPython = true;
python3Packages = self;
});
knack = callPackage ../development/python-modules/knack { };
@ -8867,7 +8867,7 @@ self: super: with self; {
neuron-full = pkgs.neuron-full.override { python3 = python; };
neuronpy = python.pkgs.toPythonModule neuron-full;
neuronpy = toPythonModule neuron-full;
nevow = callPackage ../development/python-modules/nevow { };
@ -9681,7 +9681,7 @@ self: super: with self; {
pbs-installer = callPackage ../development/python-modules/pbs-installer { };
pc-ble-driver-py = toPythonModule (callPackage ../development/python-modules/pc-ble-driver-py { });
pc-ble-driver-py = callPackage ../development/python-modules/pc-ble-driver-py { };
pcapy-ng = callPackage ../development/python-modules/pcapy-ng {
inherit (pkgs) libpcap; # Avoid confusion with python package of the same name
@ -10713,7 +10713,7 @@ self: super: with self; {
py2bit = callPackage ../development/python-modules/py2bit { };
py3buddy = toPythonModule (callPackage ../development/python-modules/py3buddy { });
py3buddy = callPackage ../development/python-modules/py3buddy { };
py3exiv2 = callPackage ../development/python-modules/py3exiv2 {
inherit (pkgs) exiv2;
@ -12831,7 +12831,7 @@ self: super: with self; {
inherit (pkgs) udev;
};
pyunbound = toPythonModule (callPackage ../tools/networking/unbound/python.nix { });
pyunbound = callPackage ../development/python-modules/pyunbound { };
pyunifi = callPackage ../development/python-modules/pyunifi { };
@ -13875,9 +13875,9 @@ self: super: with self; {
segno = callPackage ../development/python-modules/segno { };
segyio = toPythonModule (callPackage ../development/python-modules/segyio {
segyio = callPackage ../development/python-modules/segyio {
inherit (pkgs) cmake ninja;
});
};
selectors2 = callPackage ../development/python-modules/selectors2 { };
@ -15389,7 +15389,7 @@ self: super: with self; {
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
};
tokenize-rt = toPythonModule (callPackage ../development/python-modules/tokenize-rt { });
tokenize-rt = callPackage ../development/python-modules/tokenize-rt { };
tokenlib = callPackage ../development/python-modules/tokenlib { };
@ -16854,7 +16854,9 @@ self: super: with self; {
vidstab = callPackage ../development/python-modules/vidstab { };
viennarna = toPythonModule pkgs.viennarna;
viennarna = toPythonModule (pkgs.viennarna.override {
python3 = self.python;
});
viewstate = callPackage ../development/python-modules/viewstate { };