From 57b496ea98bdbd633c48f16af1c69a196aaf963a Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Sun, 14 Nov 2021 15:54:33 +1300 Subject: misc: Replace tab indentation with spaces I've tried to be consistent, using four or eight spaces to line up with existing code. --- .../compilers/ios-cross-compile/9.2_builder.sh | 78 +++++++++++----------- .../development/libraries/gdk-pixbuf/setup-hook.sh | 22 +++--- .../libraries/physics/lhapdf/maintainer.sh | 6 +- pkgs/development/libraries/slib/setup-hook.sh | 10 +-- .../lisp-modules/clwrapper/cl-wrapper.sh | 70 +++++++++---------- .../from-quicklisp/asdf-description.sh | 4 +- .../barebones-quicklisp-expression.sh | 6 +- .../expression-generator/filtered-requirements.sh | 12 ++-- .../expression-generator/full-requirements.sh | 18 ++--- .../perl-modules/expression-generator/grab-url.sh | 13 ++-- .../perl-modules/expression-generator/lib-cache.sh | 21 +++--- .../expression-generator/requirements.sh | 12 ++-- .../expression-generator/retrieve-file-link.sh | 8 +-- .../expression-generator/retrieve-meta-yaml.sh | 8 +-- .../expression-generator/source-download-link.sh | 10 +-- .../expression-generator/write-nix-expression.sh | 20 +++--- .../tools/build-managers/tup/setup-hook.sh | 52 +++++++-------- 17 files changed, 184 insertions(+), 186 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh b/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh index 4604b1fdea727..68ba3ed3a920a 100644 --- a/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh +++ b/pkgs/development/compilers/ios-cross-compile/9.2_builder.sh @@ -8,43 +8,43 @@ function extract case "$1" in *.tar.xz) - xz -dc $1 | tar "$tarflags" - ;; - *) - printf "Make sure you give a iPhoneOS9.2.sdk.tar.xz file \n" ;; + xz -dc $1 | tar "$tarflags" - ;; + *) + printf "Make sure you give a iPhoneOS9.2.sdk.tar.xz file \n" ;; esac } function verify_arch { case "$1" in - # Our good arches. - armv7|arm64) ;; - *) - local - acc="armv7 | arm64" - error_message=$( - printf '%s is not an acceptable arch. Try one of %s' "$1" "$acc" - ) - printf "$error_message\n" - exit + # Our good arches. + armv7|arm64) ;; + *) + local + acc="armv7 | arm64" + error_message=$( + printf '%s is not an acceptable arch. Try one of %s' "$1" "$acc" + ) + printf "$error_message\n" + exit esac } function verify_sdk_version { sdk_version=$(basename "$1" | grep -P -o "[0-9].[0-9]+") case "$sdk_version" in - # Make sure the SDK is correct. - [5-9].[0-9]) ;; - *) - printf 'No iPhone SDK version in file name\n' + # Make sure the SDK is correct. + [5-9].[0-9]) ;; + *) + printf 'No iPhone SDK version in file name\n' esac } function do_build { if [ $# -lt 2 ]; then - printf "usage: $0 iPhoneOS.sdk.tar* \n" 1>&2 - printf "i.e. $0 /path/to/iPhoneOS.sdk.tar.xz armv7\n" 1>&2 - exit 1 + printf "usage: $0 iPhoneOS.sdk.tar* \n" 1>&2 + printf "i.e. $0 /path/to/iPhoneOS.sdk.tar.xz armv7\n" 1>&2 + exit 1 fi mkdir -p $out @@ -54,7 +54,7 @@ function do_build { pushd "$cctools_port"/usage_examples/ios_toolchain &> /dev/null export LC_ALL=C - + local triple='%s-apple-darwin11' target_dir="$PWD/target" @@ -75,12 +75,12 @@ function do_build { extract "$1" local sys_lib=$( - find $sdk_dir -name libSystem.dylib -o -name libSystem.tbd | head -n1 - ) + find $sdk_dir -name libSystem.dylib -o -name libSystem.tbd | head -n1 + ) if [ -z "$sys_lib" ]; then - printf "SDK should contain libSystem{.dylib,.tbd}\n" 1>&2 - exit 1 + printf "SDK should contain libSystem{.dylib,.tbd}\n" 1>&2 + exit 1 fi local sys_root=$(readlink -f "$(dirname $sys_lib)/../..") @@ -96,18 +96,18 @@ function do_build { printf "int main(){return 0;}" | clang -xc -O2 -o "$target_dir"/bin/dsymutil - clang -O2 -std=c99 $alt_wrapper \ - -DTARGET_CPU=$(printf '"%s"' "$2") \ - -DNIX_APPLE_HDRS=$( - printf '"%s"' "-I$out/$sdk/usr/include" - ) \ - -DNIX_APPLE_FRAMEWORKS=$( - printf '"%s"' "$out/$sdk/System/Library/Frameworks" - ) \ - -DNIX_APPLE_PRIV_FRAMEWORKS=$( - printf '"%s"' "$out/$sdk/System/Library/PrivateFrameworks" - ) \ - -DOS_VER_MIN=$(printf '"%s"' "7.1") \ - -o "$target_dir/bin/$triple-clang" + -DTARGET_CPU=$(printf '"%s"' "$2") \ + -DNIX_APPLE_HDRS=$( + printf '"%s"' "-I$out/$sdk/usr/include" + ) \ + -DNIX_APPLE_FRAMEWORKS=$( + printf '"%s"' "$out/$sdk/System/Library/Frameworks" + ) \ + -DNIX_APPLE_PRIV_FRAMEWORKS=$( + printf '"%s"' "$out/$sdk/System/Library/PrivateFrameworks" + ) \ + -DOS_VER_MIN=$(printf '"%s"' "7.1") \ + -o "$target_dir/bin/$triple-clang" pushd "$target_dir"/bin &>/dev/null @@ -141,8 +141,8 @@ function do_build { local me=`whoami` for d in bin libexec SDK; do - chown -R $me:$me target/$d - cp -R target/$d $out + chown -R $me:$me target/$d + cp -R target/$d $out done # Crucial piece diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh index bdfd00009dc5d..ecf9793b91f6c 100644 --- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh +++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh @@ -1,16 +1,16 @@ findGdkPixbufLoaders() { - # choose the longest loaders.cache - local loadersCache="$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" - if [[ -f "$loadersCache" ]]; then - if [[ -f "${GDK_PIXBUF_MODULE_FILE-}" ]]; then - if (( "$(cat "$loadersCache" | wc -l)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" )); then - export GDK_PIXBUF_MODULE_FILE="$loadersCache" - fi - else - export GDK_PIXBUF_MODULE_FILE="$loadersCache" - fi - fi + # choose the longest loaders.cache + local loadersCache="$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" + if [[ -f "$loadersCache" ]]; then + if [[ -f "${GDK_PIXBUF_MODULE_FILE-}" ]]; then + if (( "$(cat "$loadersCache" | wc -l)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" )); then + export GDK_PIXBUF_MODULE_FILE="$loadersCache" + fi + else + export GDK_PIXBUF_MODULE_FILE="$loadersCache" + fi + fi } diff --git a/pkgs/development/libraries/physics/lhapdf/maintainer.sh b/pkgs/development/libraries/physics/lhapdf/maintainer.sh index 92c225f90ccdf..6e263dcebfde7 100755 --- a/pkgs/development/libraries/physics/lhapdf/maintainer.sh +++ b/pkgs/development/libraries/physics/lhapdf/maintainer.sh @@ -7,7 +7,7 @@ set -xe BASE_URL="https://lhapdfsets.web.cern.ch/lhapdfsets/current/" for pdf_set in `curl -L $BASE_URL 2>/dev/null | "$SED" -e "s/.*/dev/null | tr -d '\n' - echo "\";" + echo -n " \"${pdf_set%.tar.gz}\" = \"" + nix-prefetch-url "${BASE_URL}${pdf_set}" 2>/dev/null | tr -d '\n' + echo "\";" done diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh index 3c7e91e81886b..e820d80e7a4ea 100644 --- a/pkgs/development/libraries/slib/setup-hook.sh +++ b/pkgs/development/libraries/slib/setup-hook.sh @@ -1,12 +1,12 @@ addSlibPath () { if test -f "$1/lib/slib/slibcat" then - export SCHEME_LIBRARY_PATH="$1/lib/slib/" - echo "SLIB found in \`$1'; setting \$SCHEME_LIBRARY_PATH to \`$SCHEME_LIBRARY_PATH'" + export SCHEME_LIBRARY_PATH="$1/lib/slib/" + echo "SLIB found in \`$1'; setting \$SCHEME_LIBRARY_PATH to \`$SCHEME_LIBRARY_PATH'" - # This is needed so that `(load-from-path "slib/guile.init")' works. - export GUILE_LOAD_PATH="$1/lib:$GUILE_LOAD_PATH" - echo "SLIB: setting \$GUILE_LOAD_PATH to \`$GUILE_LOAD_PATH'" + # This is needed so that `(load-from-path "slib/guile.init")' works. + export GUILE_LOAD_PATH="$1/lib:$GUILE_LOAD_PATH" + echo "SLIB: setting \$GUILE_LOAD_PATH to \`$GUILE_LOAD_PATH'" fi } diff --git a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh index 828920c5acccc..d6fec46b449ea 100755 --- a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh +++ b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh @@ -18,59 +18,59 @@ fi export NIX_LISP NIX_LISP_LOAD_FILE NIX_LISP_EXEC_CODE NIX_LISP_COMMAND NIX_LISP_FINAL_PARAMETERS test -n "$NIX_LISP_LD_LIBRARY_PATH" && - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}$NIX_LISP_LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}$NIX_LISP_LD_LIBRARY_PATH" declare -a NIX_LISP_FINAL_PARAMETERS; case "$NIX_LISP" in - sbcl) - NIX_LISP_LOAD_FILE="--load" - NIX_LISP_EXEC_CODE="--eval" + sbcl) + NIX_LISP_LOAD_FILE="--load" + NIX_LISP_EXEC_CODE="--eval" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='--non-interactive' - NIX_LISP_FINAL_PARAMETERS= + NIX_LISP_FINAL_PARAMETERS= NIX_LISP_FASL_TYPE="fasl" - ;; - ecl) - NIX_LISP_LOAD_FILE="-load" - NIX_LISP_EXEC_CODE="-eval" + ;; + ecl) + NIX_LISP_LOAD_FILE="-load" + NIX_LISP_EXEC_CODE="-eval" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='--nodebug' - NIX_LISP_FINAL_PARAMETERS= + NIX_LISP_FINAL_PARAMETERS= NIX_LISP_FASL_TYPE="fas" - ;; - clisp) - NIX_LISP_LOAD_FILE="-c -l" - NIX_LISP_EXEC_CODE="-x" + ;; + clisp) + NIX_LISP_LOAD_FILE="-c -l" + NIX_LISP_EXEC_CODE="-x" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='-on-error exit' - NIX_LISP_FINAL_PARAMETERS="-repl" + NIX_LISP_FINAL_PARAMETERS="-repl" NIX_LISP_FASL_TYPE="fas" - ;; - lx86cl64) - NIX_LISP_LOAD_FILE="-l" - NIX_LISP_EXEC_CODE="-e" + ;; + lx86cl64) + NIX_LISP_LOAD_FILE="-l" + NIX_LISP_EXEC_CODE="-e" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='-b' - NIX_LISP_FINAL_PARAMETERS= + NIX_LISP_FINAL_PARAMETERS= NIX_LISP_FASL_TYPE="lx64fsl" - ;; - lx86cl) - NIX_LISP_LOAD_FILE="-l" - NIX_LISP_EXEC_CODE="-e" + ;; + lx86cl) + NIX_LISP_LOAD_FILE="-l" + NIX_LISP_EXEC_CODE="-e" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='-b' - NIX_LISP_FINAL_PARAMETERS= + NIX_LISP_FINAL_PARAMETERS= NIX_LISP_FASL_TYPE="lx32fsl" - ;; - abcl) - NIX_LISP_LOAD_FILE="--load" - NIX_LISP_EXEC_CODE="--eval" + ;; + abcl) + NIX_LISP_LOAD_FILE="--load" + NIX_LISP_EXEC_CODE="--eval" NIX_LISP_QUIT="(quit)" NIX_LISP_NODEBUG='' - NIX_LISP_FINAL_PARAMETERS= + NIX_LISP_FINAL_PARAMETERS= NIX_LISP_FASL_TYPE="abcl" - ;; + ;; esac NIX_LISP_ASDF_REGISTRY_CODE=" @@ -127,8 +127,8 @@ eval "$NIX_LISP_PRELAUNCH_HOOK" if [ -z "$NIX_LISP_SKIP_CODE" ]; then "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \ - $NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \ - $NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \ - ${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \ - "$@" + $NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \ + $NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \ + ${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \ + "$@" fi diff --git a/pkgs/development/lisp-modules/from-quicklisp/asdf-description.sh b/pkgs/development/lisp-modules/from-quicklisp/asdf-description.sh index 6c240d15c76e3..bdb5981bf4fb3 100755 --- a/pkgs/development/lisp-modules/from-quicklisp/asdf-description.sh +++ b/pkgs/development/lisp-modules/from-quicklisp/asdf-description.sh @@ -11,6 +11,6 @@ name="$1" sbcl --noinform --load "$NIX_QUICKLISP_DIR"/setup.lisp --eval "(ql:quickload :$name)" \ - --eval "(format t \"~a~%\" (or (asdf::system-description (asdf::find-system \"$name\")) \"\"))" \ - --eval '(quit)' --script | + --eval "(format t \"~a~%\" (or (asdf::system-description (asdf::find-system \"$name\")) \"\"))" \ + --eval '(quit)' --script | tee /dev/stderr | tail -n 1 diff --git a/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh b/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh index d2d846b78f2bb..f8bae8997272c 100755 --- a/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh +++ b/pkgs/development/lisp-modules/from-quicklisp/barebones-quicklisp-expression.sh @@ -122,8 +122,8 @@ url="${ql_src##* }" with (import {}); fetchdarcs { url=''$url''; - rev=''$version''; - sha256=''0000000000000000000000000000000000000000000000000000000000000000''; + rev=''$version''; + sha256=''0000000000000000000000000000000000000000000000000000000000000000''; }" | nix-instantiate - | tail -n 1 | xargs nix-store -r 2>&1 | tee /dev/stderr | grep 'instead has' | tail -n 1 | sed -e 's/.* instead has .//;s/[^0-9a-z].*//') @@ -149,7 +149,7 @@ url="${ql_src##* }" } if [ "$ql_src" = '{"error":"Not Found"}' ]; then - echo "# $name: not found" + echo "# $name: not found" else cat << EOF | grep -Ev '^[ ]+$' diff --git a/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh b/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh index 98c01508fd5a3..2e3509d68c12c 100755 --- a/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh @@ -3,13 +3,13 @@ source lib-cache.sh; print_reqs() { - module_name="$1"; + module_name="$1"; - ./requirements.sh "$1"| while read; do - if let "$(./source-download-link.sh "${REPLY}" | wc -c)" && [ perl != "$REPLY" ]; then - echo "$REPLY"; - fi; - done; + ./requirements.sh "$1"| while read; do + if let "$(./source-download-link.sh "${REPLY}" | wc -c)" && [ perl != "$REPLY" ]; then + echo "$REPLY"; + fi; + done; } module_name="$1"; diff --git a/pkgs/development/perl-modules/expression-generator/full-requirements.sh b/pkgs/development/perl-modules/expression-generator/full-requirements.sh index 29ed83668ed55..91218f36f609b 100755 --- a/pkgs/development/perl-modules/expression-generator/full-requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/full-requirements.sh @@ -3,19 +3,19 @@ source lib-cache.sh; print_requirements () { - module_name="$1"; + module_name="$1"; - ./requirements.sh "$module_name" | while read; do - echo "$REPLY"; - print_reqs_cache "$REPLY"; - done | sort | uniq + ./requirements.sh "$module_name" | while read; do + echo "$REPLY"; + print_reqs_cache "$REPLY"; + done | sort | uniq }; print_reqs_cache () { - module_name="$1"; - module_basename="${module_name//::/-}"; - - cached_output print_requirements "$module_basename" "$module_name" "full.deps"; + module_name="$1"; + module_basename="${module_name//::/-}"; + + cached_output print_requirements "$module_basename" "$module_name" "full.deps"; }; print_reqs_cache "$@"; diff --git a/pkgs/development/perl-modules/expression-generator/grab-url.sh b/pkgs/development/perl-modules/expression-generator/grab-url.sh index 809cf87fcebf1..8935cad8cefe3 100755 --- a/pkgs/development/perl-modules/expression-generator/grab-url.sh +++ b/pkgs/development/perl-modules/expression-generator/grab-url.sh @@ -3,13 +3,13 @@ source lib-cache.sh get_file() { - url="$1"; + url="$1"; - if [ -n "$url" ]; then - curl "$1"; - else - echo -n; - fi; + if [ -n "$url" ]; then + curl "$1"; + else + echo -n; + fi; } url="$1"; @@ -17,4 +17,3 @@ name="$2"; name=${name:-$(basename "$url")} cached_output get_file "${name%%.*}" "$url" "${name#*.}" - diff --git a/pkgs/development/perl-modules/expression-generator/lib-cache.sh b/pkgs/development/perl-modules/expression-generator/lib-cache.sh index 7473e2d1c15ed..65095144bcd68 100644 --- a/pkgs/development/perl-modules/expression-generator/lib-cache.sh +++ b/pkgs/development/perl-modules/expression-generator/lib-cache.sh @@ -4,16 +4,15 @@ # Third argument: argument to command # Fourth argument: cache type cached_output () { - cmd="$1"; - basename="$2"; - arg="$3"; - ext="$4"; - - if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then - mkdir -p "cache-${ext//./-}"; - $cmd $arg > "cache-${ext//./-}/${basename}.${ext}"; - fi; + cmd="$1"; + basename="$2"; + arg="$3"; + ext="$4"; - cat "cache-${ext//./-}/${basename}.${ext}"; -} + if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then + mkdir -p "cache-${ext//./-}"; + $cmd $arg > "cache-${ext//./-}/${basename}.${ext}"; + fi; + cat "cache-${ext//./-}/${basename}.${ext}"; +} diff --git a/pkgs/development/perl-modules/expression-generator/requirements.sh b/pkgs/development/perl-modules/expression-generator/requirements.sh index 60ee68d99adaf..19b24c55a8eed 100755 --- a/pkgs/development/perl-modules/expression-generator/requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/requirements.sh @@ -6,12 +6,12 @@ module_name="$1"; module_basename="${1//::/-}"; print_requirements () { - module_name="$1"; - - ./retrieve-meta-yaml.sh "$module_name" | - sed -re '1,/^requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; - ./retrieve-meta-yaml.sh "$module_name" | - sed -re '1,/^build_requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; + module_name="$1"; + + ./retrieve-meta-yaml.sh "$module_name" | + sed -re '1,/^requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; + ./retrieve-meta-yaml.sh "$module_name" | + sed -re '1,/^build_requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; }; cached_output print_requirements "$module_basename" "$module_name" "direct.deps"; diff --git a/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh b/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh index a9cf0d94e0d3f..c8ec5df11b7dd 100755 --- a/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh +++ b/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh @@ -6,9 +6,9 @@ file_name="$2"; version_regexp="${module_basename}(-[0-9.a-z]+){0,1}"; author_regexp="[A-Z0-9]+"; -./retrieve-modulepage.sh "$module_basename" | - egrep "[<]a href=\"[a-z0-9/]*/(${author_regexp}/){0,1}${version_regexp}/${file_name}" | - sed -re "s@.*href=\"@@; s@\".*@@" | - sed -re 's@^/@http://search.cpan.org/@'; +./retrieve-modulepage.sh "$module_basename" | + egrep "[<]a href=\"[a-z0-9/]*/(${author_regexp}/){0,1}${version_regexp}/${file_name}" | + sed -re "s@.*href=\"@@; s@\".*@@" | + sed -re 's@^/@http://search.cpan.org/@'; echo "$link_line"; diff --git a/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh b/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh index 2c85d45691f09..3b162ebe693fe 100755 --- a/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh +++ b/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh @@ -3,11 +3,11 @@ source lib-cache.sh; print_meta_yaml () { - module_name="$1"; - module_basename="${module_name//::/-}"; + module_name="$1"; + module_basename="${module_name//::/-}"; - ./grab-url.sh "$(./retrieve-file-link.sh "$module_basename" "META.yml")" \ - "${module_basename}.meta.yml"; + ./grab-url.sh "$(./retrieve-file-link.sh "$module_basename" "META.yml")" \ + "${module_basename}.meta.yml"; }; module_name="$1"; diff --git a/pkgs/development/perl-modules/expression-generator/source-download-link.sh b/pkgs/development/perl-modules/expression-generator/source-download-link.sh index 575f47629c26b..779d131961f07 100755 --- a/pkgs/development/perl-modules/expression-generator/source-download-link.sh +++ b/pkgs/development/perl-modules/expression-generator/source-download-link.sh @@ -6,12 +6,12 @@ module_name="$1"; module_basename="${module_name//::/-}"; write_link() { - module_basename="$1"; + module_basename="$1"; - ./retrieve-modulepage.sh "$module_basename" | - grep -A 2 "This Release" | - grep href | - sed -re 's/.*href="//; s/".*//; s@^/@http://search.cpan.org/@'; + ./retrieve-modulepage.sh "$module_basename" | + grep -A 2 "This Release" | + grep href | + sed -re 's/.*href="//; s/".*//; s@^/@http://search.cpan.org/@'; } cached_output write_link "$module_basename" "$module_basename" src.link; diff --git a/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh b/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh index cfe1506640b31..9f5cdb9142eb2 100755 --- a/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh +++ b/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh @@ -5,16 +5,16 @@ cd $(dirname $0); source lib-cache.sh; print_expression () { - 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 </dev/null); + + cat <> tup.config - case "$system" in - "i686-*") echo i386 >> tup.config;; - "x86_64-*") echo x86_64 >> tup.config;; - "powerpc-*") echo powerpc >> tup.config;; - "powerpc64-*") echo powerpc64 >> tup.config;; - "ia64-*") echo ia64 >> tup.config;; - "alpha-*") echo alpha >> tup.config;; - "sparc-*") echo sparc >> tup.config;; - "aarch64-*") echo arm64 >> tup.config;; - "arm*") echo arm >> tup.config;; - esac - - echo "${tupConfig-}" >> tup.config - - tup init - tup generate tupBuild.sh - - runHook postConfigure + runHook preConfigure + + echo -n CONFIG_TUP_ARCH= >> tup.config + case "$system" in + "i686-*") echo i386 >> tup.config;; + "x86_64-*") echo x86_64 >> tup.config;; + "powerpc-*") echo powerpc >> tup.config;; + "powerpc64-*") echo powerpc64 >> tup.config;; + "ia64-*") echo ia64 >> tup.config;; + "alpha-*") echo alpha >> tup.config;; + "sparc-*") echo sparc >> tup.config;; + "aarch64-*") echo arm64 >> tup.config;; + "arm*") echo arm >> tup.config;; + esac + + echo "${tupConfig-}" >> tup.config + + tup init + tup generate tupBuild.sh + + runHook postConfigure } if [ -z "${dontUseTupConfigure-}" -a -z "${configurePhase-}" ]; then @@ -30,13 +30,13 @@ fi tupBuildPhase() { - runHook preBuild + runHook preBuild - pushd . - . tupBuild.sh - popd + pushd . + . tupBuild.sh + popd - runHook postBuild + runHook postBuild } if [ -z "${dontUseTupBuild-}" -a -z "${buildPhase-}" ]; then -- cgit 1.4.1