summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/editors/neovim/utils.nix2
-rw-r--r--pkgs/applications/editors/neovim/wrapper.nix28
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix4
-rw-r--r--pkgs/applications/networking/twtxt/default.nix28
-rw-r--r--pkgs/build-support/bintools-wrapper/default.nix4
-rw-r--r--pkgs/development/python-modules/jupyter_core/default.nix2
-rw-r--r--pkgs/test/vim/default.nix66
-rw-r--r--pkgs/test/vim/neovim-override.vim7
-rw-r--r--pkgs/top-level/all-packages.nix2
9 files changed, 109 insertions, 34 deletions
diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix
index ae814fa9b4e..c753d2cca2c 100644
--- a/pkgs/applications/editors/neovim/utils.nix
+++ b/pkgs/applications/editors/neovim/utils.nix
@@ -148,6 +148,7 @@ let
     , vimAlias ? false
     , viAlias ? false
     , configure ? {}
+    , extraName ? ""
   }:
     let
       /* for compatibility with passing extraPythonPackages as a list; added 2018-07-11 */
@@ -160,6 +161,7 @@ let
         extraPython3Packages = compatFun extraPython3Packages;
         inherit withNodeJs withRuby viAlias vimAlias;
         inherit configure;
+        inherit extraName;
       };
     in
     assert withPython -> throw "Python2 support has been removed from neovim, please remove withPython and extraPythonPackages.";
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index 7fa15efd82c..07a1dad7c09 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -27,23 +27,24 @@ let
     # set to false if you want to control where to save the generated config
     # (e.g., in ~/.config/init.vim or project/.nvimrc)
     , wrapRc ? true
+    , neovimRcContent ? ""
     , ...
   }@args:
   let
 
     wrapperArgsStr = if isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
 
-  # If configure != {}, we can't generate the rplugin.vim file with e.g
-  # NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
-  # the wrapper. That's why only when configure != {} (tested both here and
-  # when postBuild is evaluated), we call makeWrapper once to generate a
-  # wrapper with most arguments we need, excluding those that cause problems to
-  # generate rplugin.vim, but still required for the final wrapper.
-  finalMakeWrapperArgs =
-    [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ]
-    ++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]
-    ++ optionals wrapRc [ "--add-flags" "-u ${writeText "init.vim" args.neovimRcContent}" ]
-    ;
+    # If configure != {}, we can't generate the rplugin.vim file with e.g
+    # NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
+    # the wrapper. That's why only when configure != {} (tested both here and
+    # when postBuild is evaluated), we call makeWrapper once to generate a
+    # wrapper with most arguments we need, excluding those that cause problems to
+    # generate rplugin.vim, but still required for the final wrapper.
+    finalMakeWrapperArgs =
+      [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ]
+      ++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]
+      ++ optionals wrapRc [ "--add-flags" "-u ${writeText "init.vim" neovimRcContent}" ]
+      ;
   in
   assert withPython2 -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env.";
 
@@ -116,7 +117,10 @@ let
     preferLocalBuild = true;
 
     nativeBuildInputs = [ makeWrapper ];
-    passthru = { unwrapped = neovim; };
+    passthru = {
+      unwrapped = neovim;
+      initRc = neovimRcContent;
+    };
 
     meta = neovim.meta // {
       # To prevent builds on hydra
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index 793e8688a5f..13becfc4f62 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -303,10 +303,6 @@ let
             ln -sLt $out/lib/mozilla/pkcs11-modules $ext/lib/mozilla/pkcs11-modules/*
         done
 
-        # For manpages, in case the program supplies them
-        mkdir -p $out/nix-support
-        echo ${browser} > $out/nix-support/propagated-user-env-packages
-
 
         #########################
         #                       #
diff --git a/pkgs/applications/networking/twtxt/default.nix b/pkgs/applications/networking/twtxt/default.nix
index ff6e61c614f..27420f8bd33 100644
--- a/pkgs/applications/networking/twtxt/default.nix
+++ b/pkgs/applications/networking/twtxt/default.nix
@@ -1,23 +1,31 @@
-{ lib, fetchFromGitHub, buildGoModule }:
+{ lib, fetchFromGitHub, buildPythonApplication, aiohttp, python-dateutil, humanize, click, pytestCheckHook, tox }:
 
-buildGoModule rec {
+buildPythonApplication rec {
   pname = "twtxt";
-  version = "0.1.0";
+  version = "1.2.3";
 
   src = fetchFromGitHub {
-    owner = "jointwt";
+    owner = "buckket";
     repo = pname;
-    rev = version;
-    sha256 = "15jhfnhpk34nmad04f7xz1w041dba8cn17hq46p9n5sarjgkjiiw";
+    rev = "v${version}";
+    sha256 = "sha256-AdM95G2Vz3UbVPI7fs8/D78BMxscbTGrCpIyyHzSmho=";
   };
 
-  vendorSha256 = "1lnf8wd2rv9d292rp8jndfdg0rjs6gfw0yg49l9spw4yzifnd7f7";
+  # Relax some dependencies
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace 'aiohttp>=2.2.5,<3' 'aiohttp' \
+      --replace 'click>=6.7,<7' 'click' \
+      --replace 'humanize>=0.5.1,<1' 'humanize'
+  '';
 
-  subPackages = [ "cmd/twt" "cmd/twtd" ];
+  propagatedBuildInputs = [ aiohttp python-dateutil humanize click ];
+
+  checkInputs = [ pytestCheckHook tox ];
 
   meta = with lib; {
-    description = "Self-hosted, Twitter-like decentralised microblogging platform";
-    homepage = "https://github.com/jointwt/twtxt";
+    description = "Decentralised, minimalist microblogging service for hackers";
+    homepage = "https://github.com/buckket/twtxt";
     license = licenses.mit;
     maintainers = with maintainers; [ siraben ];
   };
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix
index bf81d00e5ea..5d2f2f977a7 100644
--- a/pkgs/build-support/bintools-wrapper/default.nix
+++ b/pkgs/build-support/bintools-wrapper/default.nix
@@ -14,7 +14,9 @@
   if libc == null then
     null
   else if stdenvNoCC.targetPlatform.isNetBSD then
-    if libc != targetPackages.netbsdCross.headers then
+    if !(targetPackages ? netbsdCross) then
+      netbsd.ld_elf_so
+    else if libc != targetPackages.netbsdCross.headers then
       targetPackages.netbsdCross.ld_elf_so
     else
       null
diff --git a/pkgs/development/python-modules/jupyter_core/default.nix b/pkgs/development/python-modules/jupyter_core/default.nix
index cff5dc194aa..cdd0485b684 100644
--- a/pkgs/development/python-modules/jupyter_core/default.nix
+++ b/pkgs/development/python-modules/jupyter_core/default.nix
@@ -1,6 +1,7 @@
 { lib
 , buildPythonPackage
 , fetchPypi
+, isPy3k
 , ipython
 , traitlets
 , glibcLocales
@@ -12,6 +13,7 @@
 buildPythonPackage rec {
   pname = "jupyter_core";
   version = "4.7.1";
+  disabled = !isPy3k;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/test/vim/default.nix b/pkgs/test/vim/default.nix
index c809940fc4c..3bdc3234134 100644
--- a/pkgs/test/vim/default.nix
+++ b/pkgs/test/vim/default.nix
@@ -1,9 +1,12 @@
 { vimUtils, vim_configurable, writeText, neovim, vimPlugins
 , lib, fetchFromGitHub, neovimUtils, wrapNeovimUnstable
 , neovim-unwrapped
+, fetchFromGitLab
+, pkgs
 }:
 let
   inherit (vimUtils) buildVimPluginFrom2Nix;
+  inherit (neovimUtils) makeNeovimConfig;
 
   packages.myVimPackage.start = with vimPlugins; [ vim-nix ];
 
@@ -16,27 +19,55 @@ let
     }
   ];
 
-  nvimConfNix = neovimUtils.makeNeovimConfig {
+  nvimConfNix = makeNeovimConfig {
     inherit plugins;
     customRC = ''
       " just a comment
     '';
   };
 
-  wrapNeovim = suffix: config:
+  nvimConfDontWrap = makeNeovimConfig {
+    inherit plugins;
+    customRC = ''
+      " just a comment
+    '';
+  };
+
+  wrapNeovim2 = suffix: config:
     wrapNeovimUnstable neovim-unwrapped (config // {
       extraName = suffix;
-      wrapRc = true;
     });
+
+  nmt = fetchFromGitLab {
+    owner = "rycee";
+    repo = "nmt";
+    rev = "d2cc8c1042b1c2511f68f40e2790a8c0e29eeb42";
+    sha256 = "1ykcvyx82nhdq167kbnpgwkgjib8ii7c92y3427v986n2s5lsskc";
+  };
+
+  runTest = neovim-drv: buildCommand:
+    pkgs.runCommandLocal "test-${neovim-drv.name}" ({
+      nativeBuildInputs = [ ];
+      meta.platforms = neovim-drv.meta.platforms;
+    }) (''
+      source ${nmt}/bash-lib/assertions.sh
+      vimrc="${writeText "init.vim" neovim-drv.initRc}"
+      vimrcGeneric="$out/patched.vim"
+      mkdir $out
+      ${pkgs.perl}/bin/perl -pe "s|\Q$NIX_STORE\E/[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" < "$vimrc" > "$vimrcGeneric"
+    '' + buildCommand);
+
 in
-{
+  pkgs.recurseIntoAttrs (
+rec {
   vim_empty_config = vimUtils.vimrcFile { beforePlugins = ""; customRC = ""; };
 
   ### neovim tests
   ##################
-  nvim_with_plugins = wrapNeovim "-with-plugins" nvimConfNix;
+  nvim_with_plugins = wrapNeovim2 "-with-plugins" nvimConfNix;
 
   nvim_via_override = neovim.override {
+    extraName = "-via-override";
     configure = {
       packages.foo.start = [ vimPlugins.ale ];
       customRC = ''
@@ -45,6 +76,29 @@ in
     };
   };
 
+
+  # nixpkgs should detect that no wrapping is necessary
+  nvimShouldntWrap = wrapNeovim2 "-should-not-wrap" nvimConfNix;
+
+
+  # this will generate a neovimRc content but we disable wrapping
+  nvimDontWrap = wrapNeovim2 "-dont-wrap" (makeNeovimConfig {
+    wrapRc = false;
+    customRC = ''
+      " this shouldn't trigger the creation of an init.vim
+    '';
+  });
+
+  nvim_dontwrap-test = runTest nvimDontWrap ''
+      ! grep "-u" ${nvimDontWrap}/bin/nvim
+  '';
+
+  nvim_via_override-test = runTest nvim_via_override ''
+      assertFileContent \
+        "$vimrcGeneric" \
+        "${./neovim-override.vim}"
+  '';
+
   ### vim tests
   ##################
   vim_with_vim2nix = vim_configurable.customize {
@@ -107,4 +161,4 @@ in
   test_nvim_with_remote_plugin = neovim.override {
     configure.pathogen.pluginNames = with vimPlugins; [ deoplete-nvim ];
   };
-}
+})
diff --git a/pkgs/test/vim/neovim-override.vim b/pkgs/test/vim/neovim-override.vim
new file mode 100644
index 00000000000..34a1a8f1f43
--- /dev/null
+++ b/pkgs/test/vim/neovim-override.vim
@@ -0,0 +1,7 @@
+" configuration generated by NIX
+set nocompatible
+
+set packpath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
+set runtimepath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
+
+:help ale
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 73c47a750aa..03df40ac3de 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9346,7 +9346,7 @@ in
 
   twitterBootstrap = callPackage ../development/web/twitter-bootstrap {};
 
-  twtxt = callPackage ../applications/networking/twtxt { };
+  twtxt = python3Packages.callPackage ../applications/networking/twtxt { };
 
   txr = callPackage ../tools/misc/txr { stdenv = clangStdenv; };