[Nix-dev] mix bundlerEnv and python3.buildEnv
Maksim Bronsky
mb at flyingcircus.io
Fri May 6 12:17:05 CEST 2016
Hi,
just as a follow-up how I solved it:
I changed the postPatch hook to explicitly substitute the shebang with the version I included as a buildInput:
sensu-plugins-mongodb = attrs: {
buildInputs = [ pyenv ];
postPatch = ''
# the ruby check runs a python script
# patchShebangs bin/check-mongodb.py
substituteInPlace bin/check-mongodb.py \
--replace "#!/usr/bin/env python" "#!${pyenv}/bin/python"
'';
};
--
Maksim Bronsky · mb at flyingcircus.io · +49 345 219401-22
Flying Circus Internet Operations GmbH · http://flyingcircus.io
Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
HR Stendal HRB 21169 · Geschäftsführer: Christian Theune, Christian Zagrodnick
> On 05 May 2016, at 14:57, zimbatm <zimbatm at zimbatm.com> wrote:
>
> Or if the dependency is a runtime dependency then maybe create another pkgs.buildEnv that merges both environments.
>
> On Thu, 5 May 2016 at 00:25 Rok Garbas <rok at garbas.si <mailto:rok at garbas.si>> wrote:
> Hi Maxim,
>
> i think you will have to adjust ``bundlerEnv`` to be able to "merge"
> it with ``pythonPackages.buildEnv``. or write your own custom buildEnv
> based on both bundlerEnv and pythonPackages.buildEnv.
>
>
> On Tue, May 3, 2016 at 8:42 PM, Maksim Bronsky <mb at flyingcircus.io <mailto:mb at flyingcircus.io>> wrote:
> > Hello list,
> >
> > this is my hello world :)
> >
> > I am adding some monitor checks to sensu, most of them are in ruby, but some are in other, ‘foreign’ languages like the check for mongodb I am interested in. Adding a python3.buildEnv to bundlerEnv drives me crazy.
> >
> > In [1] you see the whole nix-expression.
> >
> > In the upper part I define a wrapped python env like so:
> >
> > let
> > pyenv = python3.buildEnv.override {
> > extraLibs = with pkgs.python3Packages;
> > [ pymongo ];
> > } ;
> > in
> >
> > to inject in the bundlerEnv function, where I extend the defaultGemConfig with some none default values [2]. Unfortunately
> >
> > sensu-plugins-mongodb = attrs: {
> > buildInputs = [ pyenv ];
> > postPatch = ''
> > # the ruby check runs a python script
> > patchShebangs bin/check-mongodb.py
> > '';
> > };
> >
> > doesn’t seem to work at all, and I have no idea why this is the case, nor how to debug it. :(
> > Not working means, bin/check-mongodb.py isn’t patched and I am not sure whether python is in $PATH or not.
> >
> >
> >
> > [1] https://github.com/flyingcircusio/nixpkgs/blob/37b78557564f55454ceaae38883cf6d3dc41d6fb/nixos/modules/flyingcircus/packages/sensu/default.nix <https://github.com/flyingcircusio/nixpkgs/blob/37b78557564f55454ceaae38883cf6d3dc41d6fb/nixos/modules/flyingcircus/packages/sensu/default.nix>
> > [2] https://github.com/flyingcircusio/nixpkgs/blob/37b78557564f55454ceaae38883cf6d3dc41d6fb/nixos/modules/flyingcircus/packages/sensu/gemset.nix <https://github.com/flyingcircusio/nixpkgs/blob/37b78557564f55454ceaae38883cf6d3dc41d6fb/nixos/modules/flyingcircus/packages/sensu/gemset.nix>
> >
> >
> >
> >
> >
> > --
> > Maksim Bronsky · mb at flyingcircus.io <mailto:mb at flyingcircus.io> · +49 345 219401-22
> > Flying Circus Internet Operations GmbH · http://flyingcircus.io <http://flyingcircus.io/>
> > Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
> > HR Stendal HRB 21169 · Geschäftsführer: Christian Theune, Christian Zagrodnick
> >
> >
> >
> >
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl <mailto:nix-dev at lists.science.uu.nl>
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev <http://lists.science.uu.nl/mailman/listinfo/nix-dev>
> >
>
>
>
> --
> Rok Garbas
> http://www.garbas.si <http://www.garbas.si/>
> rok at garbas.si <mailto:rok at garbas.si>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl <mailto:nix-dev at lists.science.uu.nl>
> http://lists.science.uu.nl/mailman/listinfo/nix-dev <http://lists.science.uu.nl/mailman/listinfo/nix-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160506/ac1afd7f/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160506/ac1afd7f/attachment.bin
More information about the nix-dev
mailing list