From bf218e6cbce23db327189b361db08b8b783e0821 Mon Sep 17 00:00:00 2001 From: Tyler Benster Date: Sun, 26 May 2019 20:00:26 -0700 Subject: [PATCH] python3Packages.python-vlc: init at 3.0.7110 Co-Authored-By: Jan Tojnar --- .../python-modules/python-vlc/default.nix | 37 +++++++++++++++++++ .../python-modules/python-vlc/vlc-paths.patch | 13 +++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/python-vlc/default.nix create mode 100644 pkgs/development/python-modules/python-vlc/vlc-paths.patch diff --git a/pkgs/development/python-modules/python-vlc/default.nix b/pkgs/development/python-modules/python-vlc/default.nix new file mode 100644 index 000000000000..2bf59a633411 --- /dev/null +++ b/pkgs/development/python-modules/python-vlc/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, vlc +, substituteAll +}: + +buildPythonPackage rec { + pname = "python-vlc"; + version = "3.0.7110"; + + src = fetchPypi { + inherit pname version; + sha256 = "0ydnqwwgpwq1kz1pjrc7629ljzdd30izymjylsbzzyq8pq6wl6w2"; + }; + + propagatedBuildInputs = [ + setuptools + ]; + + patches = [ + (substituteAll { + src = ./vlc-paths.patch; + libvlcPath="${vlc}/lib/libvlc.so.5"; + }) + ]; + + doCheck = false; # no tests + + meta = with lib; { + homepage = "https://wiki.videolan.org/PythonBinding"; + maintainers = with maintainers; [ tbenst ]; + description = "Python bindings for VLC, the cross-platform multimedia player and framework"; + license = licenses.lgpl21Plus; + }; +} diff --git a/pkgs/development/python-modules/python-vlc/vlc-paths.patch b/pkgs/development/python-modules/python-vlc/vlc-paths.patch new file mode 100644 index 000000000000..0b1cf732711a --- /dev/null +++ b/pkgs/development/python-modules/python-vlc/vlc-paths.patch @@ -0,0 +1,13 @@ +diff --git a/vlc.py b/vlc.py +index e3245a5..cebec09 100644 +--- a/vlc.py ++++ b/vlc.py +@@ -190,7 +190,7 @@ def find_lib(): + + else: + # All other OSes (linux, freebsd...) +- p = find_library('vlc') ++ p = "@libvlcPath@" + try: + dll = ctypes.CDLL(p) + except OSError: # may fail diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1cae92a2c2fe..e22321bf2bd9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5139,6 +5139,8 @@ in { vsts = callPackage ../development/python-modules/vsts { }; + python-vlc = callPackage ../development/python-modules/python-vlc { }; + weasyprint = callPackage ../development/python-modules/weasyprint { }; webassets = callPackage ../development/python-modules/webassets { };