diff options
Diffstat (limited to 'pkgs/development/interpreters')
17 files changed, 181 insertions, 43 deletions
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix index 17ca1d1dcd95..24266d596765 100644 --- a/pkgs/development/interpreters/guile/2.0.nix +++ b/pkgs/development/interpreters/guile/2.0.nix @@ -46,7 +46,14 @@ }) ./riscv.patch ] ++ - (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); + (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) + ++ stdenv.lib.optionals stdenv.isDarwin [ + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; + }) + ./filter-mkostemp-darwin.patch + ]; # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 5e458c6e2ccc..fb8e75e8793a 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -2,6 +2,7 @@ , fetchurl, makeWrapper, gawk, pkgconfig , libffi, libtool, readline, gmp, boehmgc, libunistring , coverageAnalysis ? null +, fetchpatch }: # Do either a coverage analysis build or a standard build. @@ -42,8 +43,11 @@ patches = [ ./eai_system.patch ./riscv.patch - ] ++ - (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); + ] ++ stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch + ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; + }); # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". diff --git a/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch new file mode 100644 index 000000000000..8b9b853fb00d --- /dev/null +++ b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch @@ -0,0 +1,28 @@ +Filter incompat. mkostemp(3) flags on macOS 10.12 + +macOS Sierra introduces a mkostemp(3) function which is used when +present. Contrary to the GNUlib version of mkostemp(3) that was used +previously, this version fails with 'invalid argument' when flags other +than from a specified set are passed. From mktemp(3): + +| The mkostemp() function is like mkstemp() but allows specifying +| additional open(2) flags (defined in <fcntl.h>). The permitted flags +| are O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC. + +Signed-off-by: Clemens Lang <cal@macports.org> +Upstream-Status: Submitted [https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23] +--- a/libguile/filesys.c.orig 2017-01-09 00:53:27.000000000 +0100 ++++ b/libguile/filesys.c 2017-01-09 00:54:48.000000000 +0100 +@@ -1486,6 +1486,12 @@ + mode_bits = scm_i_mode_bits (mode); + } + ++#ifdef __APPLE__ ++ /* macOS starting with 10.12 defines mkostemp(2) which is used if defined, ++ * but only accepts some flags according to its manpage. It fails with ++ * invalid argument when other flags are passed. */ ++ open_flags &= O_APPEND | O_SHLOCK | O_EXLOCK | O_CLOEXEC; ++#endif + SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags)); + if (rv == -1) + SCM_SYSERROR; diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 505929df8ef0..894a9b084c68 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -42,7 +42,7 @@ let executable = libPrefix; pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; - inherit pythonForBuild; + inherit hasDistutilsCxxPatch pythonForBuild; } // { inherit ucsEncoding; }; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 7d90e201d192..60ea3bdf4c7f 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -39,7 +39,7 @@ let executable = libPrefix; pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; - inherit pythonForBuild; + inherit hasDistutilsCxxPatch pythonForBuild; }; version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index ef4cab350211..119c0a2728b4 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -13,6 +13,7 @@ with pkgs; , pythonVersion , packageOverrides , sitePackages + , hasDistutilsCxxPatch , pythonForBuild , self }: let @@ -40,7 +41,7 @@ with pkgs; inherit sourceVersion; pythonAtLeast = lib.versionAtLeast pythonVersion; pythonOlder = lib.versionOlder pythonVersion; - inherit pythonForBuild; + inherit hasDistutilsCxxPatch pythonForBuild; }; in { diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index 46cf0475de45..3cdc30b92340 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -24,6 +24,7 @@ let executable = "pypy${if isPy3k then "3" else ""}"; pythonForBuild = self; # No cross-compiling for now. sitePackages = "site-packages"; + hasDistutilsCxxPatch = false; }; pname = passthru.executable; version = with sourceVersion; "${major}.${minor}.${patch}"; diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix index ee556ba05bf5..552f230ee712 100644 --- a/pkgs/development/interpreters/python/pypy/prebuilt.nix +++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix @@ -34,6 +34,7 @@ let executable = "pypy${if isPy3k then "3" else ""}"; pythonForBuild = self; # Not possible to cross-compile with. sitePackages = "site-packages"; + hasDistutilsCxxPatch = false; }; pname = "${passthru.executable}_prebuilt"; version = with sourceVersion; "${major}.${minor}.${patch}"; diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh index 77ec9e9ac0bf..523df5762fad 100644 --- a/pkgs/development/interpreters/python/setup-hook.sh +++ b/pkgs/development/interpreters/python/setup-hook.sh @@ -12,7 +12,9 @@ toPythonPath() { echo $result } -addEnvHooks "$hostOffset" addPythonPath +if [ -z "${dontAddPythonPath:-}" ]; then + addEnvHooks "$hostOffset" addPythonPath +fi # Determinism: The interpreter is patched to write null timestamps when compiling python files. # This way python doesn't try to update them when we freeze timestamps in nix store. diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index ed2bf99d197c..6f333e13c2b2 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -11,14 +11,7 @@ let opString = lib.optionalString; patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; config = import ./config.nix { inherit fetchFromSavannah; }; - rubygemsSrc = import ./rubygems-src.nix { inherit fetchurl; }; - rubygemsPatch = fetchpatch { - url = "https://github.com/zimbatm/rubygems/compare/v2.6.6...v2.6.6-nix.patch"; - sha256 = "0297rdb1m6v75q8665ry9id1s74p9305dv32l95ssf198liaihhd"; - }; - unpackdir = obj: - lib.removeSuffix ".tgz" - (lib.removeSuffix ".tar.gz" obj.name); + rubygems = import ./rubygems { inherit stdenv lib fetchurl fetchpatch; }; # Contains the ruby version heuristics rubyVersion = import ./ruby-version.nix { inherit lib; }; @@ -49,8 +42,10 @@ let , buildEnv, bundler, bundix , libiconv, libobjc, libunwind, Foundation }: - let rubySrc = - if useRailsExpress then fetchFromGitHub { + stdenv.mkDerivation rec { + name = "ruby-${version}"; + + src = if useRailsExpress then fetchFromGitHub { owner = "ruby"; repo = "ruby"; rev = tag; @@ -59,16 +54,6 @@ let url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz"; sha256 = sha256.src; }; - in - stdenv.mkDerivation rec { - name = "ruby-${version}"; - - srcs = [ rubySrc rubygemsSrc ]; - sourceRoot = - if useRailsExpress then - rubySrc.name - else - unpackdir rubySrc; # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. NROFF = if docSupport then "${groff}/bin/nroff" else null; @@ -100,10 +85,7 @@ let })."${ver.majMinTiny}"; postUnpack = '' - cp -r ${unpackdir rubygemsSrc} ${sourceRoot}/rubygems - pushd ${sourceRoot}/rubygems - patch -p1 < ${rubygemsPatch} - popd + cp -r ${rubygems} $sourceRoot/rubygems ''; postPatch = if atLeast25 then '' @@ -146,6 +128,7 @@ let postInstall = '' # Update rubygems pushd rubygems + chmod +w bundler/bundler.gemspec ${buildRuby} setup.rb --destdir $GEM_HOME popd diff --git a/pkgs/development/interpreters/ruby/rubygems-src.nix b/pkgs/development/interpreters/ruby/rubygems-src.nix deleted file mode 100644 index 4e5793f11139..000000000000 --- a/pkgs/development/interpreters/ruby/rubygems-src.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ fetchurl -, version ? "2.7.7" -, sha256 ? "1jsmmd31j8j066b83lin4bbqz19jhrirarzb41f3sjhfdjiwkcjc" -}: -fetchurl { - url = "https://rubygems.org/rubygems/rubygems-${version}.tgz"; - sha256 = sha256; -} diff --git a/pkgs/development/interpreters/ruby/rubygems/0001-add-post-extract-hook.patch b/pkgs/development/interpreters/ruby/rubygems/0001-add-post-extract-hook.patch new file mode 100644 index 000000000000..84d1d52409e5 --- /dev/null +++ b/pkgs/development/interpreters/ruby/rubygems/0001-add-post-extract-hook.patch @@ -0,0 +1,34 @@ +From a6485cfcdf51ff8be452980f93cebfea97f34dec Mon Sep 17 00:00:00 2001 +From: zimbatm <zimbatm@zimbatm.com> +Date: Wed, 21 Sep 2016 09:32:34 +0100 +Subject: [PATCH 1/3] add post-extract hook + +Allows nix to execute scripts just after the gem extraction +--- + lib/rubygems/installer.rb | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb +index d26b1e88..bf18fb7f 100644 +--- a/lib/rubygems/installer.rb ++++ b/lib/rubygems/installer.rb +@@ -848,7 +848,15 @@ TEXT + # Ensures that files can't be installed outside the gem directory. + + def extract_files +- @package.extract_files gem_dir ++ ret = @package.extract_files gem_dir ++ if ENV['NIX_POST_EXTRACT_FILES_HOOK'] ++ puts ++ puts "running NIX_POST_EXTRACT_FILES_HOOK #{ENV['NIX_POST_EXTRACT_FILES_HOOK']} #{gem_dir}" ++ system(ENV['NIX_POST_EXTRACT_FILES_HOOK'], gem_dir.to_s) ++ puts "running NIX_POST_EXTRACT_FILES_HOOK done" ++ puts ++ end ++ ret + end + + ## +-- +2.21.0 + diff --git a/pkgs/development/interpreters/ruby/rubygems/0002-binaries-with-env-shebang.patch b/pkgs/development/interpreters/ruby/rubygems/0002-binaries-with-env-shebang.patch new file mode 100644 index 000000000000..d6eba67e1065 --- /dev/null +++ b/pkgs/development/interpreters/ruby/rubygems/0002-binaries-with-env-shebang.patch @@ -0,0 +1,28 @@ +From 2e1328bcdddd35e557eabdff83ac07f3591dc693 Mon Sep 17 00:00:00 2001 +From: zimbatm <zimbatm@zimbatm.com> +Date: Wed, 21 Sep 2016 19:37:05 +0100 +Subject: [PATCH 2/3] binaries with env shebang + +By default, don't point to the absolute ruby derivation path. As a user +installing a gem in the home, it would freeze the selected ruby version +to the currently-installed ruby derivation. +--- + lib/rubygems/dependency_installer.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb +index 34620860..00ab31d9 100644 +--- a/lib/rubygems/dependency_installer.rb ++++ b/lib/rubygems/dependency_installer.rb +@@ -18,7 +18,7 @@ class Gem::DependencyInstaller + extend Gem::Deprecate + + DEFAULT_OPTIONS = { # :nodoc: +- :env_shebang => false, ++ :env_shebang => true, + :document => %w[ri], + :domain => :both, # HACK dup + :force => false, +-- +2.21.0 + diff --git a/pkgs/development/interpreters/ruby/rubygems/0003-gem-install-default-to-user.patch b/pkgs/development/interpreters/ruby/rubygems/0003-gem-install-default-to-user.patch new file mode 100644 index 000000000000..138d432c8203 --- /dev/null +++ b/pkgs/development/interpreters/ruby/rubygems/0003-gem-install-default-to-user.patch @@ -0,0 +1,26 @@ +From d69249d0ff210316121b44d971ddd2439b1bc393 Mon Sep 17 00:00:00 2001 +From: zimbatm <zimbatm@zimbatm.com> +Date: Wed, 21 Sep 2016 09:40:39 +0100 +Subject: [PATCH 3/3] gem install default to user + +Default to not installing gems to the read-only system derivation. +--- + lib/rubygems/path_support.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/rubygems/path_support.rb b/lib/rubygems/path_support.rb +index ed680d65..749b9ea6 100644 +--- a/lib/rubygems/path_support.rb ++++ b/lib/rubygems/path_support.rb +@@ -23,7 +23,7 @@ class Gem::PathSupport + # hashtable, or defaults to ENV, the system environment. + # + def initialize(env) +- @home = env["GEM_HOME"] || Gem.default_dir ++ @home = env["GEM_HOME"] || Gem.user_dir + + if File::ALT_SEPARATOR + @home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR) +-- +2.21.0 + diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix new file mode 100644 index 000000000000..db28cbe28fae --- /dev/null +++ b/pkgs/development/interpreters/ruby/rubygems/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchurl, fetchpatch }: + +stdenv.mkDerivation rec { + name = "rubygems"; + version = "3.0.3"; + + src = fetchurl { + url = "https://rubygems.org/rubygems/rubygems-${version}.tgz"; + sha256 = "0b6b9ads8522804xv8b8498gqwsv4qawv13f81kyc7g966y7lfmy"; + }; + + patches = [ + ./0001-add-post-extract-hook.patch + ./0002-binaries-with-env-shebang.patch + ./0003-gem-install-default-to-user.patch + ]; + + installPhase = '' + runHook preInstall + cp -r . $out + runHook postInstall + ''; + + meta = with lib; { + description = "Package management framework for Ruby"; + homepage = https://rubygems.org/; + license = with licenses; [ mit /* or */ ruby ]; + maintainers = with maintainers; [ qyliss zimbatm ]; + }; +} diff --git a/pkgs/development/interpreters/tcl/8.6.nix b/pkgs/development/interpreters/tcl/8.6.nix index 61d67a874e90..d76ceb3421de 100644 --- a/pkgs/development/interpreters/tcl/8.6.nix +++ b/pkgs/development/interpreters/tcl/8.6.nix @@ -2,10 +2,10 @@ callPackage ./generic.nix (args // rec { release = "8.6"; - version = "${release}.6"; + version = "${release}.9"; src = fetchurl { url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz"; - sha256 = "01zypqhy57wvh1ikk28bg733sk5kf4q568pq9v6fvcz4h6bl0rd2"; + sha256 = "0kjzj7mkzfnb7ksxanbibibfpciyvsh5ffdlhs0bmfc75kgd435d"; }; }) diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix index 11c02acf1de3..cd377e70cd9c 100644 --- a/pkgs/development/interpreters/tcl/generic.nix +++ b/pkgs/development/interpreters/tcl/generic.nix @@ -33,11 +33,12 @@ stdenv.mkDerivation rec { postInstall = '' make install-private-headers ln -s $out/bin/tclsh${release} $out/bin/tclsh + ln -s $out/lib/libtcl${release}.so $out/lib/libtcl.so ''; meta = with stdenv.lib; { - description = "The Tcl scription language"; - homepage = http://www.tcl.tk/; + description = "The Tcl scripting language"; + homepage = https://www.tcl.tk/; license = licenses.tcltk; platforms = platforms.all; maintainers = with maintainers; [ vrthra ]; |