mpc123: refactor

+42 -33
+42 -20
pkgs/applications/audio/mpc123/default.nix
··· 1 - { fetchurl, lib, stdenv, gettext, libmpcdec, libao }: 2 3 - let version = "0.2.4"; in 4 - stdenv.mkDerivation rec { 5 pname = "mpc123"; 6 - inherit version; 7 8 - src = fetchurl { 9 - url = "mirror://sourceforge/mpc123/version%20${version}/${pname}-${version}.tar.gz"; 10 - sha256 = "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"; 11 }; 12 13 - patches = [ ./use-gcc.patch ]; 14 15 # Workaround build failure on -fno-common toolchains like upstream 16 # gcc-10. Otherwise build fails as: 17 # ld: /build/cc566Cj9.o:(.bss+0x0): multiple definition of `mpc123_file_reader'; ao.o:(.bss+0x40): first defined here 18 env.NIX_CFLAGS_COMPILE = "-fcommon"; 19 20 - buildInputs = [ gettext libmpcdec libao ]; 21 22 - installPhase = 23 - # XXX: Should install locales too (though there's only 1 available). 24 - '' mkdir -p "$out/bin" 25 - cp -v mpc123 "$out/bin" 26 - ''; 27 28 meta = { 29 - homepage = "https://mpc123.sourceforge.net/"; 30 - 31 description = "A Musepack (.mpc) audio player"; 32 - 33 license = lib.licenses.gpl2Plus; 34 - 35 maintainers = [ ]; 36 - platforms = lib.platforms.gnu ++ lib.platforms.linux; # arbitrary choice 37 }; 38 - }
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitLab 4 + , gettext 5 + , libao 6 + , libmpcdec 7 + }: 8 9 + stdenv.mkDerivation (finalAttrs: { 10 pname = "mpc123"; 11 + version = "0.2.4"; 12 13 + src = fetchFromGitLab { 14 + domain = "salsa.debian.org"; 15 + owner = "debian"; 16 + repo = "mpc123"; 17 + rev = "upstream/${finalAttrs.version}"; 18 + hash = "sha256-+/yxb19CJzyjQmT3O21pEmPR5YudmyCxWwo+W3uOB9Q="; 19 }; 20 21 + strictDeps = true; 22 + 23 + nativeBuildInputs = [ 24 + gettext 25 + ]; 26 + 27 + buildInputs = [ 28 + gettext 29 + libao 30 + libmpcdec 31 + ]; 32 + 33 + makeFlags = [ 34 + "CC=${stdenv.cc.targetPrefix}cc" 35 + ]; 36 37 # Workaround build failure on -fno-common toolchains like upstream 38 # gcc-10. Otherwise build fails as: 39 # ld: /build/cc566Cj9.o:(.bss+0x0): multiple definition of `mpc123_file_reader'; ao.o:(.bss+0x40): first defined here 40 env.NIX_CFLAGS_COMPILE = "-fcommon"; 41 42 + # XXX: Should install locales too (though there's only 1 available). 43 + installPhase = '' 44 + runHook preInstall 45 46 + mkdir -p "$out/bin" 47 + cp -v mpc123 "$out/bin" 48 + 49 + runHook postInstall 50 + ''; 51 52 meta = { 53 description = "A Musepack (.mpc) audio player"; 54 + homepage = "https://github.com/bucciarati/mpc123"; 55 license = lib.licenses.gpl2Plus; 56 + mainProgram = "mpc123"; 57 maintainers = [ ]; 58 + platforms = lib.platforms.unix; 59 }; 60 + })
-13
pkgs/applications/audio/mpc123/use-gcc.patch
··· 1 - Don't worry, just use GCC and everything's gonna be alright. 2 - 3 - --- mpc123-0.2.4/Makefile 2008-03-21 22:14:38.000000000 +0100 4 - +++ mpc123-0.2.4/Makefile 2010-01-28 23:26:49.000000000 +0100 5 - @@ -17,7 +17,7 @@ 6 - # along with this program; if not, write to the Free Software Foundation, 7 - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 8 - 9 - -CC := $(shell which colorgcc || which cc) 10 - +CC := gcc 11 - 12 - TAGSPRG := ctags 13 -
···