[Nix-dev] newbie question nix private package

Danylo Hlynskyi abcz2.uprola at gmail.com
Thu Feb 23 23:56:18 CET 2017


self = {

        tango = callPackage ./development/libraries/tango {};

        pytango = pythonPackages.pytango {};
   };


Key insight here is: pythonPackages.pytango is a derivation, not a function.

2017-02-23 15:49 GMT+02:00 Sébastien Petitdemange <
sebastien.petitdemange at esrf.fr>:

> Hello,
>
> I tried to create a set of private nix packages following this example
> (https://gist.github.com/benley/4d7f01805e60b39c2556).
>
> Unfortunately, when I try to build the only package I have, nix build
> give me an error:
>
>  nix-build  --show-trace ~/local/bcupkgs -A pytango
> error: attempt to call something which is not a function but a set, at
> ~/local/bcupkgs/default.nix:21:12
>
> I pretty sure that I wrote something stupid but I can find where.
>
> Is there someone who can help me with this?
>
> Kinds regards,
>
> SEB
>
>
> My private packages look like this:
>
>
> ├── default.nix
> ├── development
> │   └── python-modules
> │       └── pytango
> │           ├── default.nix
> │           └── setup.patch
> └── python_packages.nix
>
>
> with default.nix:
>
> { system ? builtins.currentSystem}:
>
> let
>    pkgs = import <nixpkgs> { inherit system; };
>    callPackage = pkgs.lib.callPackageWith (pkgs // self);
>
>    python27Packages = pkgs.recurseIntoAttrs (
>       callPackage ./python_packages.nix {
>         python = pkgs.python27;
>         self = combinedPython27Packages;
>       });
>
>    pythonPackages = python27Packages;
>
>    combinedPython27Packages = pkgs.python27Packages // python27Packages;
>
>     self = {
>
>         tango = callPackage ./development/libraries/tango {};
>
>         pytango = pythonPackages.pytango {};
>    };
>    in self
>
>
> with pytango/default.nix
>
> { stdenv, fetchurl, pkgconfig, python, buildPythonPackage, boost, numpy,
> omniorb, zeromq }:
>
> let version = "9.2.0b"; in
>
> buildPythonPackage rec {
>   name = "pytango-${version}";
>
>   src = fetchurl {
>     url = "https://github.com/tango-cs/pytango/archive/v${version}.tar.gz
> ";
>     sha256 = "01wnb9bxszw2pr7jcxcbjdds4y4w7q8cx8ibj73lj6dbjl3ai116";
>   };
>
>   BOOST_ROOT = "";
>
>   patches = [
>       ./setup.patch
>   ];
>
>   buildInputs = [ pkgconfig boost python omniorb zeromq ];
>
>   propagatedBuildInputs = [ numpy ];
>
>   buildFlags = "BOOST_LIB=boost_python";
>
>   #postInstall = ''
>   #    patchelf --set-rpath "${zeromq}/lib:${omniorb}/lib:$(patchelf
> --print-rpath $out/lib/python2.7/site-packages/PyTango/_PyTango.so)"
> $out/lib/python2.7/site-packages/PyTango/_PyTango.so
>   #'';
>
>   meta = with stdenv.lib; {
>     description = "Python bindings for Tango Control System";
>     homepage =
> http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/
> pytango/latest/index.html;
>     license = licenses.lgpl3;
>     maintainers = [ ];
>     platforms = platforms.linux;
>   };
> }
>
> and with the python_packages.nix:
>
> { pkgs, stdenv, python, python27Packages, self }:
>
> with pkgs.lib;
> with {
>      inherit (python27Packages) isPyPy isPy33;
> };
>
> let
>     buildPythonPackage = python27Packages.buildPythonPackage;
>     callPackage = pkgs.lib.callPackageWith (pkgs // self);
>
> in rec {
>     modules = python.modules;
>
>     setupPyBaseBuildFlags = ["--build-base=$out"];
>
>
>     pytango = callPackage ./development/python-modules/pytango { };
> }
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> 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/20170224/79cc143d/attachment-0001.html>


More information about the nix-dev mailing list