Skip to content

Commit

Permalink
Merge pull request #119185 from dotlambda/pycairo-python2
Browse files Browse the repository at this point in the history
python2Packages.pycairo: init at 1.18.2
  • Loading branch information
davidak committed Apr 12, 2021
2 parents 8c3fc3a + 7f0e7c8 commit 53c7f16
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
49 changes: 49 additions & 0 deletions pkgs/development/python-modules/pycairo/1.18.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ lib
, fetchFromGitHub
, meson
, ninja
, buildPythonPackage
, pytestCheckHook
, pkg-config
, cairo
, python
}:

buildPythonPackage rec {
pname = "pycairo";
version = "1.18.2";

format = "other";

src = fetchFromGitHub {
owner = "pygobject";
repo = "pycairo";
rev = "v${version}";
sha256 = "142145a2whvlk92jijrbf3i2bqrzmspwpysj0bfypw0krzi0aa6j";
};

nativeBuildInputs = [
meson
ninja
pkg-config
];

buildInputs = [
cairo
];

checkInputs = [
pytestCheckHook
];

mesonFlags = [
"-Dpython=${python.interpreter}"
];

meta = with lib; {
description = "Python 2 bindings for cairo";
homepage = "https://pycairo.readthedocs.io/";
license = with licenses; [ lgpl21Only mpl11 ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
9 changes: 6 additions & 3 deletions pkgs/development/python-modules/pycairo/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{ lib
, pythonOlder
, fetchFromGitHub
, meson
, ninja
, buildPythonPackage
, pytestCheckHook
, pkg-config
, cairo
, isPy3k
, python
}:

buildPythonPackage rec {
pname = "pycairo";
version = "1.20.0";

disabled = pythonOlder "3.6";

format = "other";

src = fetchFromGitHub {
Expand All @@ -37,11 +40,11 @@ buildPythonPackage rec {
];

mesonFlags = [
"-Dpython=${if isPy3k then "python3" else "python"}"
"-Dpython=${python.interpreter}"
];

meta = with lib; {
description = "Python 2/3 bindings for cairo";
description = "Python 3 bindings for cairo";
homepage = "https://pycairo.readthedocs.io/";
license = with licenses; [ lgpl21Only mpl11 ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/python2-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ with self; with super; {

pyblosxom = callPackage ../development/python-modules/pyblosxom { };

pycairo = callPackage ../development/python-modules/pycairo/1.18.nix {
inherit (pkgs) meson;
};

pycangjie = disabled pycangjie;

pycarddav = callPackage ../development/python-modules/pycarddav { };
Expand Down

0 comments on commit 53c7f16

Please sign in to comment.