diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/python-modules/pygobject | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pygobject')
4 files changed, 162 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pygobject/3.nix b/nixpkgs/pkgs/development/python-modules/pygobject/3.nix new file mode 100644 index 000000000000..acc8ee713117 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pygobject/3.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, buildPythonPackage, pkgconfig, glib, gobject-introspection, +pycairo, cairo, which, ncurses, meson, ninja, isPy3k, gnome3 }: + +buildPythonPackage rec { + pname = "pygobject"; + version = "3.30.2"; + + format = "other"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "15zd4w43js048y7fd1kdi6wpvccz1njjy60xw1ckvfy1qhikbz54"; + }; + + outputs = [ "out" "dev" ]; + + mesonFlags = [ + "-Dpython=python${if isPy3k then "3" else "2" }" + ]; + + nativeBuildInputs = [ pkgconfig meson ninja ]; + buildInputs = [ glib gobject-introspection ] + ++ stdenv.lib.optionals stdenv.isDarwin [ which ncurses ]; + propagatedBuildInputs = [ pycairo cairo ]; + + passthru = { + updateScript = gnome3.updateScript { + packageName = pname; + attrPath = "python3.pkgs.${pname}3"; + }; + }; + + meta = with stdenv.lib; { + homepage = https://pygobject.readthedocs.io/; + description = "Python bindings for Glib"; + license = licenses.gpl2; + maintainers = with maintainers; [ jtojnar ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/python-modules/pygobject/default.nix b/nixpkgs/pkgs/development/python-modules/pygobject/default.nix new file mode 100644 index 000000000000..56e8f1fa5eb6 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pygobject/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib }: + +buildPythonPackage rec { + pname = "pygobject"; + version = "2.28.6"; + format = "other"; + name = pname + "-" + version; + + src = fetchurl { + url = "mirror://gnome/sources/pygobject/2.28/${name}.tar.xz"; + sha256 = "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv"; + }; + + outputs = [ "out" "devdoc" ]; + + patches = [ + # Fix warning spam + ./pygobject-2.28.6-set_qdata.patch + ./pygobject-2.28.6-gio-types-2.32.patch + ]; + + configureFlags = [ "--disable-introspection" ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ glib ]; + + # in a "normal" setup, pygobject and pygtk are installed into the + # same site-packages: we need a pth file for both. pygtk.py would be + # used to select a specific version, in our setup it should have no + # effect, but we leave it in case somebody expects and calls it. + postInstall = '' + mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${name}.pth} + + # Prevent wrapping of codegen files as these are meant to be + # executed by the python program + chmod a-x $out/share/pygobject/*/codegen/*.py + ''; + + meta = { + homepage = http://live.gnome.org/PyGObject; + description = "Python bindings for Glib"; + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-gio-types-2.32.patch b/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-gio-types-2.32.patch new file mode 100644 index 000000000000..fa0adf54ad04 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-gio-types-2.32.patch @@ -0,0 +1,50 @@ +From 42d01f060c5d764baa881d13c103d68897163a49 Mon Sep 17 00:00:00 2001 +From: Ryan Lortie <desrt@desrt.ca> +Date: Mon, 12 Mar 2012 16:44:14 -0400 +Subject: [PATCH] gio-types.defs: change some enums to flags + +These flags types were originally incorrectly handled in glib as being +enums. That bug was fixed, but they're still enums here, leading to +warnings about the mismatch. + +Change them to flags. + +https://bugzilla.gnome.org/show_bug.cgi?id=668522 +--- + gio/gio-types.defs | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/gio-types.defs b/gio/gio-types.defs +index 331e0bc..7eee5c8 100644 +--- a/gio/gio-types.defs ++++ b/gio/gio-types.defs +@@ -526,7 +526,7 @@ + ) + ) + +-(define-enum MountMountFlags ++(define-flags MountMountFlags + (in-module "gio") + (c-name "GMountMountFlags") + (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS") +@@ -545,7 +545,7 @@ + ) + ) + +-(define-enum DriveStartFlags ++(define-flags DriveStartFlags + (in-module "gio") + (c-name "GDriveStartFlags") + (gtype-id "G_TYPE_DRIVE_START_FLAGS") +@@ -770,7 +770,7 @@ + ) + ) + +-(define-enum SocketMsgFlags ++(define-flags SocketMsgFlags + (in-module "gio") + (c-name "GSocketMsgFlags") + (gtype-id "G_TYPE_SOCKET_MSG_FLAGS") +-- +1.7.8.5 + diff --git a/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-set_qdata.patch b/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-set_qdata.patch new file mode 100644 index 000000000000..55376b59d829 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pygobject/pygobject-2.28.6-set_qdata.patch @@ -0,0 +1,28 @@ +From 42d871eb0b08ee6d55e95cc7e4b90844919555b9 Mon Sep 17 00:00:00 2001 +From: Ivan Stankovic <ivan.stankovic@avl.com> +Date: Tue, 21 Feb 2012 12:24:58 +0100 +Subject: [PATCH] Fix set_qdata warning on accessing NULL gobject property + +https://bugzilla.gnome.org/show_bug.cgi?id=661155 +--- + gobject/pygobject.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/gobject/pygobject.c b/gobject/pygobject.c +index 6c2f06c..70dc89a 100644 +--- a/gobject/pygobject.c ++++ b/gobject/pygobject.c +@@ -991,7 +991,9 @@ pygobject_new(GObject *obj) + PyObject * + pygobject_new_sunk(GObject *obj) + { +- g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ if (obj) ++ g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ + return pygobject_new_full(obj, TRUE, NULL); + } + +-- +1.7.8.5 + |