forked from python-acoustics/python-acoustics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
73 lines (63 loc) · 1.44 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Nix function for building this package
# To always get the latest version you could use
#
# acoustics = (import fetchTarball {
# url = https://github.com/python-acoustics/python-acoustics/archive/master.tar.gz;
# });
#
# Note that the above should still be called, with the following arguments.
{ lib
, buildPythonPackage
, pytest
, cytoolz
, numpy
, scipy
, matplotlib
, pandas
, six
, tabulate
, glibcLocales
, pylint
, yapf
, sphinx
, bootstrapped-pip
, stdenv
, python
, ensureNewerSourcesForZipFilesHook
, development ? false
}:
let
sdist = stdenv.mkDerivation {
name = "acoustics-sdist";
src = ./.;
nativeBuildInputs = [
python
bootstrapped-pip
# Ensure files are after 1980 so users not using
# Nix and buildPythonPackage can built a wheel as well.
ensureNewerSourcesForZipFilesHook
];
buildPhase = ":";
installPhase = ''
${python.interpreter} setup.py sdist
mkdir -p $out
cp dist/* $out/
'';
};
in buildPythonPackage rec {
pname = "acoustics";
version = "0.2.4.post0";
src = "${sdist}/${pname}*";
checkInputs = [ pytest glibcLocales ];
nativeBuildInputs = lib.optionals development [ sphinx pylint yapf ];
propagatedBuildInputs = [ cytoolz numpy scipy matplotlib pandas six tabulate ];
meta = {
description = "Acoustics module for Python";
};
checkPhase = ''
pushd tests
LC_ALL="en_US.UTF-8" py.test .
popd
'';
passthru.sdist = sdist;
}