From fea2f910e5850f67c10f04643e7ec9132c40f4e2 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Mon, 18 Aug 2008 16:03:38 +0000 Subject: [PATCH] snd shows it's help in firefox now svn path=/nixpkgs/trunk/; revision=12651 --- pkgs/applications/audio/snd/default.nix | 25 +++++++--- pkgs/applications/audio/snd/doc.patch | 62 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 pkgs/applications/audio/snd/doc.patch diff --git a/pkgs/applications/audio/snd/default.nix b/pkgs/applications/audio/snd/default.nix index e500ff736d4c..0a8bb95173f3 100644 --- a/pkgs/applications/audio/snd/default.nix +++ b/pkgs/applications/audio/snd/default.nix @@ -6,33 +6,46 @@ args : with args; sha256 = "0zqgfnkvkqxby1k74mwba1r4pb520glcsz5jjmpzm9m41nqnghmm"; }; - buildInputs = [gtk glib pkgconfig libXpm gmp gettext libX11] + buildInputs = [gtk glib pkgconfig libXpm gmp gettext libX11 fftw] ++ (lib.optional (args ? ruby) args.ruby) ++ (lib.optional (args ? mesa) args.mesa) ++ (lib.optional (args ? guile) args.guile) ++ (lib.optional (args ? libtool) args.libtool) ++ (lib.optional (args ? sndlib) args.sndlib) + ++ (lib.optional (args ? alsaLib) args.alsaLib) + ++ (lib.optional (args ? jackaudio) args.jackaudio) ; configureFlags = ["--with-gtk" "--with-xpm"] ++ (lib.optional (args ? ruby) "--with-ruby" ) ++ (lib.optional (args ? mesa) "--with-gl" ) ++ (lib.optional (args ? guile) "--with-guile") ++ (lib.optional (args ? sndlib) "--with-midi" ) + ++ (lib.optional (args ? alsaLib) "--with-alsa") + ++ (lib.optional (args ? jackaudio) "--with-jack" ) + ++ [ "--with-fftw" "--htmldir=$out/share/snd/html" "--with-doc-dir=$out/share/snd/html" ] ; } null; /* null is a terminator for sumArgs */ in with localDefs; - let preBuild = FullDepEntry (" + let makeDocsWork = FullDepEntry '' + # hackish way to make html docs work + h="$out/share/snd/html"; ensureDir "$h"; cp *.html "$h" + patch -p1 < ${./doc.patch} + sed "s@HTML-DIR@$h@" -i index.scm snd-help.c + '' [defEnsureDir]; + + preBuild = FullDepEntry ('' cp config.log /tmp/snd-config.log - export NIX_LDFLAGS=\"$NIX_LDFLAGS -L${libX11}/lib -lX11 \" - ") [minInit doUnpack]; + export NIX_LDFLAGS="$NIX_LDFLAGS -L${libX11}/lib -lX11" + + '') [minInit doUnpack makeDocsWork]; in stdenv.mkDerivation rec { name = "Snd-9.4"; builder = writeScript (name + "-builder") - (textClosure localDefs [doConfigure preBuild doMakeInstall doForceShare]); + (textClosure localDefs [doConfigure preBuild makeDocsWork doMakeInstall doForceShare ]); meta = { description = "Snd sound editor."; - homepage = http://ccrma.stanford.edu/software/snd; + homepage = http://ccrma.stanford.edu/software/snd; inherit src; }; } diff --git a/pkgs/applications/audio/snd/doc.patch b/pkgs/applications/audio/snd/doc.patch new file mode 100644 index 000000000000..4c40151e9881 --- /dev/null +++ b/pkgs/applications/audio/snd/doc.patch @@ -0,0 +1,62 @@ +diff --git a/index.scm b/index.scm +index 2148a58..713939c 100644 +--- a/index.scm ++++ b/index.scm +@@ -18,24 +18,7 @@ and if one is found, and the Snd documentation can be found, calls (html-program + (lambda (n) + ;; look for doc on current dir, then html dir, then global dir + ;; snd.html is what we'll search for +- (let ((dir (if (file-exists? "snd.html") +- (getcwd) +- (if (and (string? (html-dir)) +- (file-exists? (string-append (html-dir) "/snd.html"))) +- (html-dir) +- (if (file-exists? "/usr/share/doc/snd-9/snd.html") +- "/usr/share/doc/snd-9" +- (if (file-exists? "/usr/local/share/doc/snd-9/snd.html") +- "/usr/local/share/doc/snd-9" +- (if (file-exists? "/usr/doc/snd-9/snd.html") +- "/usr/doc/snd-9" +- (if (file-exists? "/usr/share/doc/snd-8/snd.html") +- "/usr/share/doc/snd-8" +- (if (file-exists? "/usr/local/share/doc/snd-8/snd.html") +- "/usr/local/share/doc/snd-8" +- (if (file-exists? "/usr/doc/snd-8/snd.html") +- "/usr/doc/snd-8" +- #f)))))))))) ++ (let (dir "HTML-DIR") + (if dir + (if (or (string=? (html-program) "netscape") + (string=? (html-program) "mozilla") +diff --git a/snd-help.c b/snd-help.c +index a6557e0..a40a02e 100644 +--- a/snd-help.c ++++ b/snd-help.c +@@ -3554,26 +3554,7 @@ static char *doc_files[DOC_DIRECTORIES] = { + + static char *html_directory(void) + { +- int i; +- if (mus_file_probe("snd.html")) +- return(mus_getcwd()); +- if (html_dir(ss)) +- { +- bool happy; +- char *hd = NULL; +- hd = (char *)CALLOC(snd_strlen(html_dir(ss)) + 16, sizeof(char)); +- sprintf(hd, html_dir(ss), "/snd.html"); +- happy = mus_file_probe(hd); +- FREE(hd); +- if (happy) return(copy_string(html_dir(ss))); +- } +-#ifdef MUS_DEFAULT_DOC_DIR +- if (mus_file_probe(MUS_DEFAULT_DOC_DIR "/snd.html")) +- return(copy_string(MUS_DEFAULT_DOC_DIR "/snd.html")); +-#endif +- for (i = 0; i < DOC_DIRECTORIES; i++) +- if (mus_file_probe(doc_files[i])) return(copy_string(doc_directories[i])); +- return(NULL); ++ return (copy_string ("HTML-DIR")); + } + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4bd4dfb7f8f0..f4d4e652570b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6593,14 +6593,14 @@ let pkgs = rec { }; sndBase = composedArgsAndFun (import ../applications/audio/snd) { - inherit fetchurl stdenv builderDefs stringsWithDeps lib; + inherit fetchurl stdenv builderDefs stringsWithDeps lib fftw; inherit pkgconfig gmp gettext; inherit (xlibs) libXpm libX11; inherit (gtkLibs) gtk glib; }; snd = sndBase.meta.function { - inherit guile mesa libtool; + inherit guile mesa libtool jackaudio alsaLib; }; sox = import ../applications/misc/audio/sox {