[Nix-dev] post-install support - how to pass chmod ?

Marc Weber marco-oweber at gmx.de
Sat Jul 21 02:14:53 CEST 2007


============= added in builder.pl line 161 ===========================
  # running post-installers (TODO: only run files beeing executable? )
  my @executables  = ();
  foreach my $p (@paths) {
      @executables = (@executables, glob("$p/nix-support2/post-install/*"));
  }
  my $count=$#executables+1; # TODO there must be a better way to do this 
  print STDERR "executing $count post-installers\n";
  #print Dumper(@executables);
  # add ENV vars TODO (clean it as well?)
  $ENV{'nixProfile'} = $out;
  system($_) foreach @executables;
  print STDERR "done executing post-installers";
=============  =======================================================

seems to work fine.
At least I can execute ghci-wrapper now and it finds the installed
library.

============= post install script for ghc ============================
  GHC_PACKAGE_PATH=''
  ghcVersion=${ghc##*-}

  ghc="GHC_TO_BE_REPLACED_WHEN_INSTALLING";
  for f in $nixProfile/nix-support/ghc-pkgs/${ghc##*/}/*-ghc-pkg-dep; do
    GHC_PACKAGE_PATH="${GHC_PACKAGE_PATH}:$f";
  done
  GHC_PACKAGE_PATH=${GHC_PACKAGE_PATH/:/}

  for name in ghc ghci; do
    file=$nixProfile/bin/$name-wrapper-$ghcVersion
    echo " #!/bin/sh
    exec GHC_PACKAGE_PATH=$GHC_PACKAGE_PATH $ghc/bin/$name \"\$*\" " > $file
    # TODO: don't use the chmod of the hosting OS! (Don't know yet how to pass the coreutils package)
    /bin/chmod +x $file; 
  done
=============  =======================================================

note the TODO, which is the best way to pass the chmod of the nix store?
Can you also have a look at the line
  $ENV{'nixProfile'} = $out;
?
Is there more work todo when passing the environment?

I'll continue preparing my nix patch and I'll try adding more packages.

Marc Weber



More information about the nix-dev mailing list