sox, ffmpeg_svn expressions added

ghcPkgUtil defines a function to create setup-hook 
- creating a packagedatabase (nix-support/package.conf)
- adding it to GHC_PACKAGE_PATH
see comments for details

svn path=/nixpkgs/trunk/; revision=9500
This commit is contained in:
Marc Weber
2007-10-22 00:51:40 +00:00
parent 614a3b47c6
commit e87c6a6793
5 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "ffmpeg-svn";
src = fetchurl {
url = http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2;
sha256 = "040a35f0c004323af14329c09ad3cff8d040e2cf9797d97cde3d9d83d02b4d87";
};
# !!! Hm, what are the legal consequences of --enable-gpl?
configureFlags = "--enable-shared --enable-pp --enable-gpl --disable-ffserver --disable-ffplay";
}

View File

@@ -0,0 +1,33 @@
# mantainer: Marc Weber (marco-oweber@gmx.de)
#
# example usage: add ghcPkgUtil to buildInputs then somewhere in buildPhase:
#
# createEmptyPackageDatabaseAndSetupHook
# configure --with-package-db=$PACKAGE_DB
# ... compile ghc library ...
# add your library to propagatedBuildInputs instead of buildInputs
# in all depending libraries
# creates a setup hook
# adding the package database
# nix-support/package.conf to GHC_PACKAGE_PATH
# if not already contained
setupHookRegisteringPackageDatabase(){
ensureDir $out/nix-support;
local pkgdb=$out/nix-support/package.conf
cat >> $out/nix-support/setup-hook << EOF
echo \$GHC_PACKAGE_PATH | grep -l $pkgdb &> /dev/null || \
export GHC_PACKAGE_PATH=\$GHC_PACKAGE_PATH\${GHC_PACKAGE_PATH:+$PATH_DELIMITER}$pkgdb;
EOF
}
# create an empty package database in which the new library can be registered.
createEmptyPackageDatabaseAndSetupHook(){
ensureDir $out/nix-support;
PACKAGE_DB=$out/nix-support/package.conf;
echo '[]' > $PACKAGE_DB";
setupHookRegisteringPackageDatabase
}

View File

@@ -0,0 +1,35 @@
args:
( args.mkDerivationByConfigruation {
flagConfig = {
mandatory = { buildInputs = ["pkgconfig"];};
# are these options of interest? We'll see
#--disable-fftw disable usage of FFTW
#--enable-debug enable debugging
#--disable-cpu-clip disable tricky cpu specific clipper
};
extraAttrs = co : {
name = "libsamplerate-0.1.2";
src = args.fetchurl {
url = http://www.mega-nerd.com/SRC/libsamplerate-0.1.2.tar.gz;
sha256 = "1m1iwzpcny42kcqv5as2nyb0ggrb56wzckpximqpp2y74dipdf4q";
};
configurePhase = "
export LIBSAMPLERATE_CFLAGS=\"-I \$libsamplerate/include\"
export LIBSAMPLERATE_LIBS=\"-L \$libsamplerate/libs\"
./configure --prefix=\$out"+co.configureFlags;
meta = {
description = "Sample Rate Converter for audio";
homepage = http://www.mega-nerd.com/SRC/index.html;
# you can choose one of the following licenses:
license = [ "GPL"
{ url=http://www.mega-nerd.com/SRC/libsamplerate-cul.pdf;
name="libsamplerate Commercial Use License";
} ];
};
};
} ) args