Update source updater to support fetchgit; add aufs2 using that method. Unfortunately, AUFS2 seems to require some strict conditions on kernel options and version..
svn path=/nixpkgs/trunk/; revision=16983
This commit is contained in:
parent
9121ae7fb8
commit
edd56d707a
@ -526,4 +526,10 @@ let inherit (builtins) head tail trace; in
|
|||||||
url = srcInfo.url;
|
url = srcInfo.url;
|
||||||
sha256 = srcInfo.hash;
|
sha256 = srcInfo.hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fetchGitFromSrcInfo = srcInfo: fetchgit {
|
||||||
|
url = srcInfo.url;
|
||||||
|
rev = srcInfo.rev;
|
||||||
|
sha256 = srcInfo.hash;
|
||||||
|
};
|
||||||
}) // args
|
}) // args
|
||||||
|
@ -42,6 +42,8 @@ if test -z "$finalPath"; then
|
|||||||
echo $tmpFile
|
echo $tmpFile
|
||||||
git checkout $rev
|
git checkout $rev
|
||||||
fi
|
fi
|
||||||
|
# Allow doing additional processing before .git removal
|
||||||
|
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
|
||||||
find $tmpFile -name .git\* | xargs rm -rf
|
find $tmpFile -name .git\* | xargs rm -rf
|
||||||
|
|
||||||
# Compute the hash.
|
# Compute the hash.
|
||||||
|
@ -12,6 +12,7 @@ Attributes:
|
|||||||
src-info-for-file.nix:
|
src-info-for-file.nix:
|
||||||
|
|
||||||
downloadPage
|
downloadPage
|
||||||
|
rev (for repos)
|
||||||
baseName (default = unnamed-package)
|
baseName (default = unnamed-package)
|
||||||
sourceRegexp (default = '.*[.]tar[.].*')
|
sourceRegexp (default = '.*[.]tar[.].*')
|
||||||
choiceCommand (default = 'head -1')
|
choiceCommand (default = 'head -1')
|
||||||
|
@ -26,6 +26,12 @@ getAttr () {
|
|||||||
echo "$data"
|
echo "$data"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
method="$(getAttr method fetchurl)"
|
||||||
|
baseName="$(getAttr baseName 'unnamed-package')"
|
||||||
|
commonPrefetchVars=" version name hash"
|
||||||
|
|
||||||
|
prefetchClause=""
|
||||||
|
[ fetchurl = "$method" ] && {
|
||||||
if [ -z "$forcedUrl" ] ; then
|
if [ -z "$forcedUrl" ] ; then
|
||||||
freshUrl="$("$own_dir"/urls-from-page.sh "$(getAttr downloadPage)" |
|
freshUrl="$("$own_dir"/urls-from-page.sh "$(getAttr downloadPage)" |
|
||||||
eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*')\"" |
|
eval "egrep \"$(getAttr sourceRegexp '.*[.]tar[.].*')\"" |
|
||||||
@ -40,11 +46,6 @@ else
|
|||||||
freshUrl="$forcedUrl"
|
freshUrl="$forcedUrl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ x"$freshUrl" = x"$(cat "$src_defs_dir"/advertisedUrl)" ]; then
|
|
||||||
echo "Source link not changed" >&2
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
version="$(echo "$freshUrl" |
|
version="$(echo "$freshUrl" |
|
||||||
eval "sed -re \"$(getAttr versionExtractorSedScript \
|
eval "sed -re \"$(getAttr versionExtractorSedScript \
|
||||||
's/.*-([0-9.]+)[.].*/\1/')\"")"
|
's/.*-([0-9.]+)[.].*/\1/')\"")"
|
||||||
@ -54,27 +55,51 @@ mirrorUrl="$(echo "$freshUrl" |
|
|||||||
's/-([0-9.]+)[.]/-${version}./')\"" |
|
's/-([0-9.]+)[.]/-${version}./')\"" |
|
||||||
eval "sed -r -e \"$(getAttr mirrorSedScript)\"")"
|
eval "sed -r -e \"$(getAttr mirrorSedScript)\"")"
|
||||||
|
|
||||||
hash=$(nix-prefetch-url "$freshUrl")
|
|
||||||
|
|
||||||
baseName="$(getAttr baseName 'unnamed-package')"
|
|
||||||
name="$baseName-$version"
|
name="$baseName-$version"
|
||||||
|
|
||||||
advertisedUrl="$freshUrl"
|
advertisedUrl="$freshUrl"
|
||||||
url="$mirrorUrl"
|
url="$mirrorUrl"
|
||||||
|
|
||||||
|
if [ x"$freshUrl" = x"$(cat "$src_defs_dir"/advertisedUrl)" ]; then
|
||||||
|
echo "Source link not changed" >&2
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
hash=$(nix-prefetch-url "$freshUrl")
|
||||||
|
|
||||||
|
prefetchVars="url advertisedUrl";
|
||||||
|
}
|
||||||
|
[ "fetchgit" = "$method" ] && {
|
||||||
|
repoUrl="$(getAttr repoUrl)"
|
||||||
|
export NIX_PREFETCH_GIT_CHECKOUT_HOOK="
|
||||||
|
cat .git/HEAD
|
||||||
|
"
|
||||||
|
export NIX_HASH_ALGO=sha256
|
||||||
|
rev="$(getAttr rev '')";
|
||||||
|
rev_and_hash="$("$own_dir"/../fetchgit/nix-prefetch-git "$repoUrl" "$rev" | tail -2)"
|
||||||
|
|
||||||
|
rev="$(echo "$rev_and_hash" | head -1)"
|
||||||
|
url="$repoUrl";
|
||||||
|
hash="$(echo "$rev_and_hash" | tail -1)"
|
||||||
|
version="$rev"
|
||||||
|
name="$baseName-$version"
|
||||||
|
|
||||||
|
prefetchVars="rev url";
|
||||||
|
}
|
||||||
|
|
||||||
|
prefetchAssignments="";
|
||||||
|
for i in $commonPrefetchVars $prefetchVars; do
|
||||||
|
prefetchAssignments="$prefetchAssignments $i=\"$(eval echo \"\$$i\")\";$(echo -e '\n ')"
|
||||||
|
done;
|
||||||
|
|
||||||
extraAssignments=""
|
extraAssignments=""
|
||||||
for i in $(getAttr extraVars ''); do
|
for i in $(getAttr extraVars ''); do
|
||||||
eval "$(getAttr "eval_$i" 'i=""')"
|
eval "$(getAttr "eval_$i" 'i=""')"
|
||||||
extraAssignments="$extraAssignments $i=\"$(eval echo \"\$$i\")\";"
|
extraAssignments="$extraAssignments $i=\"$(eval echo \"\$$i\")\";$(echo -e '\n ')"
|
||||||
done
|
done
|
||||||
|
|
||||||
cat << EOF > "$new_src_file"
|
cat << EOF > "$new_src_file"
|
||||||
rec {
|
rec {
|
||||||
advertisedUrl="$advertisedUrl";
|
$prefetchAssignments
|
||||||
version = "$version";
|
|
||||||
url="$url";
|
|
||||||
hash = "$hash";
|
|
||||||
name = "$name";
|
|
||||||
$extraAssignments
|
$extraAssignments
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
40
pkgs/os-specific/linux/aufs2/default.nix
Normal file
40
pkgs/os-specific/linux/aufs2/default.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{stdenv, fetchgit, kernel}:
|
||||||
|
|
||||||
|
let s = import ./src-for-default.nix; in
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "${s.name}-${kernel.version}";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
inherit (s) url rev;
|
||||||
|
sha256 = s.hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
kernelVersion=$(cd ${kernel}/lib/modules && ls)
|
||||||
|
kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/source)
|
||||||
|
tar xvfj ${kernel.src}
|
||||||
|
kernelSource=$(echo $(pwd)/linux-*)
|
||||||
|
cp -prd $kernelBuild/* $kernelSource
|
||||||
|
|
||||||
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$PWD/include"
|
||||||
|
|
||||||
|
make KDIR=$kernelSource aufs.ko
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
ensureDir $out/bin
|
||||||
|
cp util/aulchown $out/bin
|
||||||
|
|
||||||
|
ensureDir $out/share/man/man5
|
||||||
|
cp util/aufs.5 $out/share/man/man5
|
||||||
|
|
||||||
|
ensureDir $out/lib/modules/$kernelVersion/misc
|
||||||
|
cp aufs.ko $out/lib/modules/$kernelVersion/misc
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Another Unionfs implementation for Linux - second generation";
|
||||||
|
homepage = http://aufs.sourceforge.net/;
|
||||||
|
};
|
||||||
|
}
|
9
pkgs/os-specific/linux/aufs2/src-for-default.nix
Normal file
9
pkgs/os-specific/linux/aufs2/src-for-default.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
rec {
|
||||||
|
version="4c023a5ec2703cfea465b7ecd6f16b3ef156e5d5";
|
||||||
|
name="aufs2-4c023a5ec2703cfea465b7ecd6f16b3ef156e5d5";
|
||||||
|
hash="8858eb487db24e9cf524d9428a3fdf8861ee366ddf22f41b446f52490a92da2b";
|
||||||
|
rev="4c023a5ec2703cfea465b7ecd6f16b3ef156e5d5";
|
||||||
|
url="http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
6
pkgs/os-specific/linux/aufs2/src-info-for-default.nix
Normal file
6
pkgs/os-specific/linux/aufs2/src-info-for-default.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
repoUrl = "http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git";
|
||||||
|
rev = "origin/aufs2";
|
||||||
|
baseName="aufs2";
|
||||||
|
method="fetchgit";
|
||||||
|
}
|
@ -5298,6 +5298,10 @@ let
|
|||||||
inherit fetchurl stdenv kernel;
|
inherit fetchurl stdenv kernel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
aufs2 = import ../os-specific/linux/aufs2 {
|
||||||
|
inherit fetchgit stdenv kernel;
|
||||||
|
};
|
||||||
|
|
||||||
exmap = import ../os-specific/linux/exmap {
|
exmap = import ../os-specific/linux/exmap {
|
||||||
inherit fetchurl stdenv kernel boost pcre pkgconfig;
|
inherit fetchurl stdenv kernel boost pcre pkgconfig;
|
||||||
inherit (gtkLibs) gtkmm;
|
inherit (gtkLibs) gtkmm;
|
||||||
|
Loading…
Reference in New Issue
Block a user