diff options
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r-- | pkgs/development/interpreters/cling/default.nix | 9 | ||||
-rw-r--r-- | pkgs/development/interpreters/jruby/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/interpreters/lua-5/default.nix | 30 | ||||
-rw-r--r-- | pkgs/development/interpreters/lua-5/interpreter.nix | 37 | ||||
-rw-r--r-- | pkgs/development/interpreters/lua-5/liblua.so.patch | 60 | ||||
-rw-r--r-- | pkgs/development/interpreters/lua-5/lua-dso.make (renamed from pkgs/development/interpreters/lua-5/lua-5.3-dso.make) | 6 | ||||
-rw-r--r-- | pkgs/development/interpreters/pure/default.nix | 8 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/default.nix | 30 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/rubygems/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/interpreters/spidermonkey/68.nix | 2 | ||||
-rw-r--r-- | pkgs/development/interpreters/wasmer/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/interpreters/wasmtime/default.nix | 2 |
12 files changed, 65 insertions, 136 deletions
diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index dbc2751e789..73ed5b523dd 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -10,6 +10,7 @@ , runCommandNoCC , llvmPackages_5 , glibc +, ncurses }: let @@ -38,8 +39,8 @@ let chmod -R a+w ./tools/cling ''; - nativeBuildInputs = [ python3 git cmake ]; - buildInputs = [ libffi llvmPackages_5.llvm zlib ]; + nativeBuildInputs = [ python3 git cmake llvmPackages_5.llvm.dev ]; + buildInputs = [ libffi llvmPackages_5.llvm zlib ncurses ]; strictDeps = true; @@ -76,8 +77,8 @@ let "-nostdinc" "-nostdinc++" "-isystem" "${lib.getDev stdenv.cc.libc}/include" - "-I" "${unwrapped}/include" - "-I" "${unwrapped}/lib/clang/5.0.2/include" + "-I" "${lib.getDev unwrapped}/include" + "-I" "${lib.getLib unwrapped}/lib/clang/5.0.2/include" ]; # Autodetect the include paths for the compiler used to build Cling, in the same way Cling does at diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix index be1a1a15c84..4e540dc8aac 100644 --- a/pkgs/development/interpreters/jruby/default.nix +++ b/pkgs/development/interpreters/jruby/default.nix @@ -6,11 +6,11 @@ rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "5" "7" ""; jruby = stdenv.mkDerivation rec { pname = "jruby"; - version = "9.2.16.0"; + version = "9.2.17.0"; src = fetchurl { url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz"; - sha256 = "sha256-WuJ/FJ9z8/6k80NZy7dzwl2dmH5yte3snouTlXmX6zA="; + sha256 = "sha256-dwHTU3s6YG0nZaxtXEDmdd2qAdPOutJqIaZuOq3VwgI="; }; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix index 43ed70fee1d..95b593fb5db 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -1,27 +1,12 @@ # similar to interpreters/python/default.nix { stdenv, lib, callPackage, fetchurl, fetchpatch }: -let - dsoPatch51 = fetchurl { - url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51"; - sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw"; - name = "lua-arch.patch"; - }; - - dsoPatch52 = fetchurl { - url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/liblua.so.patch?h=packages/lua52"; - sha256 = "1by1dy4ql61f5c6njq9ibf9kaqm3y633g2q8j54iyjr4cxvqwqz9"; - name = "lua-arch.patch"; - }; -in rec { +rec { lua5_4 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "4"; patch = "2"; }; hash = "0ksj5zpj74n0jkamy3di1p6l10v4gjnd2zjnb453qc6px6bhsmqi"; - patches = if stdenv.isDarwin then [ ./5.4.darwin.patch ] else [ - # build lua as a shared library as well, MIT-licensed from - # https://github.com/archlinux/svntogit-packages/tree/packages/lua/trunk - ./liblua.so.patch - ]; + + patches = lib.optional stdenv.isDarwin ./5.4.darwin.patch; }; lua5_4_compat = lua5_4.override({ @@ -35,11 +20,6 @@ in rec { patches = lib.optionals stdenv.isDarwin [ ./5.2.darwin.patch ]; - postConfigure = lib.optionalString (!stdenv.isDarwin) '' - cat ${./lua-5.3-dso.make} >> src/Makefile - sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile - ''; - postBuild = lib.optionalString (!stdenv.isDarwin) '' ( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so ) ''; @@ -53,7 +33,7 @@ in rec { lua5_2 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "2"; patch = "4"; }; hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"; - patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [ dsoPatch52 ]; + patches = lib.optional stdenv.isDarwin ./5.2.darwin.patch; }; lua5_2_compat = lua5_2.override({ @@ -64,7 +44,7 @@ in rec { lua5_1 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "1"; patch = "5"; }; hash = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"; - patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch51 ]) + patches = (lib.optional stdenv.isDarwin ./5.1.darwin.patch) ++ [ ./CVE-2014-5461.patch ]; }; diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 35a074add09..fd8c47d751b 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -11,6 +11,15 @@ let luaPackages = callPackage ../../lua-modules {lua=self; overrides=packageOverrides;}; +plat = if stdenv.isLinux then "linux" + else if stdenv.isDarwin then "macosx" + else if stdenv.hostPlatform.isMinGW then "mingw" + else if stdenv.isFreeBSD then "freebsd" + else if stdenv.isSunOS then "solaris" + else if stdenv.hostPlatform.isBSD then "bsd" + else if stdenv.hostPlatform.isUnix then "posix" + else "generic"; + self = stdenv.mkDerivation rec { pname = "lua"; luaversion = with sourceVersion; "${major}.${minor}"; @@ -29,6 +38,14 @@ self = stdenv.mkDerivation rec { inherit patches; + postPatch = lib.optionalString (!stdenv.isDarwin) '' + # Add a target for a shared library to the Makefile. + sed -e '1s/^/LUA_SO = liblua.so/' \ + -e 's/ALL_T *= */&$(LUA_SO) /' \ + -i src/Makefile + cat ${./lua-dso.make} >> src/Makefile + ''; + # see configurePhase for additional flags (with space) makeFlags = [ "INSTALL_TOP=${placeholder "out"}" @@ -36,21 +53,17 @@ self = stdenv.mkDerivation rec { "R=${version}" "LDFLAGS=-fPIC" "V=${luaversion}" - ] ++ (if stdenv.isDarwin then [ - "PLAT=macosx" - ] else [ - "PLAT=linux" - ]) ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [ - "CC=${stdenv.hostPlatform.config}-gcc" - "RANLIB=${stdenv.hostPlatform.config}-ranlib" - ] else []) - ; + "PLAT=${plat}" + "CC=${stdenv.cc.targetPrefix}cc" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + ]; configurePhase = '' runHook preConfigure - makeFlagsArray+=(CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" ) - makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"}) + makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(${ + if lib.versionAtLeast luaversion "5.2" then "SYSCFLAGS" else "MYCFLAGS"})' ) + makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" ) @@ -80,7 +93,7 @@ self = stdenv.mkDerivation rec { Description: An Extensible Extension Language Version: ${version} Requires: - Libs: -L$out/lib -llua -lm + Libs: -L$out/lib -llua Cflags: -I$out/include EOF ln -s "$out/lib/pkgconfig/lua.pc" "$out/lib/pkgconfig/lua-${luaversion}.pc" diff --git a/pkgs/development/interpreters/lua-5/liblua.so.patch b/pkgs/development/interpreters/lua-5/liblua.so.patch deleted file mode 100644 index 197832116c1..00000000000 --- a/pkgs/development/interpreters/lua-5/liblua.so.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Makefile b/Makefile -index 416f444..eeaff03 100644 ---- a/Makefile -+++ b/Makefile -@@ -52,7 +52,7 @@ R= $V.0 - all: $(PLAT) - - $(PLATS) help test clean: -- @cd src && $(MAKE) $@ -+ @cd src && $(MAKE) $@ V=$(V) R=$(R) - - install: dummy - cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) -diff --git a/src/Makefile b/src/Makefile -index 514593d..372a6dc 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -33,6 +33,7 @@ CMCFLAGS= -Os - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris - - LUA_A= liblua.a -+LUA_SO= liblua.so - CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o - LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o - BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) -@@ -44,7 +45,7 @@ LUAC_T= luac - LUAC_O= luac.o - - ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) --ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) - ALL_A= $(LUA_A) - - # Targets start here. -@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -+$(LUA_SO): $(CORE_O) $(LIB_O) -+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO) -+ -+ - $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - -diff --git a/src/luaconf.h b/src/luaconf.h -index bdf927e..7e15198 100644 ---- a/src/luaconf.h -+++ b/src/luaconf.h -@@ -227,7 +227,7 @@ - - #else /* }{ */ - --#define LUA_ROOT "/usr/local/" -+#define LUA_ROOT "/usr/" - #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" - #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" - diff --git a/pkgs/development/interpreters/lua-5/lua-5.3-dso.make b/pkgs/development/interpreters/lua-5/lua-dso.make index c70dbc4f9cc..19c57685677 100644 --- a/pkgs/development/interpreters/lua-5/lua-5.3-dso.make +++ b/pkgs/development/interpreters/lua-5/lua-dso.make @@ -1,8 +1,4 @@ - -LUA_SO=liblua.so - $(LUA_SO): $(CORE_O) $(LIB_O) - $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) + $(CC) -shared $(LIBS) -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? $(MYLDFLAGS) ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ln -sf $(LUA_SO).$(R) $(LUA_SO) - diff --git a/pkgs/development/interpreters/pure/default.nix b/pkgs/development/interpreters/pure/default.nix index 863df66899b..d1c03bba5a3 100644 --- a/pkgs/development/interpreters/pure/default.nix +++ b/pkgs/development/interpreters/pure/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, makeWrapper, - llvm, gmp, mpfr, readline, bison, flex }: + libllvm, gmp, mpfr, readline, bison, flex }: stdenv.mkDerivation rec { baseName="pure"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ bison flex ]; - propagatedBuildInputs = [ llvm gmp mpfr readline ]; + propagatedBuildInputs = [ libllvm gmp mpfr readline ]; NIX_LDFLAGS = "-lLLVMJIT"; postPatch = '' @@ -25,10 +25,10 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-release" ]; doCheck = true; checkPhase = '' - LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${llvm}/lib make check + LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libllvm}/lib make check ''; postInstall = '' - wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${llvm}/lib + wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${libllvm}/lib ''; meta = { diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 4b185f038a1..9179866fe9e 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -12,7 +12,7 @@ let opString = lib.optionalString; patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; config = import ./config.nix { inherit fetchFromSavannah; }; - rubygems = import ./rubygems { inherit stdenv lib fetchurl fetchpatch; }; + rubygems = import ./rubygems { inherit stdenv lib fetchurl; }; # Contains the ruby version heuristics rubyVersion = import ./ruby-version.nix { inherit lib; }; @@ -55,13 +55,7 @@ let # Or (usually): # $(nix-build -A ruby)/lib/ruby/2.6.0/x86_64-linux/rbconfig.rb # - In $out/lib/libruby.so and/or $out/lib/libruby.dylib - # - # Since some Gems require JIT support, there's probably no - # escape from this reference. Hence, it was decided to enable this - # feature by default, as it's enabled by default by ruby's ./configure - # script. If you'd like to have a ruby without reference to cc, setting - # jitSupport to false should remove all known references mentioned above. - , removeReferencesTo, jitSupport ? true + , removeReferencesTo, jitSupport ? false , autoreconfHook, bison, autoconf , buildEnv, bundler, bundix , libiconv, libobjc, libunwind, Foundation @@ -112,7 +106,17 @@ let patchLevel = ver.patchLevel; }).${ver.majMinTiny} ++ op atLeast27 ./do-not-regenerate-revision.h.patch - ++ op (atLeast30 && useRailsExpress) ./do-not-update-gems-baseruby.patch; + ++ op (atLeast30 && useRailsExpress) ./do-not-update-gems-baseruby.patch + # Ruby prior to 3.0 has a bug the installer (tools/rbinstall.rb) but + # the resulting error was swallowed. Newer rubygems no longer swallows + # this error. We upgrade rubygems when rubygemsSupport is enabled, so + # we have to fix this bug to prevent the install step from failing. + # See https://github.com/ruby/ruby/pull/2930 + ++ op (!atLeast30 && rubygemsSupport) + (fetchpatch { + url = "https://github.com/ruby/ruby/commit/261d8dd20afd26feb05f00a560abd99227269c1c.patch"; + sha256 = "0wrii25cxcz2v8bgkrf7ibcanjlxwclzhayin578bf0qydxdm9qy"; + }); postUnpack = opString rubygemsSupport '' rm -rf $sourceRoot/{lib,test}/rubygems* @@ -167,8 +171,9 @@ let installFlags = lib.optional docSupport "install-doc"; # Bundler tries to create this directory postInstall = '' + rbConfig=$(find $out/lib/ruby -name rbconfig.rb) # Remove unnecessary groff reference from runtime closure, since it's big - sed -i '/NROFF/d' $out/lib/ruby/*/*/rbconfig.rb + sed -i '/NROFF/d' $rbConfig ${ lib.optionalString (!jitSupport) '' # Get rid of the CC runtime dependency @@ -177,7 +182,8 @@ let $out/lib/libruby* ${removeReferencesTo}/bin/remove-references-to \ -t ${stdenv.cc} \ - $out/${passthru.libPath}/${stdenv.hostPlatform.system}/rbconfig.rb + $rbConfig + sed -i '/CC_VERSION_MESSAGE/d' $rbConfig '' } # Bundler tries to create this directory @@ -195,8 +201,6 @@ let addEnvHooks "$hostOffset" addGemPath addEnvHooks "$hostOffset" addRubyLibPath EOF - - rbConfig=$(find $out/lib/ruby -name rbconfig.rb) '' + opString docSupport '' # Prevent the docs from being included in the closure sed -i "s|\$(DESTDIR)$devdoc|\$(datarootdir)/\$(RI_BASE_NAME)|" $rbConfig diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix index 19eed817ec2..db508caae31 100644 --- a/pkgs/development/interpreters/ruby/rubygems/default.nix +++ b/pkgs/development/interpreters/ruby/rubygems/default.nix @@ -1,23 +1,18 @@ -{ stdenv, lib, fetchurl, fetchpatch }: +{ stdenv, lib, fetchurl }: stdenv.mkDerivation rec { name = "rubygems"; - version = "3.1.3"; + version = "3.2.16"; src = fetchurl { url = "https://rubygems.org/rubygems/rubygems-${version}.tgz"; - sha256 = "181wjclxnq5lrwnr53famy9pg8911hi9w2v0vy7dqgjqnc4iy1hp"; + sha256 = "1bpn45hchcbirqvqwxcxyk1xy2xkdd915jci2hfjq4y6zc4idns0"; }; patches = [ ./0001-add-post-extract-hook.patch ./0002-binaries-with-env-shebang.patch ./0003-gem-install-default-to-user.patch - - (fetchpatch { - url = "https://github.com/rubygems/rubygems/commit/0af4d2d369ff580ef54839ec15a8c7ec419978cb.patch"; - sha256 = "13gyfxn4rmxq1dbxq5rzphnhagn8n8kpp8lb9h6h4s9d4zaklax9"; - }) ]; installPhase = '' diff --git a/pkgs/development/interpreters/spidermonkey/68.nix b/pkgs/development/interpreters/spidermonkey/68.nix index 0ac005b07de..f867e606140 100644 --- a/pkgs/development/interpreters/spidermonkey/68.nix +++ b/pkgs/development/interpreters/spidermonkey/68.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation rec { "--with-system-zlib" "--with-system-icu" - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" "--enable-shared-js" diff --git a/pkgs/development/interpreters/wasmer/default.nix b/pkgs/development/interpreters/wasmer/default.nix index 8077177d8b8..eb17fda0830 100644 --- a/pkgs/development/interpreters/wasmer/default.nix +++ b/pkgs/development/interpreters/wasmer/default.nix @@ -35,7 +35,7 @@ rustPlatform.buildRustPackage rec { "--features" "test-cranelift,test-jit" ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; meta = with lib; { description = "The Universal WebAssembly Runtime"; diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 3d13dddb642..9afca8f1f71 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ python cmake clang ]; buildInputs = [ llvmPackages.libclang ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; doCheck = true; |