aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/pyogg
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-05 12:43:18 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-05 12:44:52 +0000
commitcf85056ba64caf3267d43255ef4a1243e9c8ee3b (patch)
tree3051519e9c8275b870aac43f80af875715c9d124 /nixpkgs/pkgs/development/python-modules/pyogg
parent1148b1d122bc03e9a3665856c9b7bb96bd4e3994 (diff)
parent2436c27541b2f52deea3a4c1691216a02152e729 (diff)
Add 'nixpkgs/' from commit '2436c27541b2f52deea3a4c1691216a02152e729'
git-subtree-dir: nixpkgs git-subtree-mainline: 1148b1d122bc03e9a3665856c9b7bb96bd4e3994 git-subtree-split: 2436c27541b2f52deea3a4c1691216a02152e729
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyogg')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyogg/default.nix36
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyogg/pyogg-paths.patch79
2 files changed, 115 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyogg/default.nix b/nixpkgs/pkgs/development/python-modules/pyogg/default.nix
new file mode 100644
index 00000000000..88fdc960a2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyogg/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchPypi, buildPythonPackage, libvorbis, flac, libogg, libopus, opusfile, substituteAll }:
+
+buildPythonPackage rec {
+ pname = "PyOgg";
+ version = "0.6.9a1";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "0xabqwyknpvfc53s7il5pq6b07fcaqvz5bi5vbs3pbaw8602qvim";
+ };
+
+ buildInputs = [ libvorbis flac libogg libopus ];
+ propagatedBuidInputs = [ libvorbis flac libogg libopus opusfile ];
+ # There are no tests in this package.
+ doCheck = false;
+ patchFlags = [ "-p1" "--binary" ]; # patch has dos style eol
+ patches = [
+ (substituteAll {
+ src = ./pyogg-paths.patch;
+ flacLibPath="${flac.out}/lib/libFLAC${stdenv.hostPlatform.extensions.sharedLibrary}";
+ oggLibPath="${libogg}/lib/libogg${stdenv.hostPlatform.extensions.sharedLibrary}";
+ vorbisLibPath="${libvorbis}/lib/libvorbis${stdenv.hostPlatform.extensions.sharedLibrary}";
+ vorbisFileLibPath="${libvorbis}/lib/libvorbisfile${stdenv.hostPlatform.extensions.sharedLibrary}";
+ vorbisEncLibPath="${libvorbis}/lib/libvorbisenc${stdenv.hostPlatform.extensions.sharedLibrary}";
+ opusLibPath="${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
+ opusFileLibPath="${opusfile}/lib/libopusfile${stdenv.hostPlatform.extensions.sharedLibrary}";
+ })
+ ];
+
+ meta = {
+ description = "Xiph.org's Ogg Vorbis, Opus and FLAC for Python";
+ homepage = https://github.com/Zuzu-Typ/PyOgg;
+ license = lib.licenses.publicDomain;
+ maintainers = with lib.maintainers; [ pmiddend ];
+ };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyogg/pyogg-paths.patch b/nixpkgs/pkgs/development/python-modules/pyogg/pyogg-paths.patch
new file mode 100644
index 00000000000..c7f1933878b
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyogg/pyogg-paths.patch
@@ -0,0 +1,79 @@
+diff --git a/pyogg/flac.py b/pyogg/flac.py
+index 37cc788..9fb7e95 100644
+--- a/pyogg/flac.py
++++ b/pyogg/flac.py
+@@ -49,7 +49,7 @@ __here = os.getcwd()
+ libflac = None
+
+ try:
+- libflac = ExternalLibrary.load("FLAC", tests = [lambda lib: hasattr(lib, "FLAC__EntropyCodingMethodTypeString")])
++ libflac = ctypes.CDLL('@flacLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+diff --git a/pyogg/ogg.py b/pyogg/ogg.py
+index 7264774..2702e24 100644
+--- a/pyogg/ogg.py
++++ b/pyogg/ogg.py
+@@ -54,7 +54,7 @@ __here = os.getcwd()
+ libogg = None
+
+ try:
+- libogg = ExternalLibrary.load("ogg", tests = [lambda lib: hasattr(lib, "oggpack_writeinit")])
++ libogg = ctypes.CDLL('@oggLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+diff --git a/pyogg/opus.py b/pyogg/opus.py
+index 81e73da..640e59c 100644
+--- a/pyogg/opus.py
++++ b/pyogg/opus.py
+@@ -130,7 +130,7 @@ __here = os.getcwd()
+ libopus = None
+
+ try:
+- libopus = ExternalLibrary.load("opus", tests = [lambda lib: hasattr(lib, "opus_encoder_get_size")])
++ libopus = ctypes.CDLL('@opusLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+@@ -139,7 +139,7 @@ except:
+ libopusfile = None
+
+ try:
+- libopusfile = ExternalLibrary.load("opusfile", tests = [lambda lib: hasattr(lib, "opus_head_parse")])
++ libopusfile = ctypes.CDLL('@opusFileLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+diff --git a/pyogg/vorbis.py b/pyogg/vorbis.py
+index a8e4792..6f44d2d 100644
+--- a/pyogg/vorbis.py
++++ b/pyogg/vorbis.py
+@@ -52,7 +52,7 @@ __here = os.getcwd()
+ libvorbis = None
+
+ try:
+- libvorbis = ExternalLibrary.load("vorbis", tests = [lambda lib: hasattr(lib, "vorbis_info_init")])
++ libvorbis = ctypes.CDLL('@vorbisLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+@@ -61,7 +61,7 @@ except:
+ libvorbisfile = None
+
+ try:
+- libvorbisfile = ExternalLibrary.load("vorbisfile", tests = [lambda lib: hasattr(lib, "ov_clear")])
++ libvorbisfile = ctypes.CDLL('@vorbisFileLibPath@')
+ except ExternalLibraryError:
+ pass
+ except:
+@@ -70,7 +70,7 @@ except:
+ libvorbisenc = None
+
+ try:
+- libvorbisenc = ExternalLibrary.load("vorbisenc", tests = [lambda lib: hasattr(lib, "vorbis_encode_init")])
++ libvorbisenc = ctypes.CDLL('@vorbisEncLibPath@')
+ except ExternalLibraryError:
+ pass
+ except: