pythonDocs: init at 3.14, add panicgh as maintainer

This commit is contained in:
Nicolas Benes
2026-06-01 00:05:46 +02:00
parent 8e37346677
commit 2f031afd37
8 changed files with 153 additions and 17 deletions
@@ -2,25 +2,29 @@
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
TYPES="html pdf-a4 pdf-letter text texinfo"
URL=http://www.python.org/ftp/python/doc/VERSION/python-VERSION-docs-TYPE.tar.bz2
VERSIONS=$(for major in 2 3; do curl https://docs.python.org/$major/archives/ 2>/dev/null | perl -l -n -e'/<a href="python-([23].[0-9]+.[0-9]+)-docs-html.tar.bz2/ && print $1' | tail -n 1; done)
TYPES="html pdf-a4 text texinfo"
URL=https://docs.python.org/VERSION/archives/python-VERSION-docs-TYPE.tar.bz2
VERSIONS=$(for major in 3; do curl https://docs.python.org/$major/archives/ 2>/dev/null | perl -l -n -e'/<a href="python-([23].[0-9]+(.[0-9]+)?)-docs-html.tar.bz2/ && print $1' | tail -n 1; done)
echo "Generating expressions for:
${VERSIONS}
"
cat >default.nix <<EOF
{ stdenv, fetchurl, lib }:
{
stdenv,
fetchurl,
lib,
}:
let
pythonDocs = {
pythonDocs = {
EOF
for type in $TYPES; do
cat >>default.nix <<EOF
${type/-/_} = {
recurseForDerivations = true;
${type/-/_} = {
recurseForDerivations = true;
EOF
for version in $VERSIONS; do
@@ -39,7 +43,7 @@ EOF
hash=
if [ -e ${outfile} ]; then
currentversion=$(grep "url =" ${outfile} |cut -d/ -f7)
if [ ${version} = ${currentversion} ]; then
if [ "${version}" = "${currentversion}" ]; then
hash=$(grep sha256 ${outfile} | cut -d'"' -f2)
fi
fi
@@ -57,15 +61,19 @@ EOF
attrname=python${major}${minor}
cat >>default.nix <<EOF
${attrname} = import ./${major}.${minor}-${type}.nix {
inherit stdenv fetchurl lib;
};
${attrname} = import ./${major}.${minor}-${type}.nix {
inherit stdenv fetchurl lib;
};
EOF
echo "done."
echo
done
echo " };" >> default.nix
echo " };" >> default.nix
done
echo "}; in pythonDocs" >> default.nix
cat >>default.nix <<EOF
};
in
pythonDocs
EOF