audacious: migrate to meson build system, refactor

Separate the derivation in `audacious` and `audacious-plugins`. Since
one derivation depends on the other, we first build `audacious` without
the `audacious-plugins`, them we build `audacious-plugins` and finally
we build the final version of `audacious`.

Also, add myself as maintainer.

+169 -45
+25
pkgs/applications/audio/audacious/0001-Set-plugindir-to-PREFIX-lib-audacious.patch
··· 1 + From b64b03be9edf23a80fce0c76de61ffff0914ddce Mon Sep 17 00:00:00 2001 2 + From: Thiago Kenji Okada <thiagokokada@gmail.com> 3 + Date: Mon, 8 Aug 2022 10:28:33 +0100 4 + Subject: [PATCH] Set plugindir to $PREFIX/lib/audacious 5 + 6 + --- 7 + meson.build | 2 +- 8 + 1 file changed, 1 insertion(+), 1 deletion(-) 9 + 10 + diff --git a/meson.build b/meson.build 11 + index 3f7996f72..ab09d6476 100644 12 + --- a/meson.build 13 + +++ b/meson.build 14 + @@ -160,7 +160,7 @@ if (cxx.has_header('libintl.h')) 15 + endif 16 + 17 + 18 + -install_plugindir = audacious_dep.get_variable(pkgconfig: 'plugin_dir') 19 + +install_plugindir = join_paths(get_option('prefix'), 'lib/audacious') 20 + 21 + 22 + conf.set_quoted('INSTALL_PLUGINDIR', install_plugindir) 23 + -- 24 + 2.36.0 25 +
+31 -45
pkgs/applications/audio/audacious/default.nix
··· 1 - { 2 - mkDerivation, lib, fetchurl, fetchpatch, 3 - gettext, pkg-config, 4 - qtbase, 5 - alsa-lib, curl, faad2, ffmpeg, flac, fluidsynth, gdk-pixbuf, lame, libbs2b, 6 - libcddb, libcdio, libcdio-paranoia, libcue, libjack2, libmad, libmms, libmodplug, 7 - libmowgli, libnotify, libogg, libpulseaudio, libsamplerate, libsidplayfp, 8 - libsndfile, libvorbis, libxml2, lirc, mpg123, neon, qtmultimedia, soxr, 9 - wavpack, libopenmpt 1 + { lib 2 + , stdenv 3 + , audacious-plugins 4 + , fetchurl 5 + , gettext 6 + , meson 7 + , ninja 8 + , pkg-config 9 + , qtbase 10 + , wrapQtAppsHook 10 11 }: 11 12 12 - mkDerivation rec { 13 + stdenv.mkDerivation rec { 13 14 pname = "audacious"; 14 15 version = "4.2"; 15 16 ··· 17 18 url = "http://distfiles.audacious-media-player.org/audacious-${version}.tar.bz2"; 18 19 sha256 = "sha256-/rME5HCkgf4rPEyhycs7I+wmJUDBLQ0ebCKl62JeBLM="; 19 20 }; 20 - pluginsSrc = fetchurl { 21 - url = "http://distfiles.audacious-media-player.org/audacious-plugins-${version}.tar.bz2"; 22 - sha256 = "sha256-b6D2nDoQQeuHfDcQlROrSioKVqd9nowToVgc8UOaQX8="; 23 - }; 24 21 25 - nativeBuildInputs = [ gettext pkg-config ]; 22 + nativeBuildInputs = [ 23 + gettext 24 + meson 25 + ninja 26 + pkg-config 27 + wrapQtAppsHook 28 + ]; 26 29 27 30 buildInputs = [ 28 - # Core dependencies 29 31 qtbase 30 - 31 - # Plugin dependencies 32 - alsa-lib curl faad2 ffmpeg flac fluidsynth gdk-pixbuf lame libbs2b libcddb 33 - libcdio libcdio-paranoia libcue libjack2 libmad libmms libmodplug libmowgli 34 - libnotify libogg libpulseaudio libsamplerate libsidplayfp libsndfile 35 - libvorbis libxml2 lirc mpg123 neon qtmultimedia soxr wavpack 36 - libopenmpt 37 32 ]; 38 33 39 - configureFlags = [ "--disable-gtk" ]; 34 + mesonFlags = [ 35 + "-Dgtk=false" 36 + "-Dbuildstamp=NixOS" 37 + ]; 40 38 41 - # Here we build both audacious and audacious-plugins in one 42 - # derivation, since they really expect to be in the same prefix. 43 - # This is slighly tricky. 44 - builder = builtins.toFile "builder.sh" '' 45 - # First build audacious. 46 - ( 47 - source $stdenv/setup 48 - genericBuild 49 - ) 50 - # Then build the plugins. 51 - ( 52 - nativeBuildInputs="$out $nativeBuildInputs" # to find audacious 53 - source $stdenv/setup 54 - rm -rfv audacious-* 55 - src=$pluginsSrc 56 - genericBuild 57 - ) 39 + postInstall = lib.optionalString (audacious-plugins != null) '' 40 + ln -s ${audacious-plugins}/lib/audacious $out/lib 58 41 ''; 59 42 60 43 meta = with lib; { 61 - description = "Audio player"; 44 + description = "A lightweight and versatile audio player"; 62 45 homepage = "https://audacious-media-player.org/"; 63 - maintainers = with maintainers; [ eelco ramkromberg ttuegel ]; 46 + maintainers = with maintainers; [ eelco ramkromberg ttuegel thiagokokada ]; 64 47 platforms = with platforms; linux; 65 48 license = with licenses; [ 66 - bsd2 bsd3 #https://github.com/audacious-media-player/audacious/blob/master/COPYING 67 - gpl2 gpl3 lgpl2Plus #http://redmine.audacious-media-player.org/issues/46 49 + bsd2 50 + bsd3 #https://github.com/audacious-media-player/audacious/blob/master/COPYING 51 + gpl2 52 + gpl3 53 + lgpl2Plus #http://redmine.audacious-media-player.org/issues/46 68 54 ]; 69 55 }; 70 56 }
+109
pkgs/applications/audio/audacious/plugins.nix
··· 1 + { stdenv 2 + , fetchurl 3 + , alsa-lib 4 + , audacious 5 + , curl 6 + , faad2 7 + , ffmpeg 8 + , flac 9 + , fluidsynth 10 + , gdk-pixbuf 11 + , gettext 12 + , lame 13 + , libbs2b 14 + , libcddb 15 + , libcdio 16 + , libcdio-paranoia 17 + , libcue 18 + , libjack2 19 + , libmad 20 + , libmms 21 + , libmodplug 22 + , libmowgli 23 + , libnotify 24 + , libogg 25 + , libopenmpt 26 + , libpulseaudio 27 + , libsamplerate 28 + , libsidplayfp 29 + , libsndfile 30 + , libvorbis 31 + , libxml2 32 + , lirc 33 + , meson 34 + , mpg123 35 + , neon 36 + , ninja 37 + , pkg-config 38 + , qtbase 39 + , qtmultimedia 40 + , soxr 41 + , wavpack 42 + }: 43 + 44 + stdenv.mkDerivation rec { 45 + pname = "audacious-plugins"; 46 + version = "4.2"; 47 + 48 + src = fetchurl { 49 + url = "http://distfiles.audacious-media-player.org/audacious-plugins-${version}.tar.bz2"; 50 + sha256 = "sha256-b6D2nDoQQeuHfDcQlROrSioKVqd9nowToVgc8UOaQX8="; 51 + }; 52 + 53 + patches = [ ./0001-Set-plugindir-to-PREFIX-lib-audacious.patch ]; 54 + 55 + nativeBuildInputs = [ 56 + gettext 57 + meson 58 + ninja 59 + pkg-config 60 + ]; 61 + 62 + buildInputs = [ 63 + audacious 64 + alsa-lib 65 + curl 66 + faad2 67 + ffmpeg 68 + flac 69 + fluidsynth 70 + gdk-pixbuf 71 + lame 72 + libbs2b 73 + libcddb 74 + libcdio 75 + libcdio-paranoia 76 + libcue 77 + libjack2 78 + libmad 79 + libmms 80 + libmodplug 81 + libmowgli 82 + libnotify 83 + libogg 84 + libpulseaudio 85 + libsamplerate 86 + libsidplayfp 87 + libsndfile 88 + libvorbis 89 + libxml2 90 + lirc 91 + mpg123 92 + neon 93 + qtbase 94 + qtmultimedia 95 + soxr 96 + wavpack 97 + libopenmpt 98 + ]; 99 + 100 + mesonFlags = [ 101 + "-Dgtk=false" 102 + ]; 103 + 104 + dontWrapQtApps = true; 105 + 106 + meta = audacious.meta // { 107 + description = "Plugins for Audacious music player"; 108 + }; 109 + }
+4
pkgs/top-level/all-packages.nix
··· 25959 25959 aucatctl = callPackage ../applications/audio/aucatctl { }; 25960 25960 25961 25961 audacious = libsForQt5.callPackage ../applications/audio/audacious { }; 25962 + audacious-plugins = libsForQt5.callPackage ../applications/audio/audacious/plugins.nix { 25963 + # Avoid circular dependency 25964 + audacious = audacious.override { audacious-plugins = null; }; 25965 + }; 25962 25966 audaciousQt5 = audacious; 25963 25967 25964 25968 audacity-gtk2 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; };