From 18ba9e69a9f21a061b6af133dee8ce72caa1dbdc Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 8 Apr 2019 21:22:52 +0200 Subject: [PATCH 1/3] =?UTF-8?q?deadbeef:=200.7.2=20=E2=86=92=201.8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add native opus support - Remove wildmidi dependency, deadbeef uses its own fork --- pkgs/applications/audio/deadbeef/default.nix | 46 ++++++++++++++----- .../audio/deadbeef/fix-wildmidi.patch | 19 ++++++++ 2 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 pkgs/applications/audio/deadbeef/fix-wildmidi.patch diff --git a/pkgs/applications/audio/deadbeef/default.nix b/pkgs/applications/audio/deadbeef/default.nix index 0212560cd03..a6ca5b3639d 100644 --- a/pkgs/applications/audio/deadbeef/default.nix +++ b/pkgs/applications/audio/deadbeef/default.nix @@ -1,4 +1,10 @@ -{ config, stdenv, fetchurl, intltool, pkgconfig, jansson +{ config, stdenv, fetchFromGitHub +, autoconf +, automake +, libtool +, intltool +, pkgconfig +, jansson # deadbeef can use either gtk2 or gtk3 , gtk2Support ? false, gtk2 ? null , gtk3Support ? true, gtk3 ? null, gsettings-desktop-schemas ? null, wrapGAppsHook ? null @@ -9,7 +15,7 @@ , wavSupport ? true, libsndfile ? null , cdaSupport ? true, libcdio ? null, libcddb ? null , aacSupport ? true, faad2 ? null -, midiSupport ? false, wildmidi ? null +, opusSupport ? true, opusfile ? null , wavpackSupport ? false, wavpack ? null , ffmpegSupport ? false, ffmpeg ? null , apeSupport ? true, yasm ? null @@ -37,6 +43,7 @@ assert flacSupport -> flac != null; assert wavSupport -> libsndfile != null; assert cdaSupport -> (libcdio != null && libcddb != null); assert aacSupport -> faad2 != null; +assert opusSupport -> opusfile != null; assert zipSupport -> libzip != null; assert ffmpegSupport -> ffmpeg != null; assert apeSupport -> yasm != null; @@ -47,19 +54,27 @@ assert alsaSupport -> alsaLib != null; assert pulseSupport -> libpulseaudio != null; assert resamplerSupport -> libsamplerate != null; assert overloadSupport -> zlib != null; -assert midiSupport -> wildmidi != null; assert wavpackSupport -> wavpack != null; assert remoteSupport -> curl != null; stdenv.mkDerivation rec { - name = "deadbeef-${version}"; - version = "0.7.2"; + pname = "deadbeef"; + version = "1.8.0"; - src = fetchurl { - url = "mirror://sourceforge/project/deadbeef/${name}.tar.bz2"; - sha256 = "1168hgr1nf27pf24n1rlfh1kx1wiscwhpbhqw0rprwy203gsnqwa"; + src = fetchFromGitHub { + owner = "DeaDBeeF-Player"; + repo = "deadbeef"; + rev = version; + sha256 = "126i5qlkpv7pvi1mmc9y0jhqs6jjspsj7j615n2ddvsb2jsps81c"; }; + patches = [ + # Fix broken symbol name + # https://github.com/NixOS/nixpkgs/pull/59187#issuecomment-480977993 + # will be fixed in deadbeef 1.8.1 + ./fix-wildmidi.patch + ]; + buildInputs = with stdenv.lib; [ jansson ] ++ optional gtk2Support gtk2 ++ optionals gtk3Support [ gtk3 gsettings-desktop-schemas ] @@ -69,6 +84,7 @@ stdenv.mkDerivation rec { ++ optional wavSupport libsndfile ++ optionals cdaSupport [ libcdio libcddb ] ++ optional aacSupport faad2 + ++ optional opusSupport opusfile ++ optional zipSupport libzip ++ optional ffmpegSupport ffmpeg ++ optional apeSupport yasm @@ -79,16 +95,24 @@ stdenv.mkDerivation rec { ++ optional pulseSupport libpulseaudio ++ optional resamplerSupport libsamplerate ++ optional overloadSupport zlib - ++ optional midiSupport wildmidi ++ optional wavpackSupport wavpack ++ optional remoteSupport curl ; - nativeBuildInputs = with stdenv.lib; [ intltool pkgconfig ] - ++ optional gtk3Support wrapGAppsHook; + nativeBuildInputs = [ + autoconf + automake + intltool + libtool + pkgconfig + ] ++ stdenv.lib.optional gtk3Support wrapGAppsHook; enableParallelBuilding = true; + preConfigure = '' + ./autogen.sh + ''; + meta = with stdenv.lib; { description = "Ultimate Music Player for GNU/Linux"; homepage = http://deadbeef.sourceforge.net/; diff --git a/pkgs/applications/audio/deadbeef/fix-wildmidi.patch b/pkgs/applications/audio/deadbeef/fix-wildmidi.patch new file mode 100644 index 00000000000..c37308459bb --- /dev/null +++ b/pkgs/applications/audio/deadbeef/fix-wildmidi.patch @@ -0,0 +1,19 @@ +--- a/plugins/wildmidi/src/wildmidi_lib.c ++++ b/plugins/wildmidi/src/wildmidi_lib.c +@@ -394,11 +394,11 @@ free_gauss (void) { + } + } + +-unsigned long int delay_size[4][2]; +-signed long int a[5][2]; +-signed long int b[5][2]; +-signed long int gain_in[4]; +-signed long int gain_out[4]; ++static unsigned long int delay_size[4][2]; ++static signed long int a[5][2]; ++static signed long int b[5][2]; ++static signed long int gain_in[4]; ++static signed long int gain_out[4]; + + void init_lowpass (void) { + float c = 0; From b2a933aa777017d1769c493a415df106b66e7fd7 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 8 Apr 2019 21:23:40 +0200 Subject: [PATCH 2/3] =?UTF-8?q?deadbeefPlugins.mpris2:=201.11=20=E2=86=92?= =?UTF-8?q?=201.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/audio/deadbeef/plugins/mpris2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/deadbeef/plugins/mpris2.nix b/pkgs/applications/audio/deadbeef/plugins/mpris2.nix index 4e2e75953f3..4d5367087c1 100644 --- a/pkgs/applications/audio/deadbeef/plugins/mpris2.nix +++ b/pkgs/applications/audio/deadbeef/plugins/mpris2.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { name = "deadbeef-mpris2-plugin-${version}"; - version = "1.11"; + version = "1.12"; src = fetchurl { url = "https://github.com/Serranya/deadbeef-mpris2-plugin/releases/download/v${version}/${name}.tar.xz"; - sha256 = "1j631z34rwxf6wdjpsf8c2f1saq6qas1qmkgsg63m6zzpwqyizw0"; + sha256 = "0s3y4ka4qf38cypc0xspy79q0g5y1kqx6ldad7yr6a45nw6j95jh"; }; nativeBuildInputs = [ pkgconfig ]; From 8fa29da48acd8ed81d3e2ceff5f5f907da138168 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 8 Apr 2019 21:46:57 +0200 Subject: [PATCH 3/3] deadbeefPlugins.opus: drop opus support is now built into deadbeef --- .../audio/deadbeef/plugins/opus.nix | 31 ------------------- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 32 deletions(-) delete mode 100644 pkgs/applications/audio/deadbeef/plugins/opus.nix diff --git a/pkgs/applications/audio/deadbeef/plugins/opus.nix b/pkgs/applications/audio/deadbeef/plugins/opus.nix deleted file mode 100644 index 55db00c15bf..00000000000 --- a/pkgs/applications/audio/deadbeef/plugins/opus.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ stdenv, fetchFromBitbucket, opusfile, libopus, libogg, openssl, deadbeef }: - -stdenv.mkDerivation rec { - name = "deadbeef-opus-plugin-${version}"; - version = "0.8"; - - src = fetchFromBitbucket { - owner = "Lithopsian"; - repo = "deadbeef-opus"; - rev = "v${version}"; - sha256 = "057rgsw4563gs63k05s7zsdc0n4djxwlbyqabf7c88f23z35ryyi"; - }; - - makeFlags = [ - "PREFIX=$(out)" - ]; - - NIX_CFLAGS_COMPILE = [ - "-I${opusfile}/include/opus" - ]; - - buildInputs = [ deadbeef opusfile libopus libogg openssl ]; - - meta = with stdenv.lib; { - description = "Ogg Opus decoder plugin for the DeaDBeeF music player"; - homepage = https://bitbucket.org/Lithopsian/deadbeef-opus; - license = licenses.gpl2; # There are three files, each licensed under different license: zlib, gpl2Plus and lgpl2 - maintainers = [ maintainers.jtojnar ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bc6801b563a..de87d54e6af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16879,7 +16879,6 @@ in headerbar-gtk3 = callPackage ../applications/audio/deadbeef/plugins/headerbar-gtk3.nix { }; infobar = callPackage ../applications/audio/deadbeef/plugins/infobar.nix { }; mpris2 = callPackage ../applications/audio/deadbeef/plugins/mpris2.nix { }; - opus = callPackage ../applications/audio/deadbeef/plugins/opus.nix { }; }; deadbeef-with-plugins = callPackage ../applications/audio/deadbeef/wrapper.nix {