Skip to content

Commit

Permalink
Merge pull request #1370 from cpcloud/fix-gobject-introspection
Browse files Browse the repository at this point in the history
fix gobject introspection
  • Loading branch information
adisbladis authored Oct 26, 2023
2 parents 43a7430 + 63f51bf commit 4c171fe
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 22 deletions.
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"

0 comments on commit 4c171fe

Please sign in to comment.