Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { pkgs, pythonPackages }:
- with builtins;
- with pythonPackages;
- with { inherit (pkgs) lib; };
- let removeNulls = lib.filterAttrs (n: v: v != null);
- srcHelper = url: sha256: curlOpts: name:
- assert url != null;
- assert sha256 != null;
- pkgs.fetchurl (removeNulls { inherit url sha256 name curlOpts; });
- mkPython =
- { packageName # < A package name.
- , version # < A package version.
- , srcURL ? null # < A url to download from.
- , srcSHA ? null # < A SHA256 checksum for the download.
- , srcName ? null # < A name for the downloaded file.
- , srcCurlOpts ? null # < A curl options for the download.
- , src ? null # < A source to use (overrides other options).
- , buildDeps ? [] # < Build dependencies to add.
- , propDeps ? [] # < Propagated dependencies to add.
- , nativeBuildDeps ? [] # < Native build dependencies to add.
- , nativePropDeps ? [] # < Native propagated dependencies to add.
- # The following attributes are equivalent to those in meta:
- , homepage ? null # < A homepage of the project.
- , description ? null # < A description.
- , longDescription ? null # < A longer description.
- , maintainers ? null # < A list of maintainers.
- , license ? null # < A license.
- , platforms ? null # < A list of supported platforms.
- , ... # Any other options will be passed to buildPythonPackage directly
- } @ args:
- buildPythonPackage (removeNulls ({
- name = "${packageName}-${version}";
- src = if isNull src
- then srcHelper srcURL srcSHA srcCurlOpts srcName
- else src;
- buildInputs = buildDeps;
- propagatedBuildInputs = propDeps;
- nativeBuildInputs = nativeBuildDeps;
- propagatedNativeBuildInputs = nativePropDeps;
- meta = removeNulls {
- inherit homepage description longDescription
- license maintainers platforms;
- };
- } // args));
- isNonEmptyString = x: stringLength x > 0;
- strHead = x: (assert isNonEmptyString x; substring 0 1 x);
- pypiURL = name: version:
- assert isNonEmptyString name;
- assert isNonEmptyString version;
- "mirror://pypi/${strHead name}/${name}/${name}-${version}.tar.gz";
- in pythonPackages // (rec {
- # bobbuilder = pkgs.callPackage ./bobbuilder {};
- # No longer used, Theano was finally added to nix main channel
- # theano-deep = mkPython (rec {
- # packageName = "theano-deep";
- # version = "0.8.2";
- # srcURL = pypiURL "Theano" version;
- # srcSHA = "0c49mz3bg57vigkyfz3yd6302587hsikhvgkh7w7ny0sxpvwhqvl";
- # propDeps = with pkgs; [ six scipy ];
- # homepage = http://deeplearning.net/software/theano/;
- # description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs.";
- # license = null;#lib.licenses.bsd;
- # maintainers = null;
- # platforms = with lib.platforms; all;
- #
- # });
- panda3d = mkPython (rec {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement