Python: move interpreters

Move Python interpreters (CPython, PyPy) to same folder and share
layout.
This commit is contained in:
Frederik Rietdijk
2016-07-07 14:05:05 +02:00
parent 86393cfc20
commit 1da6775775
48 changed files with 26 additions and 23 deletions

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python26-docs-html-2.6.8";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-html.tar.bz2;
sha256 = "09kznik9ahmnrqw9gkr7mjv3b3zr258f2fm27n12hrrwwsaszkni";
};
installPhase = ''
mkdir -p $out/share/doc/python26
cp -R ./ $out/share/doc/python26/html
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python26-docs-pdf-a4-2.6.8";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-pdf-a4.tar.bz2;
sha256 = "07k8n9zhd59s1yn8ahsizkaqnv969p0f2c2acxgxrxhhyy842pp8";
};
installPhase = ''
mkdir -p $out/share/doc/python26
cp -R ./ $out/share/doc/python26/pdf-a4
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python26-docs-pdf-letter-2.6.8";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-pdf-letter.tar.bz2;
sha256 = "01r87m8hb7f9ql4j9zcjcrr9150nsk23sj8cy02vygr83sc1ldmq";
};
installPhase = ''
mkdir -p $out/share/doc/python26
cp -R ./ $out/share/doc/python26/pdf-letter
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python26-docs-text-2.6.8";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-text.tar.bz2;
sha256 = "05wsdh6ilgkclgak09fq7fsx5kflkmqq8dyxi2rpydx289cw3a8c";
};
installPhase = ''
mkdir -p $out/share/doc/python26
cp -R ./ $out/share/doc/python26/text
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python27-docs-html-2.7.3";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-html.tar.bz2;
sha256 = "1hg92n0mzl9w6j33b2h0bf2vy6fsxnpxfdc3qw760vcm0y00155j";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/html
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python27-docs-pdf-a4-2.7.3";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-pdf-a4.tar.bz2;
sha256 = "13da88panq5b6qfhf8k4dgqgxkg4ydcac5cx69a3f35s1w90xdjr";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/pdf-a4
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python27-docs-pdf-letter-2.7.3";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-pdf-letter.tar.bz2;
sha256 = "0x41phsdrpivhzkchswsliyx3a10n7gzc9irkrw6rz22j81bfydg";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/pdf-letter
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python27-docs-text-2.7.3";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-text.tar.bz2;
sha256 = "1rxlb3jhh3892y65i45nk1y2lx981fr22a5hmfkp9gvjvdykjnzp";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/text
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-html-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-html.tar.bz2;
sha256 = "0vv24b9qi7gznv687ik0pa2w1rq9grqivy44znvj2ysjfg7mc2c1";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/html
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-pdf-a4-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-a4.tar.bz2;
sha256 = "1y6n13bxlw8a11khy3ynfbz8z0kpf2lvh32dvy8scyw3hrk6wdxp";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/pdf-a4
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-pdf-letter-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-letter.tar.bz2;
sha256 = "0mcj1i47nx81fc9zk1cic4c4p139qjcqlzf4hnnkzvb3jcgy5z6k";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/pdf-letter
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-text-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-text.tar.bz2;
sha256 = "10vk2fixg1aglqmsf89kn98rlirrbhnrk1285vzfbynf2iavxw0n";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/text
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -0,0 +1,53 @@
{ stdenv, fetchurl, lib }:
let
pythonDocs = {
html = {
recurseForDerivations = true;
python33 = import ./3.3-html.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-html.nix {
inherit stdenv fetchurl lib;
};
python26 = import ./2.6-html.nix {
inherit stdenv fetchurl lib;
};
};
pdf_a4 = {
recurseForDerivations = true;
python33 = import ./3.3-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
python26 = import ./2.6-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
};
pdf_letter = {
recurseForDerivations = true;
python33 = import ./3.3-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
python26 = import ./2.6-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
};
text = {
recurseForDerivations = true;
python33 = import ./3.3-text.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-text.nix {
inherit stdenv fetchurl lib;
};
python26 = import ./2.6-text.nix {
inherit stdenv fetchurl lib;
};
};
}; in pythonDocs

View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
TYPES="html pdf-a4 pdf-letter text"
URL=http://docs.python.org/ftp/python/doc/VERSION/python-VERSION-docs-TYPE.tar.bz2
VERSIONS=$(curl http://www.python.org/download/releases/ 2>/dev/null | grep "releases/[123456789]"| cut -d/ -f4 |grep -v "^[12].[012345]" |grep -v "^1.6.1")
echo "Generating expressions for:
${VERSIONS}
"
cat >default.nix <<EOF
{ stdenv, fetchurl, lib }:
let
pythonDocs = {
EOF
for type in $TYPES; do
cat >>default.nix <<EOF
${type/-/_} = {
recurseForDerivations = true;
EOF
for version in $VERSIONS; do
major=$(echo -n ${version}| cut -d. -f1)
minor=$(echo -n ${version}| cut -d. -f2)
outfile=${major}.${minor}-${type}.nix
hash=
if [ -e ${outfile} ]; then
currentversion=$(grep "url =" ${outfile} |cut -d/ -f7)
if [ ${version} = ${currentversion} ]; then
hash=$(grep sha256 ${outfile} | cut -d'"' -f2)
fi
fi
echo "Generating ${outfile}"
url=$(echo -n $URL |sed -e "s,VERSION,${version},g" -e "s,TYPE,${type},")
sha=$(nix-prefetch-url ${url} ${hash})
sed -e "s,VERSION,${version}," \
-e "s,MAJOR,${major}," \
-e "s,MINOR,${minor}," \
-e "s,TYPE,${type}," \
-e "s,URL,${url}," \
-e "s,SHA,${sha}," < template.nix > ${outfile}
attrname=python${major}${minor}
cat >>default.nix <<EOF
${attrname} = import ./${major}.${minor}-${type}.nix {
inherit stdenv fetchurl lib;
};
EOF
echo "done."
echo
done
echo " };" >> default.nix
done
echo "}; in pythonDocs" >> default.nix

View File

@@ -0,0 +1,18 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "pythonMAJORMINOR-docs-TYPE-VERSION";
src = fetchurl {
url = URL;
sha256 = "SHA";
};
installPhase = ''
mkdir -p $out/share/doc/pythonMAJORMINOR
cp -R ./ $out/share/doc/pythonMAJORMINOR/TYPE
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}