Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 625 lines 17 kB view raw
1# The standard set of gems in nixpkgs including potential fixes. 2# 3# The gemset is derived from two points of entry: 4# - An attrset describing a gem, including version, source and dependencies 5# This is just meta data, most probably automatically generated by a tool 6# like Bundix (https://github.com/aflatter/bundix). 7# { 8# name = "bundler"; 9# version = "1.6.5"; 10# sha256 = "1s4x0f5by9xs2y24jk6krq5ky7ffkzmxgr4z1nhdykdmpsi2zd0l"; 11# dependencies = [ "rake" ]; 12# } 13# - An optional derivation that may override how the gem is built. For popular 14# gems that don't behave correctly, fixes are already provided in the form of 15# derivations. 16# 17# This seperates "what to build" (the exact gem versions) from "how to build" 18# (to make gems behave if necessary). 19 20{ lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which 21, libiconv, postgresql, v8, clang, sqlite, zlib, imagemagick 22, pkgconfig , ncurses, xapian, gpgme, utillinux, tzdata, icu, libffi 23, cmake, libssh2, openssl, libmysqlclient, darwin, git, perl, pcre, gecode_3, curl 24, msgpack, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem 25, cairo, re2, rake, gobject-introspection, gdk-pixbuf, zeromq, czmq, graphicsmagick, libcxx 26, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz 27, bison, flex, pango, python3, patchelf, binutils, freetds, wrapGAppsHook, atk 28, bundler, libsass, libselinux ? null, libsepol ? null 29}@args: 30 31let 32 rainbow_rake = buildRubyGem { 33 pname = "rake"; 34 gemName = "rake"; 35 source.sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n"; 36 type = "gem"; 37 version = "12.0.0"; 38 }; 39in 40 41{ 42 atk = attrs: { 43 dependencies = attrs.dependencies ++ [ "gobject-introspection" ]; 44 nativeBuildInputs = [ rake bundler pkgconfig ]; 45 propagatedBuildInputs = [ gobject-introspection wrapGAppsHook atk ]; 46 }; 47 48 bundler = attrs: 49 let 50 templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/"; 51 in { 52 # patching shebangs would fail on the templates/Executable file, so we 53 # temporarily remove the executable flag. 54 preFixup = "chmod -x $out/${templates}/Executable"; 55 postFixup = '' 56 chmod +x $out/${templates}/Executable 57 58 # Allows to load another bundler version 59 sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle 60 ''; 61 }; 62 63 cairo = attrs: { 64 nativeBuildInputs = [ pkgconfig ]; 65 buildInputs = [ gtk2 pcre xorg.libpthreadstubs xorg.libXdmcp]; 66 }; 67 68 cairo-gobject = attrs: { 69 nativeBuildInputs = [ pkgconfig ]; 70 buildInputs = [ cairo pcre xorg.libpthreadstubs xorg.libXdmcp ]; 71 }; 72 73 charlock_holmes = attrs: { 74 buildInputs = [ which icu zlib ]; 75 }; 76 77 cld3 = attrs: { 78 nativeBuildInputs = [ pkgconfig ]; 79 buildInputs = [ protobuf ]; 80 }; 81 82 cocoapods-acknowledgements = attrs: { 83 dependencies = attrs.dependencies ++ [ "cocoapods" ]; 84 }; 85 86 cocoapods-deploy = attrs: { 87 dependencies = [ "cocoapods" ]; 88 }; 89 90 cocoapods-disable-podfile-validations = attrs: { 91 dependencies = [ "cocoapods" ]; 92 }; 93 94 cocoapods-generate = attrs: { 95 dependencies = attrs.dependencies ++ [ "cocoapods" ]; 96 }; 97 98 cocoapods-git_url_rewriter = attrs: { 99 dependencies = [ "cocoapods" ]; 100 }; 101 102 cocoapods-keys = attrs: { 103 dependencies = attrs.dependencies ++ [ "cocoapods" ]; 104 }; 105 106 cocoapods-open = attrs: { 107 dependencies = [ "cocoapods" ]; 108 }; 109 110 cocoapods-try-release-fix = attrs: { 111 dependencies = [ "cocoapods" ]; 112 }; 113 114 curb = attrs: { 115 buildInputs = [ curl ]; 116 }; 117 118 curses = attrs: { 119 buildInputs = [ ncurses ]; 120 }; 121 122 dep-selector-libgecode = attrs: { 123 USE_SYSTEM_GECODE = true; 124 postInstall = '' 125 installPath=$(cat $out/nix-support/gem-meta/install-path) 126 sed -i $installPath/lib/dep-selector-libgecode.rb -e 's@VENDORED_GECODE_DIR =.*@VENDORED_GECODE_DIR = "${gecode_3}"@' 127 ''; 128 }; 129 130 digest-sha3 = attrs: { 131 hardeningDisable = [ "format" ]; 132 }; 133 134 ethon = attrs: { 135 dontBuild = false; 136 postPatch = '' 137 substituteInPlace lib/ethon/curls/settings.rb \ 138 --replace "libcurl" "${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary}" 139 ''; 140 }; 141 142 fog-dnsimple = attrs: 143 lib.optionalAttrs (lib.versionOlder attrs.version "1.0.1") { 144 postInstall = '' 145 cd $(cat $out/nix-support/gem-meta/install-path) 146 rm {$out/bin,bin,../../bin}/{setup,console} 147 ''; 148 }; 149 150 redis-rack = attrs: { 151 dontBuild = false; 152 preBuild = '' 153 exec 3>&1 154 output="$(gem build $gemspec | tee >(cat - >&3))" 155 exec 3>&- 156 sed -i 's!"rake".freeze!!' $gemspec 157 ''; 158 }; 159 160 ffi-rzmq-core = attrs: { 161 postInstall = '' 162 installPath=$(cat $out/nix-support/gem-meta/install-path) 163 sed -i $installPath/lib/ffi-rzmq-core/libzmq.rb -e 's@inside_gem =.*@inside_gem = "${zeromq}/lib"@' 164 ''; 165 }; 166 167 mini_magick = attrs: { 168 postInstall = '' 169 installPath=$(cat $out/nix-support/gem-meta/install-path) 170 echo -e "\nENV['PATH'] += ':${graphicsmagick}/bin'\n" >> $installPath/lib/mini_magick/configuration.rb 171 ''; 172 }; 173 174 do_sqlite3 = attrs: { 175 buildInputs = [ sqlite ]; 176 }; 177 178 eventmachine = attrs: { 179 buildInputs = [ openssl ]; 180 }; 181 182 ffi = attrs: { 183 nativeBuildInputs = [ pkgconfig ]; 184 buildInputs = [ libffi ]; 185 }; 186 187 gdk_pixbuf2 = attrs: { 188 nativeBuildInputs = [ pkgconfig bundler rake ]; 189 propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gdk-pixbuf ]; 190 }; 191 192 gpgme = attrs: { 193 buildInputs = [ gpgme ]; 194 buildFlags = [ "--use-system-libraries" ]; 195 }; 196 197 gio2 = attrs: { 198 nativeBuildInputs = [ pkgconfig ]; 199 buildInputs = [ gtk2 pcre gobject-introspection ] ++ lib.optionals stdenv.isLinux [ utillinux libselinux libsepol ]; 200 }; 201 202 gitlab-markup = attrs: { meta.priority = 1; }; 203 204 glib2 = attrs: { 205 nativeBuildInputs = [ pkgconfig ]; 206 buildInputs = [ gtk2 pcre ]; 207 }; 208 209 gtk2 = attrs: { 210 nativeBuildInputs = [ 211 binutils pkgconfig 212 ] ++ lib.optionals stdenv.isLinux [ 213 utillinux libselinux libsepol 214 ]; 215 propagatedBuildInputs = [ 216 atk 217 gdk-pixbuf 218 fribidi 219 gobject-introspection 220 gtk2 221 harfbuzz 222 pcre 223 xorg.libpthreadstubs 224 xorg.libXdmcp 225 ]; 226 # CFLAGS must be set for this gem to detect gdkkeysyms.h correctly 227 # CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I/non-existent-path"; 228 }; 229 230 gobject-introspection = attrs: { 231 nativeBuildInputs = [ pkgconfig pcre ]; 232 propagatedBuildInputs = [ gobject-introspection wrapGAppsHook glib ]; 233 }; 234 235 grpc = attrs: { 236 nativeBuildInputs = [ pkgconfig ]; 237 buildInputs = [ openssl ]; 238 hardeningDisable = [ "format" ]; 239 NIX_CFLAGS_COMPILE = toString [ 240 "-Wno-error=stringop-overflow" 241 "-Wno-error=implicit-fallthrough" 242 "-Wno-error=sizeof-pointer-memaccess" 243 "-Wno-error=cast-function-type" 244 "-Wno-error=class-memaccess" 245 "-Wno-error=ignored-qualifiers" 246 "-Wno-error=tautological-compare" 247 "-Wno-error=stringop-truncation" 248 ]; 249 dontBuild = false; 250 postPatch = '' 251 substituteInPlace Makefile \ 252 --replace '-Wno-invalid-source-encoding' "" 253 ''; 254 }; 255 256 hitimes = attrs: { 257 buildInputs = 258 stdenv.lib.optionals stdenv.isDarwin 259 [ darwin.apple_sdk.frameworks.CoreServices ]; 260 }; 261 262 iconv = attrs: { 263 buildFlags = lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}"; 264 }; 265 266 idn-ruby = attrs: { 267 buildInputs = [ libidn ]; 268 }; 269 270 # disable bundle install as it can't install anything in addition to what is 271 # specified in pkgs/applications/misc/jekyll/Gemfile anyway. Also do chmod_R 272 # to compensate for read-only files in site_template in nix store. 273 jekyll = attrs: { 274 postInstall = '' 275 installPath=$(cat $out/nix-support/gem-meta/install-path) 276 sed -i $installPath/lib/jekyll/commands/new.rb \ 277 -e 's@Exec.run("bundle", "install"@Exec.run("true"@' \ 278 -e 's@FileUtils.cp_r site_template + "/.", path@FileUtils.cp_r site_template + "/.", path; FileUtils.chmod_R "u+w", path@' 279 ''; 280 }; 281 282 # note that you need version >= v3.16.14.8, 283 # otherwise the gem will fail to link to the libv8 binary. 284 # see: https://github.com/cowboyd/libv8/pull/161 285 libv8 = attrs: { 286 buildInputs = [ which v8 python ]; 287 buildFlags = [ "--with-system-v8=true" ]; 288 dontBuild = false; 289 postPatch = '' 290 substituteInPlace ext/libv8/extconf.rb \ 291 --replace "location = Libv8::Location::Vendor.new" \ 292 "location = Libv8::Location::System.new" 293 ''; 294 }; 295 296 execjs = attrs: { 297 propagatedBuildInputs = [ v8 ]; 298 }; 299 300 libxml-ruby = attrs: { 301 buildFlags = [ 302 "--with-xml2-lib=${libxml2.out}/lib" 303 "--with-xml2-include=${libxml2.dev}/include/libxml2" 304 ]; 305 }; 306 307 mathematical = attrs: { 308 buildInputs = [ 309 cmake 310 bison 311 flex 312 glib 313 pkgconfig 314 cairo 315 pango 316 gdk-pixbuf 317 libxml2 318 python3 319 ]; 320 321 # The ruby build script takes care of this 322 dontUseCmakeConfigure = true; 323 324 postInstall = '' 325 # Reduce output size by a lot, and remove some unnecessary references. 326 # The ext directory should only be required at build time, so 327 # can be deleted now. 328 rm -r $out/${ruby.gemPath}/gems/mathematical-${attrs.version}/ext \ 329 $out/${ruby.gemPath}/extensions/*/*/mathematical-${attrs.version}/gem_make.out 330 ''; 331 332 # For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here 333 postFixup = lib.optionalString stdenv.isLinux '' 334 soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so" 335 ${patchelf}/bin/patchelf \ 336 --set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \ 337 "$soPath" 338 ''; 339 }; 340 341 magic = attrs: { 342 buildInputs = [ file ]; 343 postInstall = '' 344 installPath=$(cat $out/nix-support/gem-meta/install-path) 345 sed -e 's@ENV\["MAGIC_LIB"\] ||@ENV\["MAGIC_LIB"\] || "${file}/lib/libmagic.so" ||@' -i $installPath/lib/magic/api.rb 346 ''; 347 }; 348 349 metasploit-framework = attrs: { 350 preInstall = '' 351 export HOME=$TMPDIR 352 ''; 353 }; 354 355 msgpack = attrs: { 356 buildInputs = [ msgpack ]; 357 }; 358 359 mysql = attrs: { 360 buildInputs = [ libmysqlclient zlib openssl ]; 361 }; 362 363 mysql2 = attrs: { 364 buildInputs = [ libmysqlclient zlib openssl ]; 365 }; 366 367 ncursesw = attrs: { 368 buildInputs = [ ncurses ]; 369 buildFlags = [ 370 "--with-cflags=-I${ncurses.dev}/include" 371 "--with-ldflags=-L${ncurses.out}/lib" 372 ]; 373 }; 374 375 nokogiri = attrs: { 376 buildFlags = [ 377 "--use-system-libraries" 378 "--with-zlib-dir=${zlib.dev}" 379 "--with-xml2-lib=${libxml2.out}/lib" 380 "--with-xml2-include=${libxml2.dev}/include/libxml2" 381 "--with-xslt-lib=${libxslt.out}/lib" 382 "--with-xslt-include=${libxslt.dev}/include" 383 "--with-exslt-lib=${libxslt.out}/lib" 384 "--with-exslt-include=${libxslt.dev}/include" 385 ] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}"; 386 }; 387 388 opus-ruby = attrs: { 389 dontBuild = false; 390 postPatch = '' 391 substituteInPlace lib/opus-ruby.rb \ 392 --replace "ffi_lib 'opus'" \ 393 "ffi_lib '${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}'" 394 ''; 395 }; 396 397 ovirt-engine-sdk = attrs: { 398 buildInputs = [ curl libxml2 ]; 399 }; 400 401 pango = attrs: { 402 nativeBuildInputs = [ 403 pkgconfig 404 fribidi 405 harfbuzz 406 pcre 407 xorg.libpthreadstubs 408 xorg.libXdmcp 409 ]; 410 propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gtk2 ]; 411 }; 412 413 patron = attrs: { 414 buildInputs = [ curl ]; 415 }; 416 417 pcaprub = attrs: { 418 buildInputs = [ libpcap ]; 419 }; 420 421 pg = attrs: { 422 buildFlags = [ 423 "--with-pg-config=${postgresql}/bin/pg_config" 424 ]; 425 }; 426 427 puma = attrs: { 428 buildInputs = [ openssl ]; 429 }; 430 431 rainbow = attrs: { 432 buildInputs = [ rainbow_rake ]; 433 }; 434 435 rbczmq = { ... }: { 436 buildInputs = [ zeromq czmq ]; 437 buildFlags = [ "--with-system-libs" ]; 438 }; 439 440 rbnacl = spec: 441 if lib.versionOlder spec.version "6.0.0" then { 442 postInstall = '' 443 sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \ 444 RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}' 445 " 446 ''; 447 } else { 448 dontBuild = false; 449 postPatch = '' 450 substituteInPlace lib/rbnacl/sodium.rb \ 451 --replace 'ffi_lib ["sodium"' \ 452 'ffi_lib ["${libsodium}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}"' 453 ''; 454 }; 455 456 re2 = attrs: { 457 buildInputs = [ re2 ]; 458 }; 459 460 rmagick = attrs: { 461 nativeBuildInputs = [ pkgconfig ]; 462 buildInputs = [ imagemagick which ]; 463 }; 464 465 rpam2 = attrs: { 466 buildInputs = [ linux-pam ]; 467 }; 468 469 ruby-libvirt = attrs: { 470 buildInputs = [ libvirt pkgconfig ]; 471 buildFlags = [ 472 "--with-libvirt-include=${libvirt}/include" 473 "--with-libvirt-lib=${libvirt}/lib" 474 ]; 475 }; 476 477 ruby-lxc = attrs: { 478 buildInputs = [ lxc ]; 479 }; 480 481 ruby-terminfo = attrs: { 482 buildInputs = [ ncurses ]; 483 buildFlags = [ 484 "--with-cflags=-I${ncurses.dev}/include" 485 "--with-ldflags=-L${ncurses.out}/lib" 486 ]; 487 }; 488 489 ruby-vips = attrs: { 490 postInstall = '' 491 cd "$(cat $out/nix-support/gem-meta/install-path)" 492 493 substituteInPlace lib/vips.rb \ 494 --replace "glib-2.0" "${glib.out}/lib/libglib-2.0${stdenv.hostPlatform.extensions.sharedLibrary}" 495 496 substituteInPlace lib/vips.rb \ 497 --replace "gobject-2.0" "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}" 498 499 substituteInPlace lib/vips.rb \ 500 --replace "vips_libname = 'vips'" "vips_libname = '${vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}'" 501 ''; 502 }; 503 504 rugged = attrs: { 505 nativeBuildInputs = [ pkgconfig ]; 506 buildInputs = [ which cmake openssl libssh2 zlib ]; 507 dontUseCmakeConfigure = true; 508 }; 509 510 sassc = attrs: { 511 nativeBuildInputs = [ rake ]; 512 dontBuild = false; 513 SASS_LIBSASS_PATH = toString libsass; 514 postPatch = '' 515 substituteInPlace lib/sassc/native.rb \ 516 --replace 'gem_root = spec.gem_dir' 'gem_root = File.join(__dir__, "../../")' 517 ''; 518 } // (lib.optionalAttrs stdenv.isDarwin { 519 # https://github.com/NixOS/nixpkgs/issues/19098 520 buildFlags = [ "--disable-lto" ]; 521 }); 522 523 scrypt = attrs: lib.optionalAttrs stdenv.isDarwin { 524 dontBuild = false; 525 postPatch = '' 526 sed -i -e "s/-arch i386//" Rakefile ext/scrypt/Rakefile 527 ''; 528 }; 529 530 semian = attrs: { 531 buildInputs = [ openssl ]; 532 }; 533 534 sequel_pg = attrs: { 535 buildInputs = [ postgresql ]; 536 }; 537 538 snappy = attrs: { 539 buildInputs = [ args.snappy ]; 540 }; 541 542 sqlite3 = attrs: { 543 buildFlags = [ 544 "--with-sqlite3-include=${sqlite.dev}/include" 545 "--with-sqlite3-lib=${sqlite.out}/lib" 546 ]; 547 }; 548 549 rb-readline = attrs: { 550 dontBuild = false; 551 postPatch = '' 552 substituteInPlace lib/rbreadline.rb \ 553 --replace 'infocmp' '${ncurses}/bin/infocmp' 554 ''; 555 }; 556 557 taglib-ruby = attrs: { 558 buildInputs = [ taglib ]; 559 }; 560 561 thrift = attrs: { 562 # See: https://stackoverflow.com/questions/36378190/cant-install-thrift-gem-on-os-x-el-capitan/36523125#36523125 563 # Note that thrift-0.8.0 is a dependency of fluent-plugin-scribe which is a dependency of fluentd. 564 buildFlags = lib.optional (stdenv.isDarwin && lib.versionOlder attrs.version "0.9.2.0") 565 "--with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-macro-redefined -Wno-shift-negative-value\""; 566 }; 567 568 timfel-krb5-auth = attrs: { 569 buildInputs = [ kerberos ]; 570 }; 571 572 tiny_tds = attrs: { 573 nativeBuildInputs = [ pkgconfig openssl ]; 574 buildInputs = [ freetds ]; 575 }; 576 577 typhoeus = attrs: { 578 buildInputs = [ curl ]; 579 }; 580 581 tzinfo = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") { 582 dontBuild = false; 583 postPatch = 584 let 585 path = if lib.versionAtLeast attrs.version "2.0" 586 then "lib/tzinfo/data_sources/zoneinfo_data_source.rb" 587 else "lib/tzinfo/zoneinfo_data_source.rb"; 588 in 589 '' 590 substituteInPlace ${path} \ 591 --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" 592 ''; 593 }; 594 595 uuid4r = attrs: { 596 buildInputs = [ which libossp_uuid ]; 597 }; 598 599 xapian-ruby = attrs: { 600 # use the system xapian 601 dontBuild = false; 602 nativeBuildInputs = [ rake pkgconfig bundler ]; 603 buildInputs = [ xapian zlib ]; 604 postPatch = '' 605 cp ${./xapian-Rakefile} Rakefile 606 ''; 607 preInstall = '' 608 export XAPIAN_CONFIG=${xapian}/bin/xapian-config 609 ''; 610 }; 611 612 zlib = attrs: { 613 buildInputs = [ zlib ]; 614 }; 615 616 zookeeper = attrs: { 617 buildInputs = stdenv.lib.optionals stdenv.isDarwin [ darwin.cctools ]; 618 dontBuild = false; 619 postPatch = '' 620 sed -i ext/extconf.rb -e "4a \ 621 FileUtils.cp '${./zookeeper-ftbfs-with-gcc-8.patch}', 'patches/zkc-3.4.5-gcc-8.patch' 622 " 623 ''; 624 }; 625}