Merge remote-tracking branch 'upstream/master' into HEAD
This commit is contained in:
commit
b2608b8910
45 changed files with 1105 additions and 303 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -3,7 +3,7 @@
|
|||
|
||||
###### Things done
|
||||
|
||||
Please check what applies. Note that these are not hard requirements but mereley serve as information for reviewers.
|
||||
Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
|
||||
|
||||
- [ ] Tested using sandboxing
|
||||
([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS,
|
||||
|
|
|
@ -41,7 +41,29 @@ bundlerEnv rec {
|
|||
<para>Please check in the <filename>Gemfile</filename>, <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so future updates can be run easily.
|
||||
</para>
|
||||
|
||||
<para>Resulting derivations also have two helpful items, <literal>env</literal> and <literal>wrapper</literal>. The first one allows one to quickly drop into
|
||||
<para>For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. <command>rake</command> at the command line, there is an alternative builder called <literal>bundlerApp</literal>. Set up the <filename>gemset.nix</filename> the same way, and then, for example:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<![CDATA[{ lib, bundlerApp }:
|
||||
|
||||
bundlerApp {
|
||||
pname = "corundum";
|
||||
gemdir = ./.;
|
||||
exes = [ "corundum-skel" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool and libraries for maintaining Ruby gems.";
|
||||
homepage = https://github.com/nyarly/corundum;
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.nyarly ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}]]>
|
||||
|
||||
<para>The chief advantage of <literal>bundlerApp</literal> over <literal>bundlerEnv</literal> is the executables introduced in the environment are precisely those selected in the <literal>exes</literal> list, as opposed to <literal>bundlerEnv</literal> which adds all the executables made available by gems in the gemset, which can mean e.g. <command>rspec</command> or <command>rake</command> in unpredictable versions available from various packages.
|
||||
|
||||
<para>Resulting derivations for both builders also have two helpful attributes, <literal>env</literal> and <literal>wrapper</literal>. The first one allows one to quickly drop into
|
||||
<command>nix-shell</command> with the specified environment present. E.g. <command>nix-shell -A sensu.env</command> would give you an environment with Ruby preset
|
||||
so it has all the libraries necessary for <literal>sensu</literal> in its paths. The second one can be used to make derivations from custom Ruby scripts which have
|
||||
<filename>Gemfile</filename>s with their dependencies specified. It is a derivation with <command>ruby</command> wrapped so it can find all the needed dependencies.
|
||||
|
@ -74,4 +96,3 @@ in stdenv.mkDerivation {
|
|||
</programlisting>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
|
@ -407,6 +407,7 @@
|
|||
np = "Nicolas Pouillard <np.nix@nicolaspouillard.fr>";
|
||||
nslqqq = "Nikita Mikhailov <nslqqq@gmail.com>";
|
||||
nthorne = "Niklas Thörne <notrupertthorne@gmail.com>";
|
||||
nyarly = "Judson Lester <nyarly@gmail.com>";
|
||||
obadz = "obadz <obadz-nixos@obadz.com>";
|
||||
ocharles = "Oliver Charles <ollie@ocharles.org.uk>";
|
||||
odi = "Oliver Dunkl <oliver.dunkl@gmail.com>";
|
||||
|
|
|
@ -543,6 +543,10 @@ rec {
|
|||
|
||||
# Cavium ThunderX stuff.
|
||||
PCI_HOST_THUNDER_ECAM y
|
||||
|
||||
# The default (=y) forces us to have the XHCI firmware available in initrd,
|
||||
# which our initrd builder can't currently do easily.
|
||||
USB_XHCI_TEGRA m
|
||||
'';
|
||||
uboot = null;
|
||||
kernelTarget = "Image";
|
||||
|
|
|
@ -15,9 +15,12 @@ let
|
|||
election-port=${toString cfg.zkElectionPort}
|
||||
cleanup-period-ms=${toString cfg.zkCleanupPeriod}
|
||||
servers-spec=${concatStringsSep "," cfg.zkServersSpec}
|
||||
auto-manage-instances=${lib.boolToString cfg.autoManageInstances}
|
||||
auto-manage-instances=${toString cfg.autoManageInstances}
|
||||
${cfg.extraConf}
|
||||
'';
|
||||
# NB: toString rather than lib.boolToString on cfg.autoManageInstances is intended.
|
||||
# Exhibitor tests if it's an integer not equal to 0, so the empty string (toString false)
|
||||
# will operate in the same fashion as a 0.
|
||||
configDir = pkgs.writeTextDir "exhibitor.properties" exhibitorConfig;
|
||||
cliOptionsCommon = {
|
||||
configtype = cfg.configType;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
with stdenv.lib;
|
||||
|
||||
let
|
||||
version = "1.30.1";
|
||||
version = "1.31";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -11,11 +11,11 @@ stdenv.mkDerivation rec {
|
|||
|
||||
src = fetchurl {
|
||||
url = "http://download.geany.org/${name}.tar.bz2";
|
||||
sha256 = "0ac360f1f3d6c28790a81d570252a7d40421f6e1d8e5a8d653756bd041d88491";
|
||||
sha256 = "30fdb906bb76c4251a8bcf83ee267db28c26ef6ab867668a782cec1164a3aba5";
|
||||
};
|
||||
|
||||
NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
|
||||
|
||||
|
||||
nativeBuildInputs = [ pkgconfig intltool ];
|
||||
buildInputs = [ gtk2 which file ];
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@ let
|
|||
pythonPackages = python27Packages;
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "freecad-${version}";
|
||||
version = "0.16";
|
||||
version = "0.16.6712";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/FreeCAD/FreeCAD/archive/${version}.tar.gz";
|
||||
sha256 = "02cfw5wlb04j0ymhk4skrm7rvbz13hpv995asf9v8q6wn2s1mivc";
|
||||
sha256 = "14hs26gvv7gbg9misxq34v4nrds2sbxjhj4yyw5kq3zbvl517alp";
|
||||
};
|
||||
|
||||
buildInputs = with pythonPackages; [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
|
||||
|
|
|
@ -4,13 +4,13 @@ with stdenv.lib;
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "nnn-${version}";
|
||||
version = "1.2";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jarun";
|
||||
repo = "nnn";
|
||||
rev = "v${version}";
|
||||
sha256 = "1idrwm02218q7qd2pg2m8ld76bg32wbzl8y1h8ch7gzxihgn4559";
|
||||
sha256 = "0w9i9vwyqgsi64b5mk4rhmr5gvnnb24c98321r0j5hb0ghdcp96s";
|
||||
};
|
||||
|
||||
configFile = optionalString (conf!=null) (builtins.toFile "config.def.h" conf);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
buildGoPackage rec {
|
||||
name = "nomad-${version}";
|
||||
version = "0.5.6";
|
||||
version = "0.6.0";
|
||||
rev = "v${version}";
|
||||
|
||||
goPackagePath = "github.com/hashicorp/nomad";
|
||||
|
@ -12,7 +12,7 @@ buildGoPackage rec {
|
|||
owner = "hashicorp";
|
||||
repo = "nomad";
|
||||
inherit rev;
|
||||
sha256 = "1ivxsrg8s5fcyhngf8wlrqw6j7s2iggbf9xkr8jnd80cxbcpnksl";
|
||||
sha256 = "1qvpcf2hwrx280qk8gl7sfl23y44k8z7c2vwi0gnzx8vqh0l8ywm";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
|
@ -12,7 +12,7 @@ let
|
|||
stage1Dir = "lib/rkt/stage1-images";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "1.27.0";
|
||||
version = "1.28.0";
|
||||
name = "rkt-${version}";
|
||||
BUILDDIR="build-${name}";
|
||||
|
||||
|
@ -20,7 +20,7 @@ in stdenv.mkDerivation rec {
|
|||
owner = "coreos";
|
||||
repo = "rkt";
|
||||
rev = "v${version}";
|
||||
sha256 = "153nkl4mp2p0llv4bpdhdd6127qyaz27jsnxmjgvxhaia0ab79v2";
|
||||
sha256 = "08bzi44rs4g8cxb44pxh7ln85zhkhmi40r8mb73kibnnzd008vg3";
|
||||
};
|
||||
|
||||
stage1BaseImage = fetchurl {
|
||||
|
|
|
@ -111,6 +111,4 @@ rec {
|
|||
overrideSrc = drv: { src, version ? drv.version }:
|
||||
overrideCabal drv (_: { inherit src version; editedCabalFile = null; });
|
||||
|
||||
hasNoDataOutput = drv: overrideCabal drv (drv: { hasDataDir = false; });
|
||||
hasNoDocOutput = drv: overrideCabal drv (drv: { hasDocDir = false; });
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "frei0r-plugins-${version}";
|
||||
version = "1.4";
|
||||
version = "1.6.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://files.dyne.org/frei0r/releases/${name}.tar.gz";
|
||||
sha256 = "0mxyhdp1p1a3ga8170ijygb870zwbww1dgp3kdr1nd4zvsmzqw44";
|
||||
sha256 = "0pji26fpd0dqrx1akyhqi6729s394irl73dacnyxk58ijqq4dhp0";
|
||||
};
|
||||
|
||||
buildInputs = [ autoconf cairo opencv pkgconfig ];
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
, "coffee-script"
|
||||
, "cordova"
|
||||
, "csslint"
|
||||
, "dhcp"
|
||||
, "dnschain"
|
||||
, "docker-registry-server"
|
||||
, "elasticdump"
|
||||
|
|
|
@ -22688,6 +22688,25 @@ in
|
|||
};
|
||||
production = true;
|
||||
};
|
||||
dhcp = nodeEnv.buildNodePackage {
|
||||
name = "dhcp";
|
||||
packageName = "dhcp";
|
||||
version = "0.2.9";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/dhcp/-/dhcp-0.2.9.tgz";
|
||||
sha1 = "204208be1cef2788d528744fb263f60a528363a2";
|
||||
};
|
||||
dependencies = [
|
||||
sources."minimist-1.2.0"
|
||||
];
|
||||
buildInputs = globalBuildInputs;
|
||||
meta = {
|
||||
description = "A DHCP server written in JavaScript";
|
||||
homepage = https://github.com/infusion/node-dhcp;
|
||||
license = "MIT OR GPL-2.0";
|
||||
};
|
||||
production = true;
|
||||
};
|
||||
dnschain = nodeEnv.buildNodePackage {
|
||||
name = "dnschain";
|
||||
packageName = "dnschain";
|
||||
|
|
57
pkgs/development/python-modules/Cython/default.nix
Normal file
57
pkgs/development/python-modules/Cython/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, isPy3k
|
||||
, python
|
||||
, glibcLocales
|
||||
, pkgconfig
|
||||
, gdb
|
||||
, numpy
|
||||
, ncurses
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "Cython";
|
||||
name = "${pname}-${version}";
|
||||
version = "0.25.2";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "01h3lrf6d98j07iakifi81qjszh6faa37ibx7ylva1vsqbwx2hgi";
|
||||
};
|
||||
|
||||
# With Python 2.x on i686-linux or 32-bit ARM this test fails because the
|
||||
# result is "3L" instead of "3", so let's fix it in-place.
|
||||
#
|
||||
# Upstream issue: https://github.com/cython/cython/issues/1548
|
||||
postPatch = lib.optionalString ((stdenv.isi686 || stdenv.isArm) && !isPy3k) ''
|
||||
sed -i -e 's/\(>>> *\)\(verify_resolution_GH1533()\)/\1int(\2)/' \
|
||||
tests/run/cpdef_enums.pyx
|
||||
'';
|
||||
|
||||
buildInputs = [ glibcLocales pkgconfig gdb ];
|
||||
# For testing
|
||||
nativeBuildInputs = [ numpy ncurses ];
|
||||
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
|
||||
# cython's testsuite is not working very well with libc++
|
||||
# We are however optimistic about things outside of testsuite still working
|
||||
checkPhase = ''
|
||||
export HOME="$NIX_BUILD_TOP"
|
||||
${python.interpreter} runtests.py \
|
||||
${if stdenv.cc.isClang or false then ''--exclude="(cpdef_extern_func|libcpp_algo)"'' else ""}
|
||||
'';
|
||||
|
||||
# Disable tests temporarily
|
||||
# https://github.com/cython/cython/issues/1676
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "An optimising static compiler for both the Python programming language and the extended Cython programming language";
|
||||
homepage = http://cython.org;
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ fridh ];
|
||||
};
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi }:
|
||||
{ stdenv, buildPythonPackage, fetchurl }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "amqplib";
|
||||
version = "0.6.1";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0f2618b74d95cd360a6d46a309a3fb1c37d881a237e269ac195a69a34e0e2f62";
|
||||
src = fetchurl {
|
||||
url = https://github.com/barryp/py-amqplib/archive/0.6.1.tar.gz;
|
||||
sha256 = "04nsn68wz9m24rvbssirkyighazbn20j60wjmi0r7jcpcf00sb3s";
|
||||
};
|
||||
|
||||
# error: invalid command 'test'
|
||||
|
|
75
pkgs/development/python-modules/blaze/default.nix
Normal file
75
pkgs/development/python-modules/blaze/default.nix
Normal file
|
@ -0,0 +1,75 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchurl
|
||||
, pytest
|
||||
, contextlib2
|
||||
, cytoolz
|
||||
, dask
|
||||
, datashape
|
||||
, flask
|
||||
, flask-cors
|
||||
, h5py
|
||||
, multipledispatch
|
||||
, numba
|
||||
, numpy
|
||||
, odo
|
||||
, pandas
|
||||
, psutil
|
||||
, pymongo
|
||||
, pyyaml
|
||||
, requests
|
||||
, sqlalchemy
|
||||
, tables
|
||||
, toolz
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "blaze";
|
||||
version = "0.11.0";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/blaze/blaze/archive/${version}.tar.gz";
|
||||
sha256 = "07zrrxkmdqk84xvdmp29859zcfzlpx5pz6g62l28nqp6n6a7yq9a";
|
||||
};
|
||||
|
||||
checkInputs = [ pytest ];
|
||||
propagatedBuildInputs = [
|
||||
contextlib2
|
||||
cytoolz
|
||||
dask
|
||||
datashape
|
||||
flask
|
||||
flask-cors
|
||||
h5py
|
||||
multipledispatch
|
||||
numba
|
||||
numpy
|
||||
odo
|
||||
pandas
|
||||
psutil
|
||||
pymongo
|
||||
pyyaml
|
||||
requests
|
||||
sqlalchemy
|
||||
tables
|
||||
toolz
|
||||
];
|
||||
|
||||
# Failing test
|
||||
# ERROR collecting blaze/tests/test_interactive.py
|
||||
# E networkx.exception.NetworkXNoPath: node <class 'list'> not
|
||||
# reachable from <class 'dask.array.core.Array'>
|
||||
doCheck = false;
|
||||
|
||||
checkPhase = ''
|
||||
py.test blaze/tests
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/ContinuumIO/blaze;
|
||||
description = "Allows Python users a familiar interface to query data living in other data storage systems";
|
||||
license = lib.licenses.bsdOriginal;
|
||||
maintainers = with lib.maintainers; [ fridh ];
|
||||
};
|
||||
}
|
37
pkgs/development/python-modules/cycler/default.nix
Normal file
37
pkgs/development/python-modules/cycler/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, coverage
|
||||
, nose
|
||||
, six
|
||||
, python
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "cycler";
|
||||
name = "${pname}-${version}";
|
||||
version = "0.10.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8";
|
||||
};
|
||||
|
||||
checkInputs = [ coverage nose ];
|
||||
propagatedBuildInputs = [ six ];
|
||||
|
||||
checkPhase = ''
|
||||
${python.interpreter} run_tests.py
|
||||
'';
|
||||
|
||||
# Tests were not included in release.
|
||||
# https://github.com/matplotlib/cycler/issues/31
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Composable style cycles";
|
||||
homepage = http://github.com/matplotlib/cycler;
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ fridh ];
|
||||
};
|
||||
}
|
34
pkgs/development/python-modules/sounddevice/default.nix
Normal file
34
pkgs/development/python-modules/sounddevice/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, cffi
|
||||
, numpy
|
||||
, portaudio
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "sounddevice";
|
||||
name = "${pname}-${version}";
|
||||
version = "0.3.8";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "dc5ec8534c3831ab133c497721f3aaeed4f5084b0eda842f0c0ada09f2f066dc";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ cffi numpy portaudio ];
|
||||
|
||||
# No tests included nor upstream available.
|
||||
doCheck = false;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace sounddevice.py --replace "'portaudio'" "'${portaudio}/lib/libportaudio.so.2'"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Play and Record Sound with Python";
|
||||
homepage = http://python-sounddevice.rtfd.org/;
|
||||
license = with lib.licenses; [ mit ];
|
||||
maintainers = with lib.maintainers; [ fridh ];
|
||||
};
|
||||
}
|
156
pkgs/development/ruby-modules/bundled-common/default.nix
Normal file
156
pkgs/development/ruby-modules/bundled-common/default.nix
Normal file
|
@ -0,0 +1,156 @@
|
|||
{ stdenv, runCommand, ruby, lib
|
||||
, defaultGemConfig, buildRubyGem, buildEnv
|
||||
, makeWrapper
|
||||
, bundler
|
||||
}@defs:
|
||||
|
||||
{
|
||||
name ? null
|
||||
, pname ? null
|
||||
, mainGemName ? null
|
||||
, gemdir ? null
|
||||
, gemfile ? null
|
||||
, lockfile ? null
|
||||
, gemset ? null
|
||||
, ruby ? defs.ruby
|
||||
, gemConfig ? defaultGemConfig
|
||||
, postBuild ? null
|
||||
, document ? []
|
||||
, meta ? {}
|
||||
, groups ? ["default"]
|
||||
, ignoreCollisions ? false
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
assert name == null -> pname != null;
|
||||
|
||||
with import ./functions.nix { inherit lib gemConfig; };
|
||||
|
||||
let
|
||||
gemFiles = bundlerFiles args;
|
||||
|
||||
importedGemset = import gemFiles.gemset;
|
||||
|
||||
filteredGemset = filterGemset { inherit ruby groups; } importedGemset;
|
||||
|
||||
configuredGemset = lib.flip lib.mapAttrs filteredGemset (name: attrs:
|
||||
applyGemConfigs (attrs // { inherit ruby; gemName = name; })
|
||||
);
|
||||
|
||||
hasBundler = builtins.hasAttr "bundler" filteredGemset;
|
||||
|
||||
bundler =
|
||||
if hasBundler then gems.bundler
|
||||
else defs.bundler.override (attrs: { inherit ruby; });
|
||||
|
||||
gems = lib.flip lib.mapAttrs configuredGemset (name: attrs: buildGem name attrs);
|
||||
|
||||
name' = if name != null then
|
||||
name
|
||||
else
|
||||
let
|
||||
gem = gems."${pname}";
|
||||
version = gem.version;
|
||||
in
|
||||
"${pname}-${version}";
|
||||
|
||||
pname' = if pname != null then
|
||||
pname
|
||||
else
|
||||
name;
|
||||
|
||||
copyIfBundledByPath = { bundledByPath ? false, ...}@main:
|
||||
(if bundledByPath then
|
||||
assert gemFiles.gemdir != null; "cp -a ${gemFiles.gemdir}/* $out/"
|
||||
else ""
|
||||
);
|
||||
|
||||
maybeCopyAll = pkgname: if pkgname == null then "" else
|
||||
let
|
||||
mainGem = gems."${pkgname}" or (throw "bundlerEnv: gem ${pkgname} not found");
|
||||
in
|
||||
copyIfBundledByPath mainGem;
|
||||
|
||||
# We have to normalize the Gemfile.lock, otherwise bundler tries to be
|
||||
# helpful by doing so at run time, causing executables to immediately bail
|
||||
# out. Yes, I'm serious.
|
||||
confFiles = runCommand "gemfile-and-lockfile" {} ''
|
||||
mkdir -p $out
|
||||
${maybeCopyAll mainGemName}
|
||||
cp ${gemFiles.gemfile} $out/Gemfile || ls -l $out/Gemfile
|
||||
cp ${gemFiles.lockfile} $out/Gemfile.lock || ls -l $out/Gemfile.lock
|
||||
'';
|
||||
|
||||
buildGem = name: attrs: (
|
||||
let
|
||||
gemAttrs = composeGemAttrs ruby gems name attrs;
|
||||
in
|
||||
if gemAttrs.type == "path" then
|
||||
pathDerivation gemAttrs
|
||||
else
|
||||
buildRubyGem gemAttrs
|
||||
);
|
||||
|
||||
envPaths = lib.attrValues gems ++ lib.optional (!hasBundler) bundler;
|
||||
|
||||
basicEnv = buildEnv {
|
||||
inherit ignoreCollisions;
|
||||
|
||||
name = name';
|
||||
|
||||
paths = envPaths;
|
||||
pathsToLink = [ "/lib" ];
|
||||
|
||||
postBuild = genStubsScript (defs // args // {
|
||||
inherit confFiles bundler groups;
|
||||
binPaths = envPaths;
|
||||
}) + lib.optionalString (postBuild != null) postBuild;
|
||||
|
||||
meta = { platforms = ruby.meta.platforms; } // meta;
|
||||
|
||||
passthru = rec {
|
||||
inherit ruby bundler gems mainGem confFiles envPaths;
|
||||
|
||||
wrappedRuby =
|
||||
stdenv.mkDerivation {
|
||||
name = "wrapped-ruby-${pname}";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
for i in ${ruby}/bin/*; do
|
||||
makeWrapper "$i" $out/bin/$(basename "$i") \
|
||||
--set BUNDLE_GEMFILE ${confFiles}/Gemfile \
|
||||
--set BUNDLE_PATH ${basicEnv}/${ruby.gemPath} \
|
||||
--set BUNDLE_FROZEN 1 \
|
||||
--set GEM_HOME ${basicEnv}/${ruby.gemPath} \
|
||||
--set GEM_PATH ${basicEnv}/${ruby.gemPath}
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
env = let
|
||||
irbrc = builtins.toFile "irbrc" ''
|
||||
if !(ENV["OLD_IRBRC"].nil? || ENV["OLD_IRBRC"].empty?)
|
||||
require ENV["OLD_IRBRC"]
|
||||
end
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
'';
|
||||
in stdenv.mkDerivation {
|
||||
name = "${pname}-interactive-environment";
|
||||
nativeBuildInputs = [ wrappedRuby basicEnv ];
|
||||
shellHook = ''
|
||||
export OLD_IRBRC=$IRBRC
|
||||
export IRBRC=${irbrc}
|
||||
'';
|
||||
buildCommand = ''
|
||||
echo >&2 ""
|
||||
echo >&2 "*** Ruby 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
|
||||
echo >&2 ""
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
basicEnv
|
75
pkgs/development/ruby-modules/bundled-common/functions.nix
Normal file
75
pkgs/development/ruby-modules/bundled-common/functions.nix
Normal file
|
@ -0,0 +1,75 @@
|
|||
{ lib, gemConfig, ... }:
|
||||
rec {
|
||||
bundlerFiles = {
|
||||
gemfile ? null
|
||||
, lockfile ? null
|
||||
, gemset ? null
|
||||
, gemdir ? null
|
||||
, ...
|
||||
}: {
|
||||
inherit gemdir;
|
||||
|
||||
gemfile =
|
||||
if gemfile == null then assert gemdir != null; gemdir + "/Gemfile"
|
||||
else gemfile;
|
||||
|
||||
lockfile =
|
||||
if lockfile == null then assert gemdir != null; gemdir + "/Gemfile.lock"
|
||||
else lockfile;
|
||||
|
||||
gemset =
|
||||
if gemset == null then assert gemdir != null; gemdir + "/gemset.nix"
|
||||
else gemset;
|
||||
};
|
||||
|
||||
filterGemset = {ruby, groups,...}@env: gemset: lib.filterAttrs (name: attrs: platformMatches ruby attrs && groupMatches groups attrs) gemset;
|
||||
|
||||
platformMatches = {rubyEngine, version, ...}@ruby: attrs: (
|
||||
!(attrs ? "platforms") ||
|
||||
builtins.length attrs.platforms == 0 ||
|
||||
builtins.any (platform:
|
||||
platform.engine == rubyEngine &&
|
||||
(!(platform ? "version") || platform.version == version.majMin)
|
||||
) attrs.platforms
|
||||
);
|
||||
|
||||
groupMatches = groups: attrs: (
|
||||
!(attrs ? "groups") ||
|
||||
builtins.any (gemGroup: builtins.any (group: group == gemGroup) groups) attrs.groups
|
||||
);
|
||||
|
||||
applyGemConfigs = attrs:
|
||||
(if gemConfig ? "${attrs.gemName}"
|
||||
then attrs // gemConfig."${attrs.gemName}" attrs
|
||||
else attrs);
|
||||
|
||||
genStubsScript = { lib, ruby, confFiles, bundler, groups, binPaths, ... }: ''
|
||||
${ruby}/bin/ruby ${./gen-bin-stubs.rb} \
|
||||
"${ruby}/bin/ruby" \
|
||||
"${confFiles}/Gemfile" \
|
||||
"$out/${ruby.gemPath}" \
|
||||
"${bundler}/${ruby.gemPath}" \
|
||||
${lib.escapeShellArg binPaths} \
|
||||
${lib.escapeShellArg groups}
|
||||
'';
|
||||
|
||||
pathDerivation = { gemName, version, path, ... }:
|
||||
let
|
||||
res = {
|
||||
type = "derivation";
|
||||
bundledByPath = true;
|
||||
name = gemName;
|
||||
version = version;
|
||||
outPath = path;
|
||||
outputs = [ "out" ];
|
||||
out = res;
|
||||
outputName = "out";
|
||||
};
|
||||
in res;
|
||||
|
||||
composeGemAttrs = ruby: gems: name: attrs: ((removeAttrs attrs ["source" "platforms"]) // attrs.source // {
|
||||
inherit ruby;
|
||||
gemName = name;
|
||||
gemPath = map (gemName: gems."${gemName}") (attrs.dependencies or []);
|
||||
});
|
||||
}
|
50
pkgs/development/ruby-modules/bundled-common/test.nix
Normal file
50
pkgs/development/ruby-modules/bundled-common/test.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ stdenv, writeText, lib, ruby, defaultGemConfig, callPackage, test, stubs, should }@defs:
|
||||
let
|
||||
testConfigs = {
|
||||
inherit lib;
|
||||
gemConfig = defaultGemConfig;
|
||||
};
|
||||
functions = (import ./functions.nix testConfigs);
|
||||
in
|
||||
builtins.concatLists [
|
||||
( test.run "All set, no gemdir" (functions.bundlerFiles {
|
||||
gemfile = test/Gemfile;
|
||||
lockfile = test/Gemfile.lock;
|
||||
gemset = test/gemset.nix;
|
||||
}) {
|
||||
gemfile = should.equal test/Gemfile;
|
||||
lockfile = should.equal test/Gemfile.lock;
|
||||
gemset = should.equal test/gemset.nix;
|
||||
})
|
||||
|
||||
( test.run "Just gemdir" (functions.bundlerFiles {
|
||||
gemdir = test/.;
|
||||
}) {
|
||||
gemfile = should.equal test/Gemfile;
|
||||
lockfile = should.equal test/Gemfile.lock;
|
||||
gemset = should.equal test/gemset.nix;
|
||||
})
|
||||
|
||||
( test.run "Gemset and dir" (functions.bundlerFiles {
|
||||
gemdir = test/.;
|
||||
gemset = test/extraGemset.nix;
|
||||
}) {
|
||||
gemfile = should.equal test/Gemfile;
|
||||
lockfile = should.equal test/Gemfile.lock;
|
||||
gemset = should.equal test/extraGemset.nix;
|
||||
})
|
||||
|
||||
( test.run "Filter empty gemset" {} (set: functions.filterGemset {inherit ruby; groups = ["default"]; } set == {}))
|
||||
( let gemSet = { test = { groups = ["x" "y"]; }; };
|
||||
in
|
||||
test.run "Filter matches a group" gemSet (set: functions.filterGemset {inherit ruby; groups = ["y" "z"];} set == gemSet))
|
||||
( let gemSet = { test = { platforms = []; }; };
|
||||
in
|
||||
test.run "Filter matches empty platforms list" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
|
||||
( let gemSet = { test = { platforms = [{engine = ruby.rubyEngine; version = ruby.version.majMin;}]; }; };
|
||||
in
|
||||
test.run "Filter matches on platform" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
|
||||
( let gemSet = { test = { groups = ["x" "y"]; }; };
|
||||
in
|
||||
test.run "Filter excludes based on groups" gemSet (set: functions.filterGemset {inherit ruby; groups = ["a" "b"];} set == {}))
|
||||
]
|
48
pkgs/development/ruby-modules/bundler-app/default.nix
Normal file
48
pkgs/development/ruby-modules/bundler-app/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ lib, stdenv, callPackage, runCommand, ruby }@defs:
|
||||
|
||||
# Use for simple installation of Ruby tools shipped in a Gem.
|
||||
# Start with a Gemfile that includes `gem <toolgem>`
|
||||
# > nix-shell -p bundler bundix
|
||||
# (shell)> bundle lock
|
||||
# (shell)> bundix
|
||||
# Then use rubyTool in the default.nix:
|
||||
|
||||
# rubyTool { pname = "gemifiedTool"; gemdir = ./.; exes = ["gemified-tool"]; }
|
||||
# The 'exes' parameter ensures that a copy of e.g. rake doesn't polute the system.
|
||||
{
|
||||
# use the name of the name in question; its version will be picked up from the gemset
|
||||
pname
|
||||
# gemdir is the location of the Gemfile{,.lock} and gemset.nix; usually ./.
|
||||
, gemdir
|
||||
# Exes is the list of executables provided by the gems in the Gemfile
|
||||
, exes ? []
|
||||
# Scripts are ruby programs depend on gems in the Gemfile (e.g. scripts/rails)
|
||||
, scripts ? []
|
||||
, ruby ? defs.ruby
|
||||
, gemfile ? null
|
||||
, lockfile ? null
|
||||
, gemset ? null
|
||||
, preferLocalBuild ? false
|
||||
, allowSubstitutes ? false
|
||||
, meta ? {}
|
||||
, postBuild ? ""
|
||||
}@args:
|
||||
|
||||
let
|
||||
basicEnv = (callPackage ../bundled-common {}) args;
|
||||
|
||||
cmdArgs = removeAttrs args [ "pname" "postBuild" ]
|
||||
// { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
|
||||
in
|
||||
runCommand basicEnv.name cmdArgs ''
|
||||
mkdir -p $out/bin;
|
||||
${(lib.concatMapStrings (x: "ln -s '${basicEnv}/bin/${x}' $out/bin/${x};\n") exes)}
|
||||
${(lib.concatMapStrings (s: "makeWrapper $out/bin/$(basename ${s}) $srcdir/${s} " +
|
||||
"--set BUNDLE_GEMFILE ${basicEnv.confFiles}/Gemfile "+
|
||||
"--set BUNDLE_PATH ${basicEnv}/${ruby.gemPath} "+
|
||||
"--set BUNDLE_FROZEN 1 "+
|
||||
"--set GEM_HOME ${basicEnv}/${ruby.gemPath} "+
|
||||
"--set GEM_PATH ${basicEnv}/${ruby.gemPath} "+
|
||||
"--run \"cd $srcdir\";\n") scripts)}
|
||||
${postBuild}
|
||||
''
|
|
@ -1,9 +1,6 @@
|
|||
{ stdenv, runCommand, writeText, writeScript, writeScriptBin, ruby, lib
|
||||
, callPackage, defaultGemConfig, fetchurl, fetchgit, buildRubyGem, buildEnv
|
||||
, git
|
||||
, makeWrapper
|
||||
, bundler
|
||||
, tree
|
||||
, linkFarm, git, makeWrapper, bundler, tree
|
||||
}@defs:
|
||||
|
||||
{ name ? null
|
||||
|
@ -12,143 +9,54 @@
|
|||
, gemfile ? null
|
||||
, lockfile ? null
|
||||
, gemset ? null
|
||||
, groups ? ["default"]
|
||||
, ruby ? defs.ruby
|
||||
, gemConfig ? defaultGemConfig
|
||||
, postBuild ? null
|
||||
, document ? []
|
||||
, meta ? {}
|
||||
, groups ? ["default"]
|
||||
, ignoreCollisions ? false
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
let
|
||||
drvName =
|
||||
if name != null then name
|
||||
else if pname != null then "${toString pname}-${mainGem.version}"
|
||||
else throw "bundlerEnv: either pname or name must be set";
|
||||
inherit (import ../bundled-common/functions.nix {inherit lib ruby gemConfig groups; }) genStubsScript;
|
||||
|
||||
mainGem =
|
||||
if pname == null then null
|
||||
else gems."${pname}" or (throw "bundlerEnv: gem ${pname} not found");
|
||||
basicEnv = (callPackage ../bundled-common {}) (args // { inherit pname name; mainGemName = pname; });
|
||||
|
||||
gemfile' =
|
||||
if gemfile == null then gemdir + "/Gemfile"
|
||||
else gemfile;
|
||||
inherit (basicEnv) envPaths;
|
||||
# Idea here is a mkDerivation that gen-bin-stubs new stubs "as specified" -
|
||||
# either specific executables or the bin/ for certain gem(s), but
|
||||
# incorporates the basicEnv as a requirement so that its $out is in our path.
|
||||
|
||||
lockfile' =
|
||||
if lockfile == null then gemdir + "/Gemfile.lock"
|
||||
else lockfile;
|
||||
# When stubbing the bins for a gem, we should use the gem expression
|
||||
# directly, which means that basicEnv should somehow make it available.
|
||||
|
||||
gemset' =
|
||||
if gemset == null then gemdir + "/gemset.nix"
|
||||
else gemset;
|
||||
# Different use cases should use different variations on this file, rather
|
||||
# than the expression trying to deduce a use case.
|
||||
|
||||
importedGemset = import gemset';
|
||||
|
||||
filteredGemset = (lib.filterAttrs (name: attrs:
|
||||
if (builtins.hasAttr "groups" attrs)
|
||||
then (builtins.any (gemGroup: builtins.any (group: group == gemGroup) groups) attrs.groups)
|
||||
else true
|
||||
) importedGemset);
|
||||
|
||||
applyGemConfigs = attrs:
|
||||
(if gemConfig ? "${attrs.gemName}"
|
||||
then attrs // gemConfig."${attrs.gemName}" attrs
|
||||
else attrs);
|
||||
|
||||
configuredGemset = lib.flip lib.mapAttrs filteredGemset (name: attrs:
|
||||
applyGemConfigs (attrs // { inherit ruby; gemName = name; })
|
||||
);
|
||||
|
||||
hasBundler = builtins.hasAttr "bundler" filteredGemset;
|
||||
|
||||
bundler =
|
||||
if hasBundler then gems.bundler
|
||||
else defs.bundler.override (attrs: { inherit ruby; });
|
||||
|
||||
gems = lib.flip lib.mapAttrs configuredGemset (name: attrs:
|
||||
buildRubyGem ((removeAttrs attrs ["source"]) // attrs.source // {
|
||||
inherit ruby;
|
||||
gemName = name;
|
||||
gemPath = map (gemName: gems."${gemName}") (attrs.dependencies or []);
|
||||
}));
|
||||
|
||||
# We have to normalize the Gemfile.lock, otherwise bundler tries to be
|
||||
# helpful by doing so at run time, causing executables to immediately bail
|
||||
# out. Yes, I'm serious.
|
||||
confFiles = runCommand "gemfile-and-lockfile" {} ''
|
||||
mkdir -p $out
|
||||
cp ${gemfile'} $out/Gemfile
|
||||
cp ${lockfile'} $out/Gemfile.lock
|
||||
'';
|
||||
|
||||
envPaths = lib.attrValues gems ++ lib.optional (!hasBundler) bundler;
|
||||
|
||||
binPaths = if mainGem != null then [ mainGem ] else envPaths;
|
||||
|
||||
bundlerEnv = buildEnv {
|
||||
inherit ignoreCollisions;
|
||||
|
||||
name = drvName;
|
||||
|
||||
paths = envPaths;
|
||||
pathsToLink = [ "/lib" ];
|
||||
|
||||
postBuild = ''
|
||||
${ruby}/bin/ruby ${./gen-bin-stubs.rb} \
|
||||
"${ruby}/bin/ruby" \
|
||||
"${confFiles}/Gemfile" \
|
||||
"$out/${ruby.gemPath}" \
|
||||
"${bundler}/${ruby.gemPath}" \
|
||||
${lib.escapeShellArg binPaths} \
|
||||
${lib.escapeShellArg groups}
|
||||
'' + lib.optionalString (postBuild != null) postBuild;
|
||||
|
||||
meta = { platforms = ruby.meta.platforms; } // meta;
|
||||
|
||||
passthru = rec {
|
||||
inherit ruby bundler gems;
|
||||
|
||||
wrappedRuby = stdenv.mkDerivation {
|
||||
name = "wrapped-ruby-${drvName}";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
for i in ${ruby}/bin/*; do
|
||||
makeWrapper "$i" $out/bin/$(basename "$i") \
|
||||
--set BUNDLE_GEMFILE ${confFiles}/Gemfile \
|
||||
--set BUNDLE_PATH ${bundlerEnv}/${ruby.gemPath} \
|
||||
--set BUNDLE_FROZEN 1 \
|
||||
--set GEM_HOME ${bundlerEnv}/${ruby.gemPath} \
|
||||
--set GEM_PATH ${bundlerEnv}/${ruby.gemPath}
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
env = let
|
||||
irbrc = builtins.toFile "irbrc" ''
|
||||
if !(ENV["OLD_IRBRC"].nil? || ENV["OLD_IRBRC"].empty?)
|
||||
require ENV["OLD_IRBRC"]
|
||||
end
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
'';
|
||||
in stdenv.mkDerivation {
|
||||
name = "interactive-${drvName}-environment";
|
||||
nativeBuildInputs = [ wrappedRuby bundlerEnv ];
|
||||
shellHook = ''
|
||||
export OLD_IRBRC="$IRBRC"
|
||||
export IRBRC=${irbrc}
|
||||
'';
|
||||
buildCommand = ''
|
||||
echo >&2 ""
|
||||
echo >&2 "*** Ruby 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
|
||||
echo >&2 ""
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# The basicEnv should be put into passthru so that e.g. nix-shell can use it.
|
||||
in
|
||||
bundlerEnv
|
||||
if pname == null then
|
||||
basicEnv // { inherit name basicEnv; }
|
||||
else
|
||||
(buildEnv {
|
||||
inherit ignoreCollisions;
|
||||
|
||||
name = basicEnv.name;
|
||||
|
||||
paths = envPaths;
|
||||
pathsToLink = [ "/lib" ];
|
||||
|
||||
postBuild = genStubsScript {
|
||||
inherit lib ruby bundler groups;
|
||||
confFiles = basicEnv.confFiles;
|
||||
binPaths = [ basicEnv.gems."${pname}" ];
|
||||
} + lib.optionalString (postBuild != null) postBuild;
|
||||
|
||||
meta = { platforms = ruby.meta.platforms; } // meta;
|
||||
passthru = basicEnv.passthru // {
|
||||
inherit basicEnv;
|
||||
inherit (basicEnv) env;
|
||||
};
|
||||
})
|
||||
|
|
33
pkgs/development/ruby-modules/bundler-env/test.nix
Normal file
33
pkgs/development/ruby-modules/bundler-env/test.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ stdenv, writeText, lib, ruby, defaultGemConfig, callPackage, test, stubs, should}@defs:
|
||||
let
|
||||
bundlerEnv = callPackage ./default.nix stubs // {
|
||||
basicEnv = callPackage ../bundled-common stubs;
|
||||
};
|
||||
|
||||
justName = bundlerEnv {
|
||||
name = "test-0.1.2";
|
||||
gemset = ./test/gemset.nix;
|
||||
};
|
||||
|
||||
pnamed = bundlerEnv {
|
||||
pname = "test";
|
||||
gemdir = ./test;
|
||||
gemset = ./test/gemset.nix;
|
||||
gemfile = ./test/Gemfile;
|
||||
lockfile = ./test/Gemfile.lock;
|
||||
};
|
||||
in
|
||||
builtins.concatLists [
|
||||
(test.run "bundlerEnv { name }" justName {
|
||||
name = should.equal "test-0.1.2";
|
||||
})
|
||||
(test.run "bundlerEnv { pname }" pnamed
|
||||
[
|
||||
(should.haveKeys [ "name" "env" "postBuild" ])
|
||||
{
|
||||
name = should.equal "test-0.1.2";
|
||||
env = should.beASet;
|
||||
postBuild = should.havePrefix "/nix/store";
|
||||
}
|
||||
])
|
||||
]
|
0
pkgs/development/ruby-modules/bundler-env/test/Gemfile
Normal file
0
pkgs/development/ruby-modules/bundler-env/test/Gemfile
Normal file
10
pkgs/development/ruby-modules/bundler-env/test/gemset.nix
Normal file
10
pkgs/development/ruby-modules/bundler-env/test/gemset.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
test = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1j5r0anj8m4qlf2psnldip4b8ha2bsscv11lpdgnfh4nnchzjnxw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.2";
|
||||
};
|
||||
}
|
|
@ -87,6 +87,7 @@ stdenv.mkDerivation (attrs // {
|
|||
++ lib.optional stdenv.isDarwin darwin.libobjc
|
||||
++ buildInputs;
|
||||
|
||||
#name = builtins.trace (attrs.name or "no attr.name" ) "${namePrefix}${gemName}-${version}";
|
||||
name = attrs.name or "${namePrefix}${gemName}-${version}";
|
||||
|
||||
inherit src;
|
||||
|
|
6
pkgs/development/ruby-modules/runtests.sh
Executable file
6
pkgs/development/ruby-modules/runtests.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o xtrace
|
||||
cd $(dirname $0)
|
||||
find . -name text.nix
|
||||
testfiles=$(find . -name test.nix)
|
||||
nix-build -E "with import <nixpkgs> {}; callPackage testing/driver.nix { testFiles = [ $testfiles ]; }" --show-trace && cat result
|
28
pkgs/development/ruby-modules/testing/assertions.nix
Normal file
28
pkgs/development/ruby-modules/testing/assertions.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ test, lib, ...}:
|
||||
{
|
||||
equal = expected: actual:
|
||||
if actual == expected then
|
||||
(test.passed "= ${toString expected}") else
|
||||
(test.failed (
|
||||
"expected '${toString expected}'(${builtins.typeOf expected})"
|
||||
+ " != "+
|
||||
"actual '${toString actual}'(${builtins.typeOf actual})"
|
||||
));
|
||||
|
||||
beASet = actual:
|
||||
if builtins.isAttrs actual then
|
||||
(test.passed "is a set") else
|
||||
(test.failed "is not a set, was ${builtins.typeOf actual}: ${toString actual}");
|
||||
|
||||
haveKeys = expected: actual:
|
||||
if builtins.all
|
||||
(ex: builtins.any (ac: ex == ac) (builtins.attrNames actual))
|
||||
expected then
|
||||
(test.passed "has expected keys") else
|
||||
(test.failed "keys differ: expected: [${lib.concatStringsSep ";" expected}] actual: [${lib.concatStringsSep ";" (builtins.attrNames actual)}]");
|
||||
|
||||
havePrefix = expected: actual:
|
||||
if lib.hasPrefix expected actual then
|
||||
(test.passed "has prefix '${expected}'") else
|
||||
(test.failed "prefix '${expected}' not found in '${actual}'");
|
||||
}
|
20
pkgs/development/ruby-modules/testing/driver.nix
Normal file
20
pkgs/development/ruby-modules/testing/driver.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Run with:
|
||||
nix-build -E 'with import <nixpkgs> { }; callPackage ./test.nix {}' --show-trace; and cat result
|
||||
|
||||
Confusingly, the ideal result ends with something like:
|
||||
error: build of ‘/nix/store/3245f3dcl2wxjs4rci7n069zjlz8qg85-test-results.tap.drv’ failed
|
||||
*/
|
||||
{ writeText, lib, callPackage, testFiles, stdenv, ruby }@defs:
|
||||
let
|
||||
testTools = rec {
|
||||
test = import ./testing.nix;
|
||||
stubs = import ./stubs.nix defs;
|
||||
should = import ./assertions.nix { inherit test lib; };
|
||||
};
|
||||
|
||||
tap = import ./tap-support.nix;
|
||||
|
||||
results = builtins.concatLists (map (file: callPackage file testTools) testFiles);
|
||||
in
|
||||
writeText "test-results.tap" (tap.output results)
|
33
pkgs/development/ruby-modules/testing/stubs.nix
Normal file
33
pkgs/development/ruby-modules/testing/stubs.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ stdenv, lib, ruby, callPackage, ... }:
|
||||
let
|
||||
real = {
|
||||
inherit (stdenv) mkDerivation;
|
||||
};
|
||||
mkDerivation = {name, ...}@argSet:
|
||||
derivation {
|
||||
inherit name;
|
||||
text = (builtins.toJSON (lib.filterAttrs ( n: v: builtins.any (x: x == n) ["name" "system"]) argSet));
|
||||
builder = stdenv.shell;
|
||||
args = [ "-c" "echo $(<$textPath) > $out"];
|
||||
system = stdenv.system;
|
||||
passAsFile = ["text"];
|
||||
};
|
||||
fetchurl = {url?"", urls ? [],...}: "fetchurl:${if urls == [] then url else builtins.head urls}";
|
||||
|
||||
stdenv' = stdenv // {
|
||||
inherit mkDerivation;
|
||||
stubbed = true;
|
||||
};
|
||||
ruby' = ruby // {
|
||||
stdenv = stdenv';
|
||||
stubbed = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
ruby = ruby';
|
||||
buildRubyGem = callPackage ../gem {
|
||||
inherit fetchurl;
|
||||
ruby = ruby';
|
||||
};
|
||||
stdenv = stdenv';
|
||||
}
|
21
pkgs/development/ruby-modules/testing/tap-support.nix
Normal file
21
pkgs/development/ruby-modules/testing/tap-support.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
with builtins;
|
||||
let
|
||||
withIndexes = list: genList (idx: (elemAt list idx) // {index = idx;}) (length list);
|
||||
|
||||
testLine = report: "${okStr report} ${toString (report.index + 1)} ${report.description}" + testDirective report + testYaml report;
|
||||
|
||||
# These are part of the TAP spec, not yet implemented.
|
||||
#c.f. https://github.com/NixOS/nixpkgs/issues/27071
|
||||
testDirective = report: "";
|
||||
testYaml = report: "";
|
||||
|
||||
okStr = { result, ...}: if result == "pass" then "ok" else "not ok";
|
||||
in
|
||||
{
|
||||
output = reports: ''
|
||||
TAP version 13
|
||||
1..${toString (length reports)}'' + (foldl' (l: r: l + "\n" + r) "" (map testLine (withIndexes reports))) + ''
|
||||
|
||||
# Finished at ${toString currentTime}
|
||||
'';
|
||||
}
|
62
pkgs/development/ruby-modules/testing/testing.nix
Normal file
62
pkgs/development/ruby-modules/testing/testing.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
with builtins;
|
||||
let
|
||||
/*
|
||||
underTest = {
|
||||
x = {
|
||||
a = 1;
|
||||
b = "2";
|
||||
};
|
||||
};
|
||||
|
||||
tests = [
|
||||
(root: false)
|
||||
{
|
||||
x = [
|
||||
(set: true)
|
||||
{
|
||||
a = (a: a > 1);
|
||||
b = (b: b == "3");
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
results = run "Examples" underTest tests;
|
||||
*/
|
||||
|
||||
passed = desc: {
|
||||
result = "pass";
|
||||
description = desc;
|
||||
};
|
||||
|
||||
failed = desc: {
|
||||
result = "failed";
|
||||
description = desc;
|
||||
};
|
||||
|
||||
prefixName = name: res: {
|
||||
inherit (res) result;
|
||||
description = "${name}: ${res.description}";
|
||||
};
|
||||
|
||||
run = name: under: tests: if isList tests then
|
||||
(concatLists (map (run name under) tests))
|
||||
else if isAttrs tests then
|
||||
(concatLists (map (
|
||||
subName: run (name + "." + subName) (if hasAttr subName under then getAttr subName under else "<MISSING!>") (getAttr subName tests)
|
||||
) (attrNames tests)))
|
||||
else if isFunction tests then
|
||||
let
|
||||
res = tests under;
|
||||
in
|
||||
if isBool res then
|
||||
[
|
||||
(prefixName name (if tests under then passed "passed" else failed "failed"))
|
||||
]
|
||||
else
|
||||
[ (prefixName name res) ]
|
||||
else [
|
||||
failed (name ": not a function, list or set")
|
||||
];
|
||||
in
|
||||
{ inherit run passed failed; }
|
|
@ -5,12 +5,12 @@
|
|||
with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ammonite-${version}";
|
||||
version = "1.0.0";
|
||||
version = "1.0.1";
|
||||
scalaVersion = "2.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/${scalaVersion}-${version}";
|
||||
sha256 = "0d74b3aasgg4ap5ishzzm4jbf1k4dxv7gzd88d69miyapsaa4p0c";
|
||||
sha256 = "1gfswia6wg1z8whzmca7zmrkbhkvianbyd15yimnbd08minm1z2d";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
|
|
3
pkgs/development/tools/corundum/Gemfile
Normal file
3
pkgs/development/tools/corundum/Gemfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "corundum", "=0.6.2"
|
56
pkgs/development/tools/corundum/Gemfile.lock
Normal file
56
pkgs/development/tools/corundum/Gemfile.lock
Normal file
|
@ -0,0 +1,56 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
calibrate (0.0.1)
|
||||
caliph (0.3.1)
|
||||
corundum (0.6.2)
|
||||
bundler (~> 1.10)
|
||||
caliph (~> 0.3)
|
||||
mattock (~> 0.9)
|
||||
paint (~> 0.8)
|
||||
rspec (>= 2.0, < 4)
|
||||
simplecov (>= 0.5)
|
||||
simplecov-json (~> 0.2)
|
||||
diff-lcs (1.3)
|
||||
docile (1.1.5)
|
||||
json (2.1.0)
|
||||
mattock (0.10.1)
|
||||
calibrate (~> 0.0.1)
|
||||
caliph (~> 0.3)
|
||||
rake (~> 10.0)
|
||||
tilt (> 0)
|
||||
valise (~> 1.1)
|
||||
paint (0.9.0)
|
||||
rake (10.5.0)
|
||||
rspec (3.6.0)
|
||||
rspec-core (~> 3.6.0)
|
||||
rspec-expectations (~> 3.6.0)
|
||||
rspec-mocks (~> 3.6.0)
|
||||
rspec-core (3.6.0)
|
||||
rspec-support (~> 3.6.0)
|
||||
rspec-expectations (3.6.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.6.0)
|
||||
rspec-mocks (3.6.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.6.0)
|
||||
rspec-support (3.6.0)
|
||||
simplecov (0.14.1)
|
||||
docile (~> 1.1.0)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.1)
|
||||
simplecov-json (0.2)
|
||||
json
|
||||
simplecov
|
||||
tilt (2.0.7)
|
||||
valise (1.2.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
corundum (= 0.6.2)
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.4
|
15
pkgs/development/tools/corundum/default.nix
Normal file
15
pkgs/development/tools/corundum/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ lib, bundlerApp }:
|
||||
|
||||
bundlerApp {
|
||||
pname = "corundum";
|
||||
gemdir = ./.;
|
||||
exes = [ "corundum-skel" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool and libraries for maintaining Ruby gems.";
|
||||
homepage = https://github.com/nyarly/corundum;
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.nyarly ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
154
pkgs/development/tools/corundum/gemset.nix
Normal file
154
pkgs/development/tools/corundum/gemset.nix
Normal file
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
calibrate = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "17kmlss7db70pjwdbbhag7mnixh8wasdq6n1v8663x50z9c7n2ng";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.0.1";
|
||||
};
|
||||
caliph = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "08d07n4m4yh1h9icq6n9dkw4jwgdmgd638f15mxr2pvqp4wycsnr";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.1";
|
||||
};
|
||||
corundum = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1y6shjrqaqyh14a1r4ic660g6jnq4abdrx9imglyalzyrlrwbsxq";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.6.2";
|
||||
};
|
||||
diff-lcs = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "18w22bjz424gzafv6nzv98h0aqkwz3d9xhm7cbr1wfbyas8zayza";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.3";
|
||||
};
|
||||
docile = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0m8j31whq7bm5ljgmsrlfkiqvacrw6iz9wq10r3gwrv5785y8gjx";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.5";
|
||||
};
|
||||
json = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.1.0";
|
||||
};
|
||||
mattock = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "02d6igwr4sfj4jnky8d5h0rm2cc665k1bqz7sj4khzvr18nk3ai6";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.10.1";
|
||||
};
|
||||
paint = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1fcn7cfrhbl4nl95fmcd67q33h7bl3iafsafs6w9yj4nqzagz1yc";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.9.0";
|
||||
};
|
||||
rake = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0jcabbgnjc788chx31sihc5pgbqnlc1c75wakmqlbjdm8jns2m9b";
|
||||
type = "gem";
|
||||
};
|
||||
version = "10.5.0";
|
||||
};
|
||||
rspec = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1nd50hycab2a2vdah9lxi585g8f63jxjvmzmxqyln51grxwx9hzb";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.6.0";
|
||||
};
|
||||
rspec-core = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "18np8wyw2g79waclpaacba6nd7x60ixg07ncya0j0qj1z9b37grd";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.6.0";
|
||||
};
|
||||
rspec-expectations = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "028ifzf9mqp3kxx40q1nbwj40g72g9zk0wr78l146phblkv96w0a";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.6.0";
|
||||
};
|
||||
rspec-mocks = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0nv6jkxy24sag1i9w9wi3850k6skk2fm6yhcrgnmlz6vmwxvizp8";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.6.0";
|
||||
};
|
||||
rspec-support = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "050paqqpsml8w88nf4a15zbbj3vvm471zpv73sjfdnz7w21wnypb";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.6.0";
|
||||
};
|
||||
simplecov = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1r9fnsnsqj432cmrpafryn8nif3x0qg9mdnvrcf0wr01prkdlnww";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.14.1";
|
||||
};
|
||||
simplecov-html = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0f3psphismgp6jp1fxxz09zbswh7m2xxxr6gqlzdh7sgv415clvm";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.10.1";
|
||||
};
|
||||
simplecov-json = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0x9hr08pkj5d14nfzsn5h8b7ayl6q0xir45dcx5rv2a7g10kzlpp";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.2";
|
||||
};
|
||||
tilt = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1is1ayw5049z8pd7slsk870bddyy5g2imp4z78lnvl8qsl8l0s7b";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.0.7";
|
||||
};
|
||||
valise = {
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1arsbmk2gifrhv244qrld7s3202xrnxy6vlc5gqklg70dpsinbn5";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.2.1";
|
||||
};
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args:
|
||||
|
||||
let
|
||||
version = "4.12.3";
|
||||
version = "4.12.4";
|
||||
revision = "a";
|
||||
sha256 = "0nxzpkh2ca47g6qykkfhf8qynpx3kr9vdkm9wixky159zxfj6s85";
|
||||
sha256 = "1c6fin95ppl7lj09vr3vxfwxgf3db15wyncvq07b675fpkdx0nnx";
|
||||
in
|
||||
|
||||
import ./generic.nix (args // {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, python2Packages, fetchurl }:
|
||||
{ lib, python2, fetchurl }:
|
||||
|
||||
python2Packages.buildPythonApplication rec {
|
||||
python2.pkgs.buildPythonApplication rec {
|
||||
name = "cli53-${version}";
|
||||
version = "0.4.4";
|
||||
|
||||
|
@ -9,7 +9,18 @@ python2Packages.buildPythonApplication rec {
|
|||
sha256 = "0s9jzigq6a16m2c3qklssx2lz16cf13g5zh80vh24kxazaxqzbig";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python2Packages; [
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py --replace "'argparse', " ""
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
${python2.interpreter} -m unittest discover -s tests
|
||||
'';
|
||||
|
||||
# Tests do not function
|
||||
doCheck = false;
|
||||
|
||||
propagatedBuildInputs = with python2.pkgs; [
|
||||
argparse
|
||||
boto
|
||||
dns
|
||||
|
|
|
@ -6412,6 +6412,7 @@ with pkgs;
|
|||
bundix = callPackage ../development/ruby-modules/bundix { };
|
||||
bundler = callPackage ../development/ruby-modules/bundler { };
|
||||
bundlerEnv = callPackage ../development/ruby-modules/bundler-env { };
|
||||
bundlerApp = callPackage ../development/ruby-modules/bundler-app { };
|
||||
|
||||
inherit (callPackage ../development/interpreters/ruby {})
|
||||
ruby_2_0_0
|
||||
|
@ -6727,6 +6728,8 @@ with pkgs;
|
|||
|
||||
cookiecutter = pythonPackages.cookiecutter;
|
||||
|
||||
corundum = callPackage ../development/tools/corundum { };
|
||||
|
||||
ctags = callPackage ../development/tools/misc/ctags { };
|
||||
|
||||
ctagsWrapped = callPackage ../development/tools/misc/ctags/wrapped.nix {};
|
||||
|
|
|
@ -1867,33 +1867,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
cycler = buildPythonPackage rec {
|
||||
name = "cycler-${version}";
|
||||
version = "0.10.0";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://pypi/C/Cycler/${name}.tar.gz";
|
||||
sha256 = "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8";
|
||||
};
|
||||
|
||||
buildInputs = with self; [ coverage nose ];
|
||||
propagatedBuildInputs = with self; [ six ];
|
||||
|
||||
checkPhase = ''
|
||||
${python.interpreter} run_tests.py
|
||||
'';
|
||||
|
||||
# Tests were not included in release.
|
||||
# https://github.com/matplotlib/cycler/issues/31
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Composable style cycles";
|
||||
homepage = http://github.com/matplotlib/cycler;
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ fridh ];
|
||||
};
|
||||
};
|
||||
cycler = callPackage ../development/python-modules/cycler { };
|
||||
|
||||
datadog = buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
|
@ -2137,55 +2111,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
blaze = buildPythonPackage rec {
|
||||
name = "blaze-${version}";
|
||||
version = "0.11.0";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/blaze/blaze/archive/${version}.tar.gz";
|
||||
sha256 = "07zrrxkmdqk84xvdmp29859zcfzlpx5pz6g62l28nqp6n6a7yq9a";
|
||||
};
|
||||
|
||||
buildInputs = with self; [ pytest ];
|
||||
propagatedBuildInputs = with self; [
|
||||
contextlib2
|
||||
cytoolz
|
||||
dask
|
||||
datashape
|
||||
flask
|
||||
flask-cors
|
||||
h5py
|
||||
multipledispatch
|
||||
numba
|
||||
numpy
|
||||
odo
|
||||
pandas
|
||||
psutil
|
||||
pymongo
|
||||
pyyaml
|
||||
requests
|
||||
sqlalchemy
|
||||
tables
|
||||
toolz
|
||||
];
|
||||
|
||||
# Failing test
|
||||
# ERROR collecting blaze/tests/test_interactive.py
|
||||
# E networkx.exception.NetworkXNoPath: node <class 'list'> not
|
||||
# reachable from <class 'dask.array.core.Array'>
|
||||
doCheck = false;
|
||||
|
||||
checkPhase = ''
|
||||
py.test blaze/tests
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/ContinuumIO/blaze;
|
||||
description = "Allows Python users a familiar interface to query data living in other data storage systems";
|
||||
license = licenses.bsdOriginal;
|
||||
maintainers = with maintainers; [ fridh ];
|
||||
};
|
||||
};
|
||||
blaze = callPackage ../development/python-modules/blaze { };
|
||||
|
||||
# Needed for FlexGet 1.2.337 and calibre 2.76.0
|
||||
html5lib_0_9999999 = self.html5lib.override rec {
|
||||
|
@ -3586,50 +3512,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
cython = buildPythonPackage rec {
|
||||
name = "Cython-${version}";
|
||||
version = "0.25.2";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://pypi/C/Cython/${name}.tar.gz";
|
||||
sha256 = "01h3lrf6d98j07iakifi81qjszh6faa37ibx7ylva1vsqbwx2hgi";
|
||||
};
|
||||
|
||||
# With Python 2.x on i686-linux or 32-bit ARM this test fails because the
|
||||
# result is "3L" instead of "3", so let's fix it in-place.
|
||||
#
|
||||
# Upstream issue: https://github.com/cython/cython/issues/1548
|
||||
postPatch = optionalString ((stdenv.isi686 || stdenv.isArm) && !isPy3k) ''
|
||||
sed -i -e 's/\(>>> *\)\(verify_resolution_GH1533()\)/\1int(\2)/' \
|
||||
tests/run/cpdef_enums.pyx
|
||||
'';
|
||||
|
||||
buildInputs = with self; [ pkgs.glibcLocales pkgs.pkgconfig pkgs.gdb ];
|
||||
# For testing
|
||||
nativeBuildInputs = with self; [ numpy pkgs.ncurses ];
|
||||
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
|
||||
# cython's testsuite is not working very well with libc++
|
||||
# We are however optimistic about things outside of testsuite still working
|
||||
checkPhase = ''
|
||||
export HOME="$NIX_BUILD_TOP"
|
||||
${python.interpreter} runtests.py \
|
||||
${if stdenv.cc.isClang or false then ''--exclude="(cpdef_extern_func|libcpp_algo)"'' else ""}
|
||||
'';
|
||||
|
||||
# Disable tests temporarily
|
||||
# https://github.com/cython/cython/issues/1676
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "An optimising static compiler for both the Python programming language and the extended Cython programming language";
|
||||
platforms = platforms.all;
|
||||
homepage = http://cython.org;
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ fridh ];
|
||||
};
|
||||
};
|
||||
cython = callPackage ../development/python-modules/Cython { };
|
||||
|
||||
cytoolz = buildPythonPackage rec {
|
||||
name = "cytoolz-${version}";
|
||||
|
@ -21793,31 +21676,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
sounddevice = buildPythonPackage rec {
|
||||
name = "sounddevice-${version}";
|
||||
version = "0.3.6";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://pypi/s/sounddevice/${name}.tar.gz";
|
||||
sha256 = "4ef39be2d13069fbad8c69ac259e018d96ce55c23b529a7e0be9bd9a76e2e8da";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with self; [ cffi numpy pkgs.portaudio ];
|
||||
|
||||
# No tests included nor upstream available.
|
||||
doCheck = false;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace sounddevice.py --replace "'portaudio'" "'${pkgs.portaudio}/lib/libportaudio.so.2'"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Play and Record Sound with Python";
|
||||
homepage = http://python-sounddevice.rtfd.org/;
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ fridh ];
|
||||
};
|
||||
};
|
||||
sounddevice = callPackage ../development/python-modules/sounddevice { };
|
||||
|
||||
stevedore = callPackage ../development/python-modules/stevedore {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue