2020-04-24 23:36:52 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
cd $(dirname $0);
|
|
|
|
|
|
|
|
source lib-cache.sh;
|
|
|
|
|
|
|
|
print_expression () {
|
2021-12-06 16:07:01 +00:00
|
|
|
module_name="$1";
|
|
|
|
module_basename="${module_name//::/-}";
|
|
|
|
module_compressedname="perl${module_name//::/}";
|
|
|
|
sourcelink="$(./source-download-link.sh "${module_name}")";
|
|
|
|
version_name="${sourcelink%.tar.*}";
|
|
|
|
version_name="${version_name##*/}";
|
|
|
|
dependencies="$(./filtered-requirements.sh "$module_name" | sed -e 's/^/perl/; s/:://g' | xargs)";
|
|
|
|
source_hash=$(nix-prefetch-url "$sourcelink" 2>/dev/null);
|
|
|
|
|
|
|
|
cat <<EOF
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
${module_compressedname} = import ../development/perl-modules/generic perl {
|
|
|
|
name = "${version_name}";
|
|
|
|
src = fetchurl {
|
|
|
|
url = ${sourcelink};
|
|
|
|
sha256 = "$source_hash";
|
|
|
|
};
|
|
|
|
propagatedBuildInputs = [${dependencies}];
|
|
|
|
};
|
|
|
|
|
|
|
|
EOF
|
|
|
|
};
|
|
|
|
|
|
|
|
module_name="$1";
|
|
|
|
module_basename="${module_name//::/-}";
|
|
|
|
|
|
|
|
cached_output print_expression "$module_basename" "$module_name" "nix";
|