Merge branch 'master' into staging-next
This commit is contained in:
@@ -19,13 +19,13 @@
|
||||
|
||||
{ lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which
|
||||
, libiconv, postgresql, v8_3_16_14, clang, sqlite, zlib, imagemagick
|
||||
, pkgconfig , ncurses, xapian_1_2_22, gpgme, utillinux, fetchpatch, tzdata, icu, libffi
|
||||
, pkgconfig , ncurses, xapian, gpgme, utillinux, fetchpatch, tzdata, icu, libffi
|
||||
, cmake, libssh2, openssl, mysql, darwin, git, perl, pcre, gecode_3, curl
|
||||
, msgpack, qt59, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
|
||||
, cairo, re2, rake, gobject-introspection, gdk-pixbuf, zeromq, czmq, graphicsmagick, libcxx
|
||||
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
|
||||
, bison, flex, pango, python3, patchelf
|
||||
, libselinux ? null, libsepol ? null
|
||||
, bison, flex, pango, python3, patchelf, binutils, freetds, wrapGAppsHook, atk
|
||||
, bundler, libsass, libselinux ? null, libsepol ? null
|
||||
}@args:
|
||||
|
||||
let
|
||||
@@ -42,8 +42,9 @@ in
|
||||
|
||||
{
|
||||
atk = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ gtk2 pcre rake ];
|
||||
dependencies = attrs.dependencies ++ [ "gobject-introspection" ];
|
||||
nativeBuildInputs = [ rake bundler pkgconfig ];
|
||||
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook atk ];
|
||||
};
|
||||
|
||||
bundler = attrs:
|
||||
@@ -85,6 +86,38 @@ in
|
||||
buildInputs = [ protobuf ];
|
||||
};
|
||||
|
||||
cocoapods-acknowledgements = attrs: {
|
||||
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-deploy = attrs: {
|
||||
dependencies = [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-disable-podfile-validations = attrs: {
|
||||
dependencies = [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-generate = attrs: {
|
||||
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-git_url_rewriter = attrs: {
|
||||
dependencies = [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-keys = attrs: {
|
||||
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-open = attrs: {
|
||||
dependencies = [ "cocoapods" ];
|
||||
};
|
||||
|
||||
cocoapods-try-release-fix = attrs: {
|
||||
dependencies = [ "cocoapods" ];
|
||||
};
|
||||
|
||||
curb = attrs: {
|
||||
buildInputs = [ curl ];
|
||||
};
|
||||
@@ -113,12 +146,13 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
fog-dnsimple = attrs: {
|
||||
postInstall = ''
|
||||
cd $(cat $out/nix-support/gem-meta/install-path)
|
||||
rm {$out/bin,bin,../../bin}/{setup,console}
|
||||
'';
|
||||
};
|
||||
fog-dnsimple = attrs:
|
||||
lib.optionalAttrs (lib.versionOlder attrs.version "1.0.1") {
|
||||
postInstall = ''
|
||||
cd $(cat $out/nix-support/gem-meta/install-path)
|
||||
rm {$out/bin,bin,../../bin}/{setup,console}
|
||||
'';
|
||||
};
|
||||
|
||||
redis-rack = attrs: {
|
||||
dontBuild = false;
|
||||
@@ -158,8 +192,8 @@ in
|
||||
};
|
||||
|
||||
gdk_pixbuf2 = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ rake gdk-pixbuf ];
|
||||
nativeBuildInputs = [ pkgconfig bundler rake ];
|
||||
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gdk-pixbuf ];
|
||||
};
|
||||
|
||||
gpgme = attrs: {
|
||||
@@ -179,8 +213,14 @@ in
|
||||
};
|
||||
|
||||
gtk2 = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig ] ++ lib.optionals stdenv.isLinux [ utillinux libselinux libsepol ];
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
binutils pkgconfig
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
utillinux libselinux libsepol
|
||||
];
|
||||
propagatedBuildInputs = [
|
||||
atk
|
||||
gdk-pixbuf
|
||||
fribidi
|
||||
gobject-introspection
|
||||
gtk2
|
||||
@@ -194,8 +234,8 @@ in
|
||||
};
|
||||
|
||||
gobject-introspection = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ gobject-introspection gtk2 pcre ];
|
||||
nativeBuildInputs = [ pkgconfig pcre ];
|
||||
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook glib ];
|
||||
};
|
||||
|
||||
grpc = attrs: {
|
||||
@@ -239,6 +279,10 @@ in
|
||||
buildFlags = [ "--with-system-v8=true" ];
|
||||
};
|
||||
|
||||
execjs = attrs: {
|
||||
propagatedBuildInputs = [ v8 ];
|
||||
};
|
||||
|
||||
libxml-ruby = attrs: {
|
||||
buildFlags = [
|
||||
"--with-xml2-lib=${libxml2.out}/lib"
|
||||
@@ -333,16 +377,15 @@ in
|
||||
};
|
||||
|
||||
pango = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
pkgconfig
|
||||
fribidi
|
||||
gobject-introspection
|
||||
gtk2
|
||||
harfbuzz
|
||||
pcre
|
||||
xorg.libpthreadstubs
|
||||
xorg.libXdmcp
|
||||
];
|
||||
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gtk2 ];
|
||||
};
|
||||
|
||||
patron = attrs: {
|
||||
@@ -380,7 +423,12 @@ in
|
||||
"
|
||||
'';
|
||||
} else {
|
||||
buildInputs = [ libsodium ];
|
||||
dontBuild = false;
|
||||
postPatch = ''
|
||||
substituteInPlace lib/rbnacl/sodium.rb \
|
||||
--replace 'ffi_lib ["sodium"' \
|
||||
'ffi_lib ["${libsodium}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
||||
'';
|
||||
};
|
||||
|
||||
re2 = attrs: {
|
||||
@@ -439,6 +487,12 @@ in
|
||||
|
||||
sassc = attrs: {
|
||||
nativeBuildInputs = [ rake ];
|
||||
dontBuild = false;
|
||||
SASS_LIBSASS_PATH = "${libsass}";
|
||||
postPatch = ''
|
||||
substituteInPlace lib/sassc/native.rb \
|
||||
--replace 'gem_root = spec.gem_dir' 'gem_root = File.join(__dir__, "../../")'
|
||||
'';
|
||||
};
|
||||
|
||||
scrypt = attrs:
|
||||
@@ -471,7 +525,7 @@ in
|
||||
sup = attrs: {
|
||||
dontBuild = false;
|
||||
# prevent sup from trying to dynamically install `xapian-ruby`.
|
||||
nativeBuildInputs = [ rake ];
|
||||
nativeBuildInputs = [ bundler rake ];
|
||||
postPatch = ''
|
||||
cp ${./mkrf_conf_xapian.rb} ext/mkrf_conf_xapian.rb
|
||||
|
||||
@@ -506,6 +560,7 @@ in
|
||||
|
||||
tiny_tds = attrs: {
|
||||
nativeBuildInputs = [ pkgconfig openssl ];
|
||||
buildInputs = [ freetds ];
|
||||
};
|
||||
|
||||
therubyracer = attrs: {
|
||||
@@ -541,13 +596,13 @@ in
|
||||
xapian-ruby = attrs: {
|
||||
# use the system xapian
|
||||
dontBuild = false;
|
||||
nativeBuildInputs = [ rake pkgconfig ];
|
||||
buildInputs = [ xapian_1_2_22 zlib ];
|
||||
nativeBuildInputs = [ rake pkgconfig bundler ];
|
||||
buildInputs = [ xapian zlib ];
|
||||
postPatch = ''
|
||||
cp ${./xapian-Rakefile} Rakefile
|
||||
'';
|
||||
preInstall = ''
|
||||
export XAPIAN_CONFIG=${xapian_1_2_22}/bin/xapian-config
|
||||
export XAPIAN_CONFIG=${xapian}/bin/xapian-config
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ ruby = File.join(ENV["ruby"], "bin", RbConfig::CONFIG['ruby_install_name'])
|
||||
out = ENV["out"]
|
||||
bin_path = File.join(ENV["out"], "bin")
|
||||
gem_home = ENV["GEM_HOME"]
|
||||
gem_path = ENV["GEM_PATH"].split(File::PATH_SEPARATOR)
|
||||
gem_path = ENV["GEM_PATH"].split(File::PATH_SEPARATOR).uniq
|
||||
install_path = Dir.glob("#{gem_home}/gems/*").first
|
||||
gemspec_path = ARGV[0]
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
source 'https://rubygems.org' do
|
||||
gem 'addressable'
|
||||
gem 'atk'
|
||||
gem 'awesome_print'
|
||||
gem 'bacon'
|
||||
# gem 'bundler' already got a package for that
|
||||
gem 'byebug'
|
||||
gem 'cairo'
|
||||
gem 'cairo-gobject'
|
||||
gem 'camping'
|
||||
# gem 'capybara-webkit' takes too long to build right now since webkit depends on ruby
|
||||
gem 'charlock_holmes'
|
||||
gem 'cld3'
|
||||
gem 'cocoapods'
|
||||
gem 'cocoapods-acknowledgements'
|
||||
gem 'cocoapods-art'
|
||||
gem 'cocoapods-bin'
|
||||
gem 'cocoapods-browser'
|
||||
gem 'cocoapods-bugsnag'
|
||||
gem 'cocoapods-check'
|
||||
gem 'cocoapods-clean'
|
||||
gem 'cocoapods-clean_build_phases_scripts'
|
||||
gem 'cocoapods-core'
|
||||
gem 'cocoapods-coverage'
|
||||
gem 'cocoapods-deintegrate'
|
||||
gem 'cocoapods-dependencies'
|
||||
gem 'cocoapods-deploy'
|
||||
gem 'cocoapods-downloader'
|
||||
gem 'cocoapods-expert-difficulty'
|
||||
gem 'cocoapods-fix-react-native'
|
||||
gem 'cocoapods-generate'
|
||||
gem 'cocoapods-git_url_rewriter'
|
||||
gem 'cocoapods-keys'
|
||||
gem 'cocoapods-no-dev-schemes'
|
||||
gem 'cocoapods-open'
|
||||
gem 'cocoapods-packager'
|
||||
gem 'cocoapods-playgrounds'
|
||||
gem 'cocoapods-plugins'
|
||||
gem 'cocoapods-prune-localizations'
|
||||
gem 'cocoapods-rome'
|
||||
gem 'cocoapods-search'
|
||||
gem 'cocoapods-sorted-search'
|
||||
gem 'cocoapods-static-swift-framework'
|
||||
gem 'cocoapods-stats'
|
||||
gem 'cocoapods-tdfire-binary'
|
||||
gem 'cocoapods-testing'
|
||||
gem 'cocoapods-trunk'
|
||||
gem 'cocoapods-try'
|
||||
gem 'cocoapods-try-release-fix'
|
||||
gem 'cocoapods-update-if-you-dare'
|
||||
gem 'cocoapods-whitelist'
|
||||
gem 'cocoapods-wholemodule'
|
||||
gem 'coderay'
|
||||
gem 'concurrent-ruby'
|
||||
gem 'curb'
|
||||
gem 'curses'
|
||||
gem 'daemons'
|
||||
gem 'dep-selector-libgecode'
|
||||
gem 'digest-sha3'
|
||||
gem 'domain_name'
|
||||
gem 'do_sqlite3'
|
||||
gem 'ethon'
|
||||
gem 'eventmachine'
|
||||
gem 'excon'
|
||||
gem 'faraday'
|
||||
gem 'ffi'
|
||||
gem 'ffi-rzmq-core'
|
||||
gem 'fog-dnsimple'
|
||||
gem 'gdk_pixbuf2'
|
||||
gem 'gio2'
|
||||
gem 'gitlab-markup'
|
||||
gem 'glib2'
|
||||
# gem 'gobject-introspection' fails on require
|
||||
gem 'gpgme'
|
||||
# gem 'grpc' fails to build
|
||||
gem 'gtk2'
|
||||
gem 'hashie'
|
||||
gem 'highline'
|
||||
gem 'hike'
|
||||
gem 'hitimes'
|
||||
gem 'hpricot'
|
||||
gem 'httpclient'
|
||||
gem 'http-cookie'
|
||||
gem 'iconv'
|
||||
gem 'idn-ruby'
|
||||
gem 'jbuilder'
|
||||
gem 'jekyll'
|
||||
gem 'jmespath'
|
||||
gem 'jwt'
|
||||
gem 'libv8'
|
||||
gem 'libxml-ruby'
|
||||
gem 'magic'
|
||||
gem 'markaby'
|
||||
gem 'method_source'
|
||||
gem 'mini_magick'
|
||||
gem 'msgpack'
|
||||
gem 'mysql2'
|
||||
# gem 'mysql' deprecated
|
||||
gem 'ncursesw'
|
||||
gem 'netrc'
|
||||
gem 'net-scp'
|
||||
gem 'net-ssh'
|
||||
gem 'nokogiri'
|
||||
gem 'opus-ruby'
|
||||
gem 'ovirt-engine-sdk'
|
||||
gem 'pango'
|
||||
gem 'patron'
|
||||
gem 'pcaprub'
|
||||
gem 'pg'
|
||||
gem 'pry'
|
||||
gem 'pry-byebug'
|
||||
gem 'pry-doc'
|
||||
gem 'public_suffix'
|
||||
gem 'puma'
|
||||
gem 'rails'
|
||||
gem 'rainbow'
|
||||
# gem 'rbczmq' deprecated
|
||||
gem 'rbnacl'
|
||||
gem 'rb-readline'
|
||||
gem 're2'
|
||||
gem 'redis'
|
||||
gem 'redis-rack'
|
||||
gem 'rest-client'
|
||||
gem 'rmagick'
|
||||
gem 'rpam2'
|
||||
gem 'rspec'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-performance'
|
||||
gem 'ruby-libvirt'
|
||||
gem 'ruby-lxc'
|
||||
gem 'ruby-progressbar'
|
||||
gem 'ruby-terminfo'
|
||||
gem 'ruby-vips'
|
||||
gem 'rubyzip'
|
||||
gem 'rugged'
|
||||
gem 'sassc'
|
||||
gem 'scrypt'
|
||||
gem 'semian'
|
||||
gem 'sequel'
|
||||
gem 'sequel_pg'
|
||||
gem 'simplecov'
|
||||
gem 'sinatra'
|
||||
gem 'slop'
|
||||
gem 'snappy'
|
||||
gem 'sqlite3'
|
||||
gem 'taglib-ruby'
|
||||
gem 'therubyracer'
|
||||
gem 'thrift'
|
||||
gem 'tilt'
|
||||
gem 'tiny_tds'
|
||||
gem 'treetop'
|
||||
gem 'typhoeus'
|
||||
gem 'tzinfo'
|
||||
gem 'unf_ext'
|
||||
gem 'uuid4r'
|
||||
gem 'whois'
|
||||
# gem 'xapian-ruby' doesn't contain ruby code
|
||||
gem 'zookeeper'
|
||||
end
|
||||
@@ -0,0 +1,75 @@
|
||||
{ stdenv, lib, buildEnv, buildRubyGem, ruby, gemConfig, makeWrapper }:
|
||||
|
||||
/*
|
||||
Example usage:
|
||||
nix-shell -E "(import <nixpkgs> {}).ruby.withPackages (pkgs: with pkgs; [ pry nokogiri ])"
|
||||
|
||||
You can also use this for writing ruby scripts that run anywhere that has nix
|
||||
using a nix-shell shebang:
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i ruby -p "ruby.withPackages (pkgs: with pkgs; [ pry nokogiri ])"
|
||||
|
||||
|
||||
Run the following in the nixpkgs root directory to update the ruby-packages.nix:
|
||||
./maintainers/scripts/update-ruby-packages
|
||||
*/
|
||||
|
||||
let
|
||||
functions = import ../bundled-common/functions.nix { inherit lib gemConfig; };
|
||||
|
||||
buildGems = gemset:
|
||||
let
|
||||
realGemset = if builtins.isAttrs gemset then gemset else import gemset;
|
||||
builtGems =
|
||||
lib.mapAttrs (name: initialAttrs:
|
||||
let
|
||||
attrs = functions.applyGemConfigs ({ inherit ruby; gemName = name; } // initialAttrs);
|
||||
in
|
||||
buildRubyGem (functions.composeGemAttrs ruby builtGems name attrs)
|
||||
) realGemset;
|
||||
in builtGems;
|
||||
|
||||
gems = buildGems (import ../../../top-level/ruby-packages.nix);
|
||||
|
||||
withPackages = selector:
|
||||
let
|
||||
selected = selector gems;
|
||||
|
||||
gemEnv = buildEnv {
|
||||
name = "ruby-gems";
|
||||
paths = selected;
|
||||
pathsToLink = [ "/lib" "/bin" "/nix-support" ];
|
||||
};
|
||||
|
||||
wrappedRuby = stdenv.mkDerivation {
|
||||
name = "wrapped-${ruby.name}";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
for i in ${ruby}/bin/*; do
|
||||
makeWrapper "$i" $out/bin/$(basename "$i") --set GEM_PATH ${gemEnv}/${ruby.gemPath}
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
name = "${ruby.name}-with-packages";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ selected ruby ];
|
||||
|
||||
unpackPhase = ":";
|
||||
|
||||
installPhase = ''
|
||||
for i in ${ruby}/bin/* ${gemEnv}/bin/*; do
|
||||
rm -f $out/bin/$(basename "$i")
|
||||
makeWrapper "$i" $out/bin/$(basename "$i") --set GEM_PATH ${gemEnv}/${ruby.gemPath}
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit wrappedRuby;
|
||||
gems = selected;
|
||||
};
|
||||
};
|
||||
|
||||
in { inherit withPackages gems buildGems; }
|
||||
@@ -0,0 +1,84 @@
|
||||
let
|
||||
cocoapod-plugin = name: ''
|
||||
require "cocoapods"
|
||||
require "#{Gem::Specification.find_by_name(%(${name})).gem_dir}/lib/cocoapods_plugin"
|
||||
'';
|
||||
in {
|
||||
actioncable = [ "action_cable" ];
|
||||
actionmailer = [ "action_mailer" ];
|
||||
actionpack = [ "action_pack" ];
|
||||
actionview = [ "action_view" ];
|
||||
activejob = [ "active_job" ];
|
||||
activemodel = [ "active_model" ];
|
||||
activerecord = [ "active_record" ];
|
||||
activestorage = [ "active_storage" ];
|
||||
activesupport = [ "active_support" ];
|
||||
atk = [ "atk" ];
|
||||
CFPropertyList = [ "cfpropertylist" ];
|
||||
cocoapods-acknowledgements = [ "cocoapods" "cocoapods_acknowledgements" ];
|
||||
cocoapods-art = [ "cocoapods_art" ];
|
||||
cocoapods-browser = [ "cocoapods" "cocoapods_plugin" ];
|
||||
cocoapods-bugsnag = cocoapod-plugin "cocoapods-bugsnag";
|
||||
cocoapods-clean = [ "cocoapods_clean" ];
|
||||
cocoapods-coverage = [ "cocoapods_coverage" ];
|
||||
cocoapods-deintegrate = [ ]; # used by cocoapods
|
||||
cocoapods-dependencies = [ "cocoapods_dependencies" ];
|
||||
cocoapods-deploy = cocoapod-plugin "cocoapods-deploy";
|
||||
cocoapods-generate = cocoapod-plugin "cocoapods-generate";
|
||||
cocoapods-git_url_rewriter = cocoapod-plugin "cocoapods-git_url_rewriter";
|
||||
cocoapods-keys = []; # osx only cocoapod-plugin "cocoapods-keys";
|
||||
cocoapods-open = [ "cocoapods" "cocoapods_plugin" ];
|
||||
cocoapods-packager = [ "cocoapods_packager" ];
|
||||
cocoapods-packager-pro = [ ]; # requires osx
|
||||
cocoapods-plugins = [ "cocoapods_plugins" ];
|
||||
cocoapods-sorted-search = [ ]; # requires osx
|
||||
cocoapods-check = cocoapod-plugin "cocoapods-check";
|
||||
cocoapods-disable-podfile-validations = cocoapod-plugin "cocoapods-disable-podfile-validations";
|
||||
cocoapods-stats = [ "cocoapods_stats" ];
|
||||
cocoapods-testing = [ "cocoapods_testing" ];
|
||||
cocoapods-trunk = [ "cocoapods_trunk" ];
|
||||
cocoapods-try = [ "cocoapods_try" ];
|
||||
cocoapods-try-release-fix = cocoapod-plugin "cocoapods-try-release-fix";
|
||||
digest-sha3 = [ "digest/sha3" ];
|
||||
ffi-compiler = [ "ffi-compiler/loader" ];
|
||||
fog-core = [ "fog/core" ];
|
||||
fog-dnsimple = [ "fog/dnsimple" ];
|
||||
fog-json = [ "fog/json" ];
|
||||
forwardable-extended = [ "forwardable/extended" ];
|
||||
gdk_pixbuf2 = [ "gdk_pixbuf2" ];
|
||||
gitlab-markup = [ "github/markup" ];
|
||||
gobject-introspection = [ "gobject-introspection" ];
|
||||
gtk2 = [ ]; # requires display
|
||||
idn-ruby = [ "idn" ];
|
||||
jekyll-sass-converter = []; # tested through jekyll
|
||||
libxml-ruby = [ "libxml" ];
|
||||
multipart-post = [ "multipart_post" ];
|
||||
unicode-display_width = [ "unicode/display_width" ];
|
||||
nap = [ "rest" ];
|
||||
net-scp = [ "net/scp" ];
|
||||
net-ssh = [ "net/ssh" ];
|
||||
nio4r = [ "nio" ];
|
||||
osx_keychain = [ ]; # requires osx
|
||||
ovirt-engine-sdk = [ "ovirtsdk4" ];
|
||||
pango = [ "pango" ];
|
||||
rack-test = [ "rack/test" ];
|
||||
railties = [ "rails" ];
|
||||
rspec-core = [ "rspec/core" ];
|
||||
rspec-expectations = [ "rspec/expectations" ];
|
||||
rspec-mocks = [ "rspec/mocks" ];
|
||||
rspec-support = [ "rspec/support" ];
|
||||
RubyInline = [ "inline" ];
|
||||
ruby-libvirt = [ "libvirt" ];
|
||||
ruby-lxc = [ "lxc" ];
|
||||
ruby-macho = [ "macho" ];
|
||||
ruby-terminfo = [ "terminfo" ];
|
||||
rubyzip = [ "zip" ];
|
||||
sequel_pg = [ "pg" "sequel" "sequel/adapters/postgresql" "sequel_pg" ];
|
||||
simplecov-html = [ ]; # tested through simplecov
|
||||
sinatra = [ "sinatra/base" ];
|
||||
sprockets-rails = [ "sprockets/rails" ];
|
||||
taglib-ruby = [ "taglib" ];
|
||||
websocket-driver = [ "websocket/driver" ];
|
||||
websocket-extensions = [ "websocket/extensions" ];
|
||||
ZenTest = [ "zentest" ];
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# a generic test suite for all gems for all ruby versions.
|
||||
# use via nix-build.
|
||||
let
|
||||
pkgs = import ../../../.. {};
|
||||
lib = pkgs.lib;
|
||||
stdenv = pkgs.stdenv;
|
||||
|
||||
rubyVersions = with pkgs; [
|
||||
ruby_2_4
|
||||
ruby_2_5
|
||||
ruby_2_6
|
||||
];
|
||||
|
||||
gemTests =
|
||||
(lib.mapAttrs
|
||||
(name: gem: [ name ])
|
||||
pkgs.ruby.gems) //
|
||||
(import ./require_exceptions.nix);
|
||||
|
||||
tests = ruby:
|
||||
lib.mapAttrs (name: gem:
|
||||
let
|
||||
test =
|
||||
if builtins.isList gemTests."${name}"
|
||||
then pkgs.writeText "${name}.rb" ''
|
||||
puts "${name} GEM_HOME: #{ENV['GEM_HOME']}"
|
||||
${lib.concatStringsSep "\n" (map (n: "require '${n}'") gemTests."${name}")}
|
||||
''
|
||||
else pkgs.writeText "${name}.rb" gemTests."${name}";
|
||||
|
||||
deps = ruby.withPackages (g: [ g."${name}" ]);
|
||||
in stdenv.mkDerivation {
|
||||
name = "test-gem-${ruby.name}-${name}";
|
||||
buildInputs = [ deps ];
|
||||
buildCommand = ''
|
||||
INLINEDIR=$PWD ruby ${test}
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
) ruby.gems;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "test-all-ruby-gems";
|
||||
buildInputs = builtins.foldl' (sum: ruby: sum ++ ( builtins.attrValues (tests ruby) )) [] rubyVersions;
|
||||
buildCommand = ''
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# this is a quick and dirty test suite for easier analyzing of breakages in a
|
||||
# manual testing.
|
||||
# For automated testing use the test.nix
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
class FakeGemfile
|
||||
attr_reader :gems
|
||||
|
||||
def initialize
|
||||
@gems = []
|
||||
end
|
||||
|
||||
def source(_source, &block)
|
||||
instance_exec(&block)
|
||||
end
|
||||
|
||||
def gem(name)
|
||||
@gems << name
|
||||
end
|
||||
end
|
||||
|
||||
gemfile = File.expand_path(File.join(__dir__, 'Gemfile'))
|
||||
packages = FakeGemfile.new.instance_eval(File.read(gemfile), gemfile)
|
||||
|
||||
test_cases = packages.map { |pkg| [pkg, "require '#{pkg}'"] }.to_h
|
||||
|
||||
test_cases.merge!(
|
||||
'digest-sha3' => "require 'digest/sha3'",
|
||||
'gitlab-markup' => "require 'github/markup'",
|
||||
'idn-ruby' => "require 'idn'",
|
||||
'net-scp' => "require 'net/scp'",
|
||||
'taglib-ruby' => "require 'taglib'",
|
||||
'net-ssh' => "require 'net/ssh'",
|
||||
'ruby-libvirt' => "require 'libvirt'",
|
||||
'ruby-lxc' => "require 'lxc'",
|
||||
'rubyzip' => "require 'zip'",
|
||||
'sinatra' => "require 'sinatra/base'",
|
||||
'libxml-ruby' => "require 'libxml'",
|
||||
'ruby-terminfo' => "require 'terminfo'",
|
||||
'ovirt-engine-sdk' => "require 'ovirtsdk4'",
|
||||
'fog-dnsimple' => "require 'fog/dnsimple'"
|
||||
)
|
||||
|
||||
test_cases['sequel_pg'] = <<~TEST
|
||||
require 'pg'
|
||||
require 'sequel'
|
||||
require 'sequel/adapters/postgresql'
|
||||
require 'sequel_pg'
|
||||
TEST
|
||||
|
||||
tmpdir = File.expand_path(File.join(__dir__, 'tests'))
|
||||
FileUtils.rm_rf(tmpdir)
|
||||
FileUtils.mkdir_p(tmpdir)
|
||||
|
||||
failing = test_cases.reject do |name, test_case|
|
||||
test_case = <<~SHELL
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i ruby -E "(import ../../../.. {}).ruby.withPackages (r: [ r.#{name} ] )"
|
||||
#{test_case}
|
||||
SHELL
|
||||
|
||||
file = File.join(tmpdir, "#{name}_test.rb")
|
||||
File.write(file, test_case)
|
||||
FileUtils.chmod('u=wrx', file)
|
||||
|
||||
system(file) && FileUtils.rm(file)
|
||||
end
|
||||
|
||||
exit if failing.empty?
|
||||
|
||||
puts "Following gems failed: #{failing.keys.join(' ')}"
|
||||
puts "tests for failing gems remain in #{tmpdir}"
|
||||
exit 1
|
||||
Reference in New Issue
Block a user