Update 02

[?]
Mar 21, 2023, 12:59 PM
OB2MOPJ6NQDCF2OLLNHUR2JC4NQFNSNBRVFQJSF2USEI7ZMEX7HAC

Dependencies

Change contents

  • edit in 02-nix-build/flake.nix at line 27
    [2.294]
    [2.294]
    # Note: If we were using Make/CMake/autoconf, the mkDerivation function
    # could handle those automatically.
  • replacement in 02-nix-build/demo.sh at line 2
    [3.4131][3.4131:4159]()
    # shellcheck disable=SC2288
    [3.4131]
    [3.4159]
    # shellcheck disable=SC1010,SC2288
  • edit in 02-nix-build/demo.sh at line 42
    [2.792]
    h We can also just run the executable directly
    x nix run "$(dirname "${BASH_SOURCE[0]}")"
    h If we want to do development, we also get that \'for free\':
    f type gcc
    x nix develop --command "$(dirname "${BASH_SOURCE[0]}")/demo-inside-nix-develop.sh"
  • file addition: demo-inside-nix-develop.sh (---r------)
    [3.2636]
    #!/usr/bin/env bash
    # shellcheck disable=SC1010
    set -Eeuo pipefail
    source "$(dirname "${BASH_SOURCE[0]}")/../bash/libdemo.sh"
    h Now we do have gcc!
    x type gcc
    h But Nix does all sorts of clever things such as wrapping the compiler
    x file "$(command -v gcc)"
    h So that required libraries etc. are available
    # shellcheck disable=SC2016
    x eval 'echo "${NIX_LDFLAGS}"' \| grep -o --color=never -e \'\[^ \]*curl\[^ \]*\'
    h And we can in fact do
    x gcc -o "$(dirname "${BASH_SOURCE[0]}")/wttr-delft" -lcurl "$(dirname "${BASH_SOURCE[0]}")/../src/simple.c"
    x ./wttr-delft
  • edit in .gitignore at line 2
    [2.805]
    02-nix-build/wttr-delft