diff options
author | Artturi <Artturin@artturin.com> | 2023-01-22 15:03:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-22 15:03:02 +0200 |
commit | fe7dd8eed075732ef2d78d0aa78211e2d0a01f54 (patch) | |
tree | 0cfd421fb6eef19ab8bb7b155873216ce5a8e64b /pkgs/applications/editors | |
parent | 369de1c1e4a7543a8435fe4c3529d95e8abb05ad (diff) | |
parent | 3866fa44a7f9fae7c83e53e7eea295e1f9212055 (diff) |
Merge pull request #212006 from Shawn8901/remove_with_lib_1
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r-- | pkgs/applications/editors/codeblocks/default.nix | 14 | ||||
-rw-r--r-- | pkgs/applications/editors/howl/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/editors/jetbrains/default.nix | 12 | ||||
-rw-r--r-- | pkgs/applications/editors/jetbrains/linux.nix | 8 | ||||
-rw-r--r-- | pkgs/applications/editors/jucipp/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/editors/kakoune/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/editors/nano/default.nix | 6 | ||||
-rw-r--r-- | pkgs/applications/editors/neovim/wrapper.nix | 18 | ||||
-rw-r--r-- | pkgs/applications/editors/rstudio/default.nix | 2 | ||||
-rw-r--r-- | pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix | 6 |
10 files changed, 30 insertions, 48 deletions
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix index 7a1c0af2c6430..441b224ef0226 100644 --- a/pkgs/applications/editors/codeblocks/default.nix +++ b/pkgs/applications/editors/codeblocks/default.nix @@ -2,8 +2,6 @@ , contribPlugins ? false, hunspell, gamin, boost, wrapGAppsHook }: -with lib; - stdenv.mkDerivation rec { name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}"; version = "20.03"; @@ -16,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config file zip wrapGAppsHook ]; buildInputs = [ wxGTK31 gtk3 ] - ++ optionals contribPlugins [ hunspell gamin boost ]; + ++ lib.optionals contribPlugins [ hunspell gamin boost ]; enableParallelBuilding = true; patches = [ ./writable-projects.patch @@ -56,16 +54,16 @@ stdenv.mkDerivation rec { }) ]; preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file"; - postConfigure = optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig"; - configureFlags = [ "--enable-pch=no" ] ++ optionals contribPlugins [ - ("--with-contrib-plugins" + optionalString stdenv.isDarwin "=all,-FileManager,-NassiShneiderman") + postConfigure = lib.optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig"; + configureFlags = [ "--enable-pch=no" ] ++ lib.optionals contribPlugins [ + ("--with-contrib-plugins" + lib.optionalString stdenv.isDarwin "=all,-FileManager,-NassiShneiderman") "--with-boost-libdir=${boost}/lib" ]; - postInstall = optionalString stdenv.isDarwin '' + postInstall = lib.optionalString stdenv.isDarwin '' ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins ''; - meta = { + meta = with lib; { maintainers = [ maintainers.linquize ]; platforms = platforms.all; description = "The open source, cross platform, free C, C++ and Fortran IDE"; diff --git a/pkgs/applications/editors/howl/default.nix b/pkgs/applications/editors/howl/default.nix index 2c959519f41fe..ff9a30074120e 100644 --- a/pkgs/applications/editors/howl/default.nix +++ b/pkgs/applications/editors/howl/default.nix @@ -1,7 +1,5 @@ { lib, stdenv, fetchurl, makeWrapper, pkg-config, gtk3, librsvg }: -with lib; - stdenv.mkDerivation rec { pname = "howl"; version = "0.6"; @@ -27,7 +25,7 @@ stdenv.mkDerivation rec { --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" ''; - meta = { + meta = with lib; { homepage = "https://howl.io/"; description = "A general purpose, fast and lightweight editor with a keyboard-centric minimalistic user interface"; license = licenses.mit; diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 3af1c001c0817..913ef7570eeea 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -11,15 +11,13 @@ , vmopts ? null }: -with lib; - let platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ]; ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" ]; inherit (stdenv.hostPlatform) system; - versions = builtins.fromJSON (readFile (./versions.json)); + versions = builtins.fromJSON (lib.readFile (./versions.json)); versionKey = if stdenv.isLinux then "linux" else system; products = versions.${versionKey} or (throw "Unsupported system: ${system}"); @@ -42,11 +40,11 @@ let maintainers = with maintainers; [ edwtjo mic92 ]; }; }).overrideAttrs (attrs: { - nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [ + nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ lib.optionals (stdenv.isLinux) [ autoPatchelfHook patchelf ]; - buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [ + buildInputs = (attrs.buildInputs or []) ++ lib.optionals (stdenv.isLinux) [ python3 stdenv.cc.cc libdbusmenu @@ -54,7 +52,7 @@ let expat ]; dontAutoPatchelf = true; - postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) '' + postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) '' ( cd $out/clion # bundled cmake does not find libc @@ -217,7 +215,7 @@ let ''; maintainers = with maintainers; [ ]; }; - }).overrideAttrs (finalAttrs: previousAttrs: optionalAttrs cythonSpeedup { + }).overrideAttrs (finalAttrs: previousAttrs: lib.optionalAttrs cythonSpeedup { buildInputs = with python3.pkgs; [ python3 setuptools ]; preInstall = '' echo "compiling cython debug speedups" diff --git a/pkgs/applications/editors/jetbrains/linux.nix b/pkgs/applications/editors/jetbrains/linux.nix index f1529b29f92dc..7443842e7bf9c 100644 --- a/pkgs/applications/editors/jetbrains/linux.nix +++ b/pkgs/applications/editors/jetbrains/linux.nix @@ -5,10 +5,8 @@ { pname, product, productShort ? product, version, src, wmClass, jdk, meta, extraLdPath ? [], extraWrapperArgs ? [] }@args: -with lib; - -let loName = toLower productShort; - hiName = toUpper productShort; +let loName = lib.toLower productShort; + hiName = lib.toUpper productShort; vmoptsName = loName + lib.optionalString stdenv.hostPlatform.is64bit "64" + ".vmoptions"; @@ -29,7 +27,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec { startupWMClass = wmClass; }; - vmoptsFile = optionalString (vmopts != null) (writeText vmoptsName vmopts); + vmoptsFile = lib.optionalString (vmopts != null) (writeText vmoptsName vmopts); nativeBuildInputs = [ makeWrapper patchelf unzip ]; diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix index b06c93c103401..01ab62c6de4fb 100644 --- a/pkgs/applications/editors/jucipp/default.nix +++ b/pkgs/applications/editors/jucipp/default.nix @@ -3,13 +3,11 @@ libXdmcp, libxkbcommon, libpthreadstubs, wrapGAppsHook, aspellDicts, gtkmm3, coreutils, glibc, dbus, openssl, libxml2, gnumake, ctags }: -with lib; - stdenv.mkDerivation rec { pname = "juicipp"; version = "1.2.3"; - meta = { + meta = with lib; { homepage = "https://github.com/cppit/jucipp"; description = "A lightweight, platform independent C++-IDE with support for C++11, C++14, and experimental C++17 features depending on libclang version"; license = licenses.mit; diff --git a/pkgs/applications/editors/kakoune/default.nix b/pkgs/applications/editors/kakoune/default.nix index 3366efb697a88..77d75eb131ff6 100644 --- a/pkgs/applications/editors/kakoune/default.nix +++ b/pkgs/applications/editors/kakoune/default.nix @@ -1,7 +1,5 @@ { lib, stdenv, fetchFromGitHub }: -with lib; - stdenv.mkDerivation rec { pname = "kakoune-unwrapped"; version = "2022.10.31"; @@ -33,7 +31,7 @@ stdenv.mkDerivation rec { ln -s --relative "$autoload_target" autoload ''; - meta = { + meta = with lib; { homepage = "http://kakoune.org/"; description = "A vim inspired text editor"; license = licenses.publicDomain; diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index cfb1d17c91293..69c7f3eb7af34 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -4,8 +4,6 @@ assert enableNls -> (gettext != null); -with lib; - let nixSyntaxHighlight = fetchFromGitHub { owner = "seitz"; @@ -23,7 +21,7 @@ in stdenv.mkDerivation rec { sha256 = "V7p1Hpt1GfD23e5QUgLjh8dd3kQMH3qhuTEMw4FAaDY="; }; - nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext; + nativeBuildInputs = [ texinfo ] ++ lib.optional enableNls gettext; buildInputs = [ ncurses ]; outputs = [ "out" "info" ]; @@ -71,7 +69,7 @@ in stdenv.mkDerivation rec { ''; }; - meta = { + meta = with lib; { homepage = "https://www.nano-editor.org/"; description = "A small, user-friendly console text editor"; license = licenses.gpl3Plus; diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 01a9cf98954b9..fac9b3c309900 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -5,8 +5,6 @@ , python3Packages , callPackage }: -with lib; - neovim: let @@ -32,7 +30,7 @@ let }@args: let - wrapperArgsStr = if isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; + wrapperArgsStr = if lib.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 @@ -43,7 +41,7 @@ let 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}" ] + ++ lib.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."; @@ -57,22 +55,22 @@ let substitute ${neovim}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \ --replace 'Name=Neovim' 'Name=Neovim wrapper' '' - + optionalString withPython3 '' + + lib.optionalString withPython3 '' makeWrapper ${python3Env.interpreter} $out/bin/nvim-python3 --unset PYTHONPATH '' - + optionalString (rubyEnv != null) '' + + lib.optionalString (rubyEnv != null) '' ln -s ${rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby '' - + optionalString withNodeJs '' + + lib.optionalString withNodeJs '' ln -s ${nodePackages.neovim}/bin/neovim-node-host $out/bin/nvim-node '' - + optionalString vimAlias '' + + lib.optionalString vimAlias '' ln -s $out/bin/nvim $out/bin/vim '' - + optionalString viAlias '' + + lib.optionalString viAlias '' ln -s $out/bin/nvim $out/bin/vi '' - + optionalString (manifestRc != null) (let + + lib.optionalString (manifestRc != null) (let manifestWrapperArgs = [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ]; in '' diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 70e69503749b9..71633c8c8e4a9 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -206,7 +206,7 @@ in homepage = "https://www.rstudio.com/"; license = licenses.agpl3Only; maintainers = with maintainers; [ ciil cfhammill ]; - mainProgram = "rstudio" + optionalString server "-server"; + mainProgram = "rstudio" + lib.optionalString server "-server"; platforms = platforms.linux; }; diff --git a/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix b/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix index 8aa121cbe2032..f1ce06b7ca0fa 100644 --- a/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix +++ b/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix @@ -7,8 +7,6 @@ , desktop-file-utils, xprop, xsel }: -with lib; - let # https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#install-prerequisites-manually libs = [ @@ -118,12 +116,12 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens # which will break when copying over the files. mv dotnet_modules/vsls-agent{,-wrapped} makeWrapper $PWD/dotnet_modules/vsls-agent{-wrapped,} \ - --prefix LD_LIBRARY_PATH : "${makeLibraryPath libs}" \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}" \ --set LD_PRELOAD $PWD/dotnet_modules/noop-syslog.so \ --set DOTNET_ROOT ${dotnet-sdk_3} ''; - meta = { + meta = with lib; { description = "Live Share lets you achieve greater confidence at speed by streamlining collaborative editing, debugging, and more in real-time during development"; homepage = "https://aka.ms/vsls-docs"; license = licenses.unfree; |