- fetchdarcs supports now partial

- fetchdarcs_2pre added
- flapjax added
- no longer used : annotatedDerivations
- added bleeding edge repos with a tiny nix repository manager which dowloads and
  updates repostiries, then creates tar.gz dist files which are used by bleeding_edge_source
  (darcs tested only by now)
- added experimental my_environment with example

svn path=/nixpkgs/trunk/; revision=10974
This commit is contained in:
Marc Weber
2008-03-06 02:46:29 +00:00
parent 64652c5dfc
commit 1b51b70317
8 changed files with 290 additions and 111 deletions

View File

@@ -0,0 +1,25 @@
args:
args.stdenv.mkDerivation {
name = "flapjax-source-20070514";
src = args.fetchurl {
url = http://www.flapjax-lang.org/download/20070514/flapjax-source.tar.gz;
sha256 = "188dafpggbfdyciqhrjaq12q0q01z1rp3mpm2iixb0mvrci14flc";
};
phases = "unpackPhase buildPhase";
buildPhase = "
ensureDir \$out/bin
cd compiler;
ghc --make Fjc.hs -o \$out/bin/fjc
";
buildInputs =(with args; [ghc] ++ libs);
meta = {
description = "programming language designed around the demands of modern, client-based Web applications";
homepage = http://www.flapjax-lang.org/;
license = "BSD";
};
}

View File

@@ -1,15 +1,11 @@
args: with args; with lib; with annotatedDerivations;
args: with args; with lib;
stdenv.mkDerivation {
inherit suffix name ghc ;
inherit suffix name ghc readline ncurses;
buildInputs = map delAnnotation (libraries ++ [ghcPkgUtil]);
#tags = if (installSourceAndTags == true) then
# map sourceWithTagsDerivation ( uniqList { inputList =
# ( filterAnnotated ( concatLists (map uniqAnnotatedDeps libraries ) ) ) ; } )
# else [];
tags = map (x : sourceWithTagsDerivation (x.sourceWithTags))
(uniqList { inputList= filter annotatedWithSourceAndTagInfo libraries; } );
buildInputs = (libraries ++ [ghcPkgUtil]);
tags = map (x : sourceWithTagsDerivation ((lib.traceWhatis x).passthru.sourceWithTags))
(uniqList { inputList= filter annotatedWithSourceAndTagInfo libraries; } );
phases="installPhase";
@@ -23,16 +19,15 @@ stdenv.mkDerivation {
app=$(ls -al $ghc/bin/$a | sed -n 's%.*-> \\(.*\\)%\\1%p');
cat > \"\$out/bin/\$a$suffix\" << EOF
#!`type -f sh | gawk '{ print $3; }'`
export LIBRARY_PATH=\$readline/lib:\$ncurses/lib
GHC_PACKAGE_PATH=\${GHC_PACKAGE_PATH}\${g} \$ghc/bin/$app \"\\\$@\"
EOF
chmod +x \"\$out/bin/\$a$suffix\"
done
ensureDir \$out/{src,tags}
ensureDir \$out/src
for i in \$tags; do
for path in src tags; do
ln -s \$i/\$path/* \$out/\$path
done
ln -s \$i/src/* \$out/src
done
";
}

View File

@@ -1,13 +1,11 @@
{ ghcPkgUtil, gnum4, perl, ghcboot, stdenv, fetchurl, recurseIntoAttrs, gmp, readline, lib, annotatedDerivations, hasktags, ctags } :
with annotatedDerivations;
{ ghcPkgUtil, gnum4, perl, ghcboot, stdenv, fetchurl, recurseIntoAttrs, gmp, readline, lib, hasktags, ctags } :
rec {
/* What's in here?
Goal: really pure GHC. This means put every library into its each package.conf
and add all together using GHC_PACKAGE_PATH
First I've tried separating the build of ghc from it's lib. It hase been to painful. I've failed.
Now there is nix_ghc_pkg_tool.hs which just takes the installed package.conf
First I've tried separating the build of ghc from it's lib. It hase been to painful. I've failed. Now there is nix_ghc_pkg_tool.hs which just takes the installed package.conf
and creates a new package db file for each contained package.
The final attribute set looks similar to this:
@@ -111,7 +109,7 @@ rec {
deps = [ x.base x.old_locale x.old_time x.filepath ];};
filepath = { name = "filepath-1.1.0.0"; srcDir = "libraries/filepath";
deps = [ x.base ];};
ghc = { name = "ghc-${version}"; srcDir = "libraries/Cabal";
ghc = { name = "ghc-${version}"; srcDir = "compiler";
deps = [ x.base x.old_locale x.old_time x.filepath
x.directory x.array x.containers x.hpc x.bytestring
x.pretty x.packedstring x.template_haskell x.unix
@@ -142,7 +140,7 @@ rec {
name = "rts-1.0"; srcDir = "rts"; # TODO: Doesn't have .hs files so I should use ctags if creating tags at all
deps = [];
createTagFiles = [
{ name = "${name}_haskell_tags";
{ name = "${name}_haskell";
tagCmd = "${toString ctags}/bin/ctags -R .;mv tags \$TAG_FILE"; }
];
};
@@ -153,30 +151,24 @@ rec {
};
toDerivation = attrs : with attrs;
rec {
inherit name;
#aDeps = concatLists ( catAttrs ( subsetmap id args [ "buildInputs" "propagatedBuildInputs" ] ) );
aDeps = deps;
# dummy derivation, only creates setup-hook for package database located in the ghc derivation
aDeriv = stdenv.mkDerivation {
inherit name;
stdenv.mkDerivation {
inherit (attrs) name;
phases = "buildPhase fixupPhase";
buildInputs = [ ghcPkgUtil ];
propagatedBuildInputs = [ ghc ] ++ map delAnnotation attrs.deps;
buildPhase = "setupHookRegisteringPackageDatabase \"${ghc}/lib/ghc-${ghc.version}/${name}.conf\"";
};
sourceWithTags = {
src = ghc.src;
inherit srcDir;
name = name + "-src-with-tags";
createTagFiles = lib.maybeAttr "createTagFiles" [
{ name = "${name}_haskell_tags";
tagCmd = "${toString hasktags}/bin/hasktags-modified --ctags `find . -type f -name \"*.*hs\"`; sort tags > \$TAG_FILE"; }
] attrs;
};
propagatedBuildInputs = [ ghc ] ++ attrs.deps;
buildPhase = "setupHookRegisteringPackageDatabase \"${ghc}/lib/ghc-${ghc.version}/${attrs.name}.conf\"";
passthru = {
sourceWithTags = {
src = ghc.src;
inherit srcDir;
name = attrs.name + "-src-with-tags";
createTagFiles = lib.maybeAttr "createTagFiles" [
{ name = "${attrs.name}_haskell";
tagCmd = "${toString hasktags}/bin/hasktags-modified --ctags `find . -type f -name \"*.*hs\"`; sort tags > \$TAG_FILE"; }
] attrs;
};
};
};
derivations = with lib; builtins.listToAttrs (lib.concatLists ( lib.mapRecordFlatten
( n : attrs : let d = (toDerivation attrs); in [ (nv n d) (nv attrs.name d) ] ) pkgs ) );