Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gobject introspection #1370

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions overrides/build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -14247,6 +14247,9 @@
"setuptools",
"setuptools-scm"
],
"pygobject": [
"setuptools"
],
"pygobject-stubs": [
"setuptools"
],
Expand Down Expand Up @@ -16389,6 +16392,9 @@
"python-monkey-business": [
"setuptools"
],
"python-mpd2": [
"setuptools"
],
"python-mpv-jsonipc": [
"setuptools"
],
Expand Down
42 changes: 20 additions & 22 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2122,31 +2122,29 @@ lib.composeManyExtensions [
) else
super.pyarrow;

pycairo = (
drv: (
drv.overridePythonAttrs (
_: {
format = "other";
}
)
).overridePythonAttrs (
old: {
pycairo = super.pycairo.overridePythonAttrs (
old: {
format = "other";
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
self.meson
pkgs.ninja
pkg-config
];

nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
self.meson
pkgs.ninja
pkg-config
];
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [
pkgs.cairo
];

propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
pkgs.cairo
];
preBuild = ''
cd ../
'';

mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ];
}
)
)
super.pycairo;
postBuild = ''
cd build
'';
mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ];
}
);

pycocotools = super.pycocotools.overridePythonAttrs (
old: {
Expand Down
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ in
subdirectory = callTest ./subdirectory { };
plyvel = callTest ./plyvel { };
awsume = callTest ./awsume { };
gobject-introspection = callTest ./gobject-introspection { };
} // lib.optionalAttrs (!stdenv.isDarwin) {
# pyqt5 = (callTest ./pyqt5 { });
pyqt6 = callTest ./pyqt6 { };
Expand Down
10 changes: 10 additions & 0 deletions tests/gobject-introspection/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs, poetry2nix, python310 }:

poetry2nix.mkPoetryApplication {
python = python310;
projectDir = ./.;
pythonImportsCheck = [ "gobject_introspection_test" ];

buildInputs = [ pkgs.libnotify ];
nativeBuildInputs = [ pkgs.gobject-introspection ];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import gi

gi.require_version("Notify", "0.7")

from gi.repository import Notify # noqa: E402, F401
57 changes: 57 additions & 0 deletions tests/gobject-introspection/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/gobject-introspection/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.poetry]
name = "gobject-introspection-test"
version = "0.1.0"
description = ""
authors = ["You <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.10"
python-mpd2 = "^3.1.0"
PyGObject = "^3.46.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"