biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / perl-modules / expression-generator / write-nix-expression.sh
blob9f5cdb9142eb2b5edb973d16c88d748a1abeaf29
1 #! /bin/sh
3 cd $(dirname $0);
5 source lib-cache.sh;
7 print_expression () {
8 module_name="$1";
9 module_basename="${module_name//::/-}";
10 module_compressedname="perl${module_name//::/}";
11 sourcelink="$(./source-download-link.sh "${module_name}")";
12 version_name="${sourcelink%.tar.*}";
13 version_name="${version_name##*/}";
14 dependencies="$(./filtered-requirements.sh "$module_name" | sed -e 's/^/perl/; s/:://g' | xargs)";
15 source_hash=$(nix-prefetch-url "$sourcelink" 2>/dev/null);
17 cat <<EOF
19 ${module_compressedname} = import ../development/perl-modules/generic perl {
20 name = "${version_name}";
21 src = fetchurl {
22 url = ${sourcelink};
23 sha256 = "$source_hash";
25 propagatedBuildInputs = [${dependencies}];
28 EOF
31 module_name="$1";
32 module_basename="${module_name//::/-}";
34 cached_output print_expression "$module_basename" "$module_name" "nix";