From 78db9a8cb1db2dcac7ed14a657a74334733cfe76 Mon Sep 17 00:00:00 2001 From: Michael Ashton Date: Sat, 27 Oct 2012 15:13:56 -0700 Subject: [PATCH] Updated version of abcde to 2.5.4 - Added support for MusicBrainz queries to abcde package - Added new dependencies to abcde: mkcue, eject, perl, MusicBrainz, MusicBrainzDiscID - libdiscid version in pkg-config was incorrect; patched libdiscid to fix - Added WebServices::MusicBrainz Perl module - Added MusicBrainz::DiscID Perl module - Commented out XSLoader Perl module since it was broken, no packages depend on it, and it has been incorporated into the Perl core --- pkgs/applications/audio/abcde/abcde.patch | 30 +++++++++++++++ .../audio/abcde/cd-paranoia.patch | 16 -------- pkgs/applications/audio/abcde/default.nix | 31 ++++++++++----- pkgs/applications/audio/abcde/install.patch | 21 ---------- pkgs/applications/audio/abcde/which.patch | 16 -------- .../libraries/libdiscid/default.nix | 10 ++++- pkgs/top-level/all-packages.nix | 4 +- pkgs/top-level/perl-packages.nix | 38 +++++++++++++++---- 8 files changed, 95 insertions(+), 71 deletions(-) create mode 100644 pkgs/applications/audio/abcde/abcde.patch delete mode 100644 pkgs/applications/audio/abcde/cd-paranoia.patch delete mode 100644 pkgs/applications/audio/abcde/install.patch delete mode 100644 pkgs/applications/audio/abcde/which.patch diff --git a/pkgs/applications/audio/abcde/abcde.patch b/pkgs/applications/audio/abcde/abcde.patch new file mode 100644 index 00000000000..ae187043e6c --- /dev/null +++ b/pkgs/applications/audio/abcde/abcde.patch @@ -0,0 +1,30 @@ +Two changes: + +* Add an alias for `which', so abcde can find things in store +* Choose the right CDROM reader syntax for `cd-paranoia' + +--- abcde-2.5.4/abcde~ 2012-09-18 06:09:31.000000000 -0700 ++++ abcde-2.5.4/abcde 2012-10-27 00:08:48.000862364 -0700 +@@ -17,6 +17,11 @@ + + VERSION='2.5.4' + ++which () ++{ ++ type -P $1 ++} ++ + usage () + { + echo "This is abcde v$VERSION." +@@ -3497,6 +3502,10 @@ + for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do + if new_checkexec $DEFAULT_CDROMREADER; then + CDROMREADERSYNTAX=$DEFAULT_CDROMREADER ++ case "$DEFAULT_CDROMREADER" in ++ cd-paranoia) CDROMREADERSYNTAX=cdparanoia;; ++ *) CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;; ++ esac + break + fi + done diff --git a/pkgs/applications/audio/abcde/cd-paranoia.patch b/pkgs/applications/audio/abcde/cd-paranoia.patch deleted file mode 100644 index 58cada65fb8..00000000000 --- a/pkgs/applications/audio/abcde/cd-paranoia.patch +++ /dev/null @@ -1,16 +0,0 @@ -Choose the right CDROM reader syntax for `cd-paranoia'. - ---- abcde-2.3.99.6/abcde 2006-08-05 21:14:00.000000000 +0200 -+++ abcde-2.3.99.6/abcde 2008-10-29 22:55:38.000000000 +0100 -@@ -3184,7 +3184,10 @@ if [ -n "$DISCID" ] || [ "$CDROMREADERSY - if [ "$CDROMREADERSYNTAX" = "" ]; then - for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do - if new_checkexec $DEFAULT_CDROMREADER; then -- CDROMREADERSYNTAX=$DEFAULT_CDROMREADER -+ case "$DEFAULT_CDROMREADER" in -+ cd-paranoia) CDROMREADERSYNTAX=cdparanoia;; -+ *) CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;; -+ esac - break - fi - done diff --git a/pkgs/applications/audio/abcde/default.nix b/pkgs/applications/audio/abcde/default.nix index e7da594e4bc..e8c37d25694 100644 --- a/pkgs/applications/audio/abcde/default.nix +++ b/pkgs/applications/audio/abcde/default.nix @@ -1,19 +1,20 @@ -{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame +{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame, flac, eject, mkcue +, perl, DigestSHA, MusicBrainz, MusicBrainzDiscID , makeWrapper }: -let version = "2.3.99.6"; +let version = "2.5.4"; in stdenv.mkDerivation { name = "abcde-${version}"; src = fetchurl { url = "mirror://debian/pool/main/a/abcde/abcde_${version}.orig.tar.gz"; - sha256 = "1wl4ygj1cf1d6g05gwwygsd5g83l039fzi011r30ma5lnm763lyb"; + sha256 = "14g5lsgh53hza9848351kwpygc0yqpvvzp3s923aja77f2wpkdl5"; }; # FIXME: This package does not support MP3 encoding (only Ogg), # nor `distmp3', `eject', etc. - patches = [ ./install.patch ./which.patch ./cd-paranoia.patch ]; + patches = [ ./abcde.patch ]; configurePhase = '' sed -i "s|^[[:blank:]]*prefix *=.*$|prefix = $out|g ; @@ -29,25 +30,37 @@ in substituteInPlace "abcde" \ --replace "/etc/abcde.conf" "$out/etc/abcde.conf" + ''; + # no ELFs in this package, only scripts + dontStrip = true; + dontPatchELF = true; + buildInputs = [ makeWrapper ]; postInstall = '' - substituteInPlace "$out/bin/cddb-tool" \ - --replace '#!/bin/sh' '#!${bash}/bin/sh' - substituteInPlace "$out/bin/abcde" \ - --replace '#!/bin/bash' '#!${bash}/bin/bash' + # substituteInPlace "$out/bin/cddb-tool" \ + # --replace '#!/bin/sh' '#!${bash}/bin/sh' + # substituteInPlace "$out/bin/abcde" \ + # --replace '#!/bin/bash' '#!${bash}/bin/bash' + + # generic fixup script should be doing this, but it ignores this file for some reason + substituteInPlace "$out/bin/abcde-musicbrainz-tool" \ + --replace '#!/usr/bin/perl' '#!${perl}/bin/perl' wrapProgram "$out/bin/abcde" --prefix PATH ":" \ "$out/bin:${libcdio}/bin:${cddiscid}/bin:${wget}/bin:${vorbisTools}/bin:${id3v2}/bin:${lame}/bin" wrapProgram "$out/bin/cddb-tool" --prefix PATH ":" \ "${wget}/bin" + + wrapProgram "$out/bin/abcde-musicbrainz-tool" --prefix PATH ":" \ + "${wget}/bin" ''; meta = { - homepage = http://www.hispalinux.es/~data/abcde.php; + homepage = "http://lly.org/~rcw/abcde/page/"; licence = "GPLv2+"; description = "A Better CD Encoder (ABCDE)"; diff --git a/pkgs/applications/audio/abcde/install.patch b/pkgs/applications/audio/abcde/install.patch deleted file mode 100644 index f5ab75f4bb9..00000000000 --- a/pkgs/applications/audio/abcde/install.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- abcde-2.3.3/Makefile~ 2005-08-26 00:43:27.000000000 +0200 -+++ abcde-2.3.3/Makefile 2008-05-26 22:20:17.000000000 +0200 -@@ -14,13 +14,13 @@ clean: - - install: - $(INSTALL) -d -m 755 $(bindir) -- $(INSTALL) -m 755 -o 0 abcde $(bindir) -- $(INSTALL) -m 755 -o 0 cddb-tool $(bindir) -+ $(INSTALL) -m 755 abcde $(bindir) -+ $(INSTALL) -m 755 cddb-tool $(bindir) - $(INSTALL) -d -m 755 $(mandir) -- $(INSTALL) -m 644 -o 0 abcde.1 $(mandir) -- $(INSTALL) -m 644 -o 0 cddb-tool.1 $(mandir) -+ $(INSTALL) -m 644 abcde.1 $(mandir) -+ $(INSTALL) -m 644 cddb-tool.1 $(mandir) - $(INSTALL) -d -m 755 $(etcdir) -- $(INSTALL) -m 644 -o 0 abcde.conf $(etcdir) -+ $(INSTALL) -m 644 abcde.conf $(etcdir) - - tarball: - @cd .. && tar czvf abcde_$(VERSION).orig.tar.gz \ diff --git a/pkgs/applications/audio/abcde/which.patch b/pkgs/applications/audio/abcde/which.patch deleted file mode 100644 index 70474000ddd..00000000000 --- a/pkgs/applications/audio/abcde/which.patch +++ /dev/null @@ -1,16 +0,0 @@ -Add an alias for `which'. - ---- abcde-2.3.99.6/abcde 2006-08-05 21:14:00.000000000 +0200 -+++ abcde-2.3.99.6/abcde 2008-10-29 22:49:16.000000000 +0100 -@@ -15,6 +15,11 @@ - - VERSION='2.3.99-$Revision: 222M $' - -+which () -+{ -+ type -P $1 -+} -+ - usage () - { - echo "This is abcde v$VERSION." diff --git a/pkgs/development/libraries/libdiscid/default.nix b/pkgs/development/libraries/libdiscid/default.nix index bd39ea9464c..3ee43ba3bee 100644 --- a/pkgs/development/libraries/libdiscid/default.nix +++ b/pkgs/development/libraries/libdiscid/default.nix @@ -1,8 +1,9 @@ -{ stdenv, fetchurl, cmake }: +{ stdenv, fetchurl, cmake, pkgconfig }: stdenv.mkDerivation rec { name = "libdiscid-0.2.2"; + buildNativeInputs = [ pkgconfig ]; buildInputs = [ cmake ]; src = fetchurl { @@ -10,6 +11,13 @@ stdenv.mkDerivation rec { sha256 = "00l4ln9rk0vqf67iccwqrgc9qx1al92i05zylh85kd1zn9d5sjwp"; }; + # developer forgot to update his version number + # this is propagated to pkg-config + preConfigure = '' + substituteInPlace "CMakeLists.txt" \ + --replace "PROJECT_VERSION 0.1.1" "PROJECT_VERSION 0.2.2" + ''; + meta = { description = "A C library for creating MusicBrainz DiscIDs from audio CDs"; homepage = http://musicbrainz.org/doc/libdiscid; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 905b7b0ae40..3d20787dede 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6510,7 +6510,9 @@ let aangifte2011 = callPackage_i686 ../applications/taxes/aangifte-2011 { }; - abcde = callPackage ../applications/audio/abcde { }; + abcde = callPackage ../applications/audio/abcde { + inherit (perlPackages) DigestSHA MusicBrainz MusicBrainzDiscID; + }; abiword = callPackage ../applications/office/abiword { inherit (gnome) libglade libgnomecanvas; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 0604ae46e4f..18e21a6f309 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -2775,6 +2775,30 @@ rec { }; }; + MusicBrainzDiscID = buildModule rec { + name = "MusicBrainz-DiscID-0.03"; + src = fetchurl { + url = "mirror://cpan/authors/id/N/NJ/NJH/${name}.tar.gz"; + sha256 = "0fjph2q3yp0aa87gckv3391s47m13wbyylj7jb7vqx7hv0pzj0jh"; + }; + # Build.PL in this package uses which to find pkg-config -- make it use path instead + patchPhase = ''sed -ie 's/`which pkg-config`/"pkg-config"/' Build.PL''; + doCheck = false; # The main test performs network access + #buildInputs = [ TestMore TestPod ]; + buildInputs = [ pkgs.pkgconfig ]; + propagatedBuildInputs = [ pkgs.libdiscid ]; + }; + + MusicBrainz = buildPerlPackage rec { + name = "WebService-MusicBrainz-0.93"; + src = fetchurl { + url = "mirror://cpan/authors/id/B/BF/BFAIST/${name}.tar.gz"; + sha256 = "1gg62x6qv4jj73jsqh0sb237k96i22blj29afpbp1scp3m7i5g61"; + }; + propagatedBuildInputs = [ XMLLibXML LWP ClassAccessor URI ]; + doCheck = false; # Test performs network access. + }; + NamespaceAutoclean = buildPerlPackage rec { name = "namespace-autoclean-0.12"; src = fetchurl { @@ -4345,13 +4369,13 @@ rec { }; }; - XSLoader = buildPerlPackage { - name = "XSLoader-0.08"; - src = fetchurl { - url = mirror://cpan/authors/id/S/SA/SAPER/XSLoader-0.08.tar.gz; - sha256 = "0mr4l3givrpyvz1kg0kap2ds8g0rza2cim9kbnjy8hi64igkixi5"; - }; - }; + # XSLoader = buildPerlPackage { + # name = "XSLoader-0.08"; + # src = fetchurl { + # url = mirror://cpan/authors/id/S/SA/SAPER/XSLoader-0.08.tar.gz; + # sha256 = "0mr4l3givrpyvz1kg0kap2ds8g0rza2cim9kbnjy8hi64igkixi5"; + # }; + # }; YAML = buildPerlPackage rec { name = "YAML-0.80";