diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/misc')
-rw-r--r-- | nixpkgs/pkgs/tools/misc/audible-cli/default.nix | 1 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/byobu/default.nix | 76 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/esphome/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/faketty/default.nix | 6 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/fastfetch/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/ksnip/default.nix | 13 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/lesspipe/default.nix | 82 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/mise/default.nix | 6 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/nautilus-open-any-terminal/default.nix | 6 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/ollama/default.nix | 238 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/outils/default.nix | 31 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/parallel/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/rauc/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/tmuxp/default.nix | 6 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/topicctl/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/wit-bindgen/default.nix | 33 |
16 files changed, 232 insertions, 286 deletions
diff --git a/nixpkgs/pkgs/tools/misc/audible-cli/default.nix b/nixpkgs/pkgs/tools/misc/audible-cli/default.nix index 297917b6a92a..4d0134e8eaee 100644 --- a/nixpkgs/pkgs/tools/misc/audible-cli/default.nix +++ b/nixpkgs/pkgs/tools/misc/audible-cli/default.nix @@ -27,6 +27,7 @@ python3Packages.buildPythonApplication rec { packaging pillow questionary + setuptools tabulate toml tqdm diff --git a/nixpkgs/pkgs/tools/misc/byobu/default.nix b/nixpkgs/pkgs/tools/misc/byobu/default.nix deleted file mode 100644 index efcf679c1994..000000000000 --- a/nixpkgs/pkgs/tools/misc/byobu/default.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ lib, stdenv, fetchurl, makeWrapper -, python3, perl, textual-window-manager -, gettext, vim, bc, screen }: - -let - pythonEnv = python3.withPackages (ps: with ps; [ snack ]); -in -stdenv.mkDerivation rec { - version = "5.133"; - pname = "byobu"; - - src = fetchurl { - url = "https://launchpad.net/byobu/trunk/${version}/+download/byobu_${version}.orig.tar.gz"; - sha256 = "0qvmmdnvwqbgbhn5c8asmrmjhclcl029py2d2zvmd7h5ij7s93jd"; - }; - - doCheck = true; - - strictdeps = true; - nativeBuildInputs = [ makeWrapper gettext ]; - buildInputs = [ perl ]; # perl is needed for `lib/byobu/include/*` scripts - propagatedBuildInputs = [ textual-window-manager screen ]; - - postPatch = '' - substituteInPlace usr/bin/byobu-export.in \ - --replace "gettext" "${gettext}/bin/gettext" - substituteInPlace usr/lib/byobu/menu \ - --replace "gettext" "${gettext}/bin/gettext" - ''; - - postInstall = '' - # Byobu does not compile its po files for some reason - for po in po/*.po; do - lang=''${po#po/} - lang=''${lang%.po} - # Path where byobu looks for translations as observed in the source code and strace - mkdir -p $out/share/byobu/po/$lang/LC_MESSAGES/ - msgfmt $po -o $out/share/byobu/po/$lang/LC_MESSAGES/byobu.mo - done - - # Override the symlinks otherwise they mess with the wrapping - cp --remove-destination $out/bin/byobu $out/bin/byobu-screen - cp --remove-destination $out/bin/byobu $out/bin/byobu-tmux - - for i in $out/bin/byobu*; do - # We don't use the usual ".$package-wrapped" because arg0 within the shebang scripts - # points to the filename and byobu matches against this to know which backend - # to start with - file=".$(basename $i)" - mv $i $out/bin/$file - makeWrapper "$out/bin/$file" "$out/bin/$(basename $i)" --argv0 $(basename $i) \ - --set BYOBU_PATH ${lib.escapeShellArg (lib.makeBinPath [ vim bc ])} \ - --set BYOBU_PYTHON "${pythonEnv}/bin/python" - done - ''; - - meta = with lib; { - homepage = "https://launchpad.net/byobu/"; - description = "Text-based window manager and terminal multiplexer"; - - longDescription = - ''Byobu is a GPLv3 open source text-based window manager and terminal multiplexer. - It was originally designed to provide elegant enhancements to the otherwise functional, - plain, practical GNU Screen, for the Ubuntu server distribution. - Byobu now includes an enhanced profiles, convenient keybindings, - configuration utilities, and toggle-able system status notifications for both - the GNU Screen window manager and the more modern Tmux terminal multiplexer, - and works on most Linux, BSD, and Mac distributions. - ''; - - license = licenses.gpl3; - - platforms = platforms.unix; - maintainers = with maintainers; [ qknight berbiche ]; - }; -} diff --git a/nixpkgs/pkgs/tools/misc/esphome/default.nix b/nixpkgs/pkgs/tools/misc/esphome/default.nix index 02c18ac3a092..268cb68b4dc2 100644 --- a/nixpkgs/pkgs/tools/misc/esphome/default.nix +++ b/nixpkgs/pkgs/tools/misc/esphome/default.nix @@ -19,14 +19,14 @@ let in python.pkgs.buildPythonApplication rec { pname = "esphome"; - version = "2024.2.0"; + version = "2024.2.1"; pyproject = true; src = fetchFromGitHub { owner = pname; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-k8caA5Q4QcP7H1Nn5yvFsfExVwipAlFSb/DphkzYNtU="; + hash = "sha256-MAyK8Wx/d7lJKEueeL7GhxxKu8EygwjylPGXB2Y3bWM="; }; nativeBuildInputs = with python.pkgs; [ diff --git a/nixpkgs/pkgs/tools/misc/faketty/default.nix b/nixpkgs/pkgs/tools/misc/faketty/default.nix index d05360ccffe3..228cdf7f2f2f 100644 --- a/nixpkgs/pkgs/tools/misc/faketty/default.nix +++ b/nixpkgs/pkgs/tools/misc/faketty/default.nix @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "faketty"; - version = "1.0.15"; + version = "1.0.16"; src = fetchCrate { inherit pname version; - hash = "sha256-f32Y9Aj4Z9y6Da9rbRgwi9BGPl4FsI790BH52cIIoPA="; + hash = "sha256-BlQnVjYPFUfEurFUE2MHOL2ad56Nu/atzRuFu4OoCSI="; }; - cargoHash = "sha256-+M1oq2CHUK6CIDFiUNLjO1UmHI19D5zdHVl8dvmQ1G8="; + cargoHash = "sha256-q9jx03XYA977481B9xuUfaaMBDbSVx4xREj4Q1Ti/Yw="; postPatch = '' patchShebangs tests/test.sh diff --git a/nixpkgs/pkgs/tools/misc/fastfetch/default.nix b/nixpkgs/pkgs/tools/misc/fastfetch/default.nix index bcfbdfa9becb..b3d5b6f1fcbe 100644 --- a/nixpkgs/pkgs/tools/misc/fastfetch/default.nix +++ b/nixpkgs/pkgs/tools/misc/fastfetch/default.nix @@ -43,13 +43,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "fastfetch"; - version = "2.8.5"; + version = "2.8.6"; src = fetchFromGitHub { owner = "fastfetch-cli"; repo = "fastfetch"; rev = finalAttrs.version; - hash = "sha256-aIGT2NwtkKJ1uTgy4rvFegzJadRuGkki63gpnVCPKbw="; + hash = "sha256-n15p26zZaote8cB0NfBnb69hb27l4hHBZG+3D1yrrCA="; }; outputs = [ "out" "man" ]; diff --git a/nixpkgs/pkgs/tools/misc/ksnip/default.nix b/nixpkgs/pkgs/tools/misc/ksnip/default.nix index 60ba06a29930..8e5cc40740cc 100644 --- a/nixpkgs/pkgs/tools/misc/ksnip/default.nix +++ b/nixpkgs/pkgs/tools/misc/ksnip/default.nix @@ -3,6 +3,7 @@ , cmake , extra-cmake-modules , fetchFromGitHub +, fetchpatch , kcolorpicker , kimageannotator , wrapQtAppsHook @@ -22,6 +23,18 @@ stdenv.mkDerivation rec { sha256 = "sha256-n7YwDXd73hyrzb6L8utZFuHh9HnjVtkU6CC4jfWPj/I="; }; + patches = [ + # Fix build with latest kImageAnnotator + (fetchpatch { + url = "https://github.com/ksnip/ksnip/commit/76f4b381971eead6ff31b8bf3bb64bb5717469c3.patch"; + hash = "sha256-JWoI974qDNZIzr/8oksI8m6g3XNWEaQRGsqSfvQrmao="; + }) + ]; + + postPatch = '' + substituteInPlace src/CMakeLists.txt --replace-fail "kColorPicker::kColorPicker" "kColorPicker::kColorPicker-Qt5" + ''; + nativeBuildInputs = [ cmake extra-cmake-modules diff --git a/nixpkgs/pkgs/tools/misc/lesspipe/default.nix b/nixpkgs/pkgs/tools/misc/lesspipe/default.nix index c7978485c7e4..5bc3f97c3c78 100644 --- a/nixpkgs/pkgs/tools/misc/lesspipe/default.nix +++ b/nixpkgs/pkgs/tools/misc/lesspipe/default.nix @@ -1,4 +1,22 @@ -{ lib, stdenv, fetchFromGitHub, makeWrapper, perl, procps, file, gnused, bash, binutils }: +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, perl +, procps +, bash + +# shell referenced dependencies +, resholve +, binutils-unwrapped +, file +, gnugrep +, coreutils +, gnused +, gnutar +, iconv +, ncurses +}: stdenv.mkDerivation rec { pname = "lesspipe"; @@ -28,9 +46,65 @@ stdenv.mkDerivation rec { installFlags = [ "DESTDIR=$(out)" ]; postInstall = '' - for f in lesspipe.sh lesscomplete; do - wrapProgram "$out/bin/$f" --prefix-each PATH : "${lib.makeBinPath [ binutils file gnused procps ]}" - done + # resholve doesn't see strings in an array definition + substituteInPlace $out/bin/lesspipe.sh --replace 'nodash strings' "nodash ${binutils-unwrapped}/bin/strings" + + ${resholve.phraseSolution "lesspipe.sh" { + scripts = [ "bin/lesspipe.sh" ]; + interpreter = "${bash}/bin/bash"; + inputs = [ + coreutils + file + gnugrep + gnused + gnutar + iconv + procps + ncurses + ]; + keep = [ "$prog" "$c1" "$c2" "$c3" "$c4" "$c5" "$cmd" "$colorizer" "$HOME" ]; + fake = { + # script guards usage behind has_cmd test function, it's safe to leave these external and optional + external = [ + "cpio" "isoinfo" "cabextract" "bsdtar" "rpm2cpio" "bsdtar" "unzip" "ar" "unrar" "rar" "7zr" "7za" "isoinfo" + "gzip" "bzip2" "lzip" "lzma" "xz" "brotli" "compress" "zstd" "lz4" + "archive_color" "bat" "batcat" "pygmentize" "source-highlight" "vimcolor" "code2color" + + "w3m" "lynx" "elinks" "html2text" "dtc" "pdftotext" "pdftohtml" "pdfinfo" "ps2ascii" "procyon" "ccze" + "mdcat" "pandoc" "docx2txt" "libreoffice" "pptx2md" "mdcat" "xlscat" "odt2txt" "wvText" "antiword" "catdoc" + "broken_catppt" "sxw2txt" "groff" "mandoc" "unrtf" "dvi2tty" "pod2text" "perldoc" "h5dump" "ncdump" "matdump" + "djvutxt" "openssl" "gpg" "plistutil" "plutil" "id3v2" "csvlook" "jq" "zlib-flate" "lessfilter" + ] ++ lib.optional stdenv.isDarwin [ + # resholve only identifies this on darwin + # call site is gaurded by || so it's safe to leave dynamic + "locale" + ]; + builtin = [ "setopt" ]; + }; + execer = [ + "cannot:${iconv}/bin/iconv" + ]; + }} + ${resholve.phraseSolution "lesscomplete" { + scripts = [ "bin/lesscomplete" ]; + interpreter = "${bash}/bin/bash"; + inputs = [ + coreutils + file + gnugrep + gnused + gnutar + ]; + keep = [ "$prog" "$c1" "$c2" "$c3" "$c4" "$c5" "$cmd" ]; + fake = { + # script guards usage behind has_cmd test function, it's safe to leave these external and optional + external = [ + "cpio" "isoinfo" "cabextract" "bsdtar" "rpm2cpio" "bsdtar" "unzip" "ar" "unrar" "rar" "7zr" "7za" "isoinfo" + "gzip" "bzip2" "lzip" "lzma" "xz" "brotli" "compress" "zstd" "lz4" + ]; + builtin = [ "setopt" ]; + }; + }} ''; meta = with lib; { diff --git a/nixpkgs/pkgs/tools/misc/mise/default.nix b/nixpkgs/pkgs/tools/misc/mise/default.nix index b0d48fd6fcfb..959be1430da5 100644 --- a/nixpkgs/pkgs/tools/misc/mise/default.nix +++ b/nixpkgs/pkgs/tools/misc/mise/default.nix @@ -17,16 +17,16 @@ rustPlatform.buildRustPackage rec { pname = "mise"; - version = "2024.2.16"; + version = "2024.2.19"; src = fetchFromGitHub { owner = "jdx"; repo = "mise"; rev = "v${version}"; - hash = "sha256-SrLgLYe0jeVzLoJZahqVrlYDd2FJ3G1uxrHx2BKjbHM="; + hash = "sha256-SDGXSjCDdtjKn474s2SQm9YDHofMOmHuodLS2iu10Co="; }; - cargoHash = "sha256-G/NR53u+rX9Q7tJVYi1tlXQL+gxK7wfqN3IpkoXzTRk="; + cargoHash = "sha256-4MEBIZOXjcLEyW0TB+AXWsEc24VZz8bGCkduHqbazuo="; nativeBuildInputs = [ installShellFiles pkg-config ]; buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]; diff --git a/nixpkgs/pkgs/tools/misc/nautilus-open-any-terminal/default.nix b/nixpkgs/pkgs/tools/misc/nautilus-open-any-terminal/default.nix index 54e85c063633..b200731ab8f2 100644 --- a/nixpkgs/pkgs/tools/misc/nautilus-open-any-terminal/default.nix +++ b/nixpkgs/pkgs/tools/misc/nautilus-open-any-terminal/default.nix @@ -14,14 +14,14 @@ python3.pkgs.buildPythonPackage rec { pname = "nautilus-open-any-terminal"; - version = "0.5.0"; + version = "0.5.1"; pyproject = true; src = fetchFromGitHub { owner = "Stunkymonkey"; repo = pname; - rev = version; - hash = "sha256-fcTbt8O/7KEme5+GlDD7hMMcE2RaYqFdfojzJ1KhnA0="; + rev = "refs/tags/${version}"; + hash = "sha256-liyzgbZGl08gHLVpsy8NbTiTytNdiMdymF70ik4cPXs="; }; patches = [ ./hardcode-gsettings.patch ]; diff --git a/nixpkgs/pkgs/tools/misc/ollama/default.nix b/nixpkgs/pkgs/tools/misc/ollama/default.nix index 6ce576644d49..7a0fea0c116b 100644 --- a/nixpkgs/pkgs/tools/misc/ollama/default.nix +++ b/nixpkgs/pkgs/tools/misc/ollama/default.nix @@ -8,6 +8,7 @@ , makeWrapper , stdenv +, pkgs , cmake , gcc12 , clblast @@ -17,98 +18,28 @@ , linuxPackages , darwin -, enableRocm ? false -, enableCuda ? false + # one of `[ null "rocm" "cuda" ]` +, acceleration ? null }: let pname = "ollama"; - version = "0.1.24"; - - warnIfNotLinux = warning: (lib.warnIfNot stdenv.isLinux warning stdenv.isLinux); - gpuWarning = api: "building ollama with ${api} is only supported on linux; falling back to cpu"; - rocmIsEnabled = enableRocm && (warnIfNotLinux (gpuWarning "rocm")); - cudaIsEnabled = enableCuda && (warnIfNotLinux (gpuWarning "cuda")); - enableLinuxGpu = rocmIsEnabled || cudaIsEnabled; - - appleFrameworks = darwin.apple_sdk_11_0.frameworks; - metalFrameworks = [ - appleFrameworks.Accelerate - appleFrameworks.Metal - appleFrameworks.MetalKit - appleFrameworks.MetalPerformanceShaders - ]; - + version = "0.1.27"; src = fetchFromGitHub { owner = "jmorganca"; repo = "ollama"; rev = "v${version}"; - hash = "sha256-GwZA1QUH8I8m2bGToIcMMaB5MBnioQP4+n1SauUJYP8="; + hash = "sha256-+ayby+yVknFHLTyLjMAPMnOTMSzTKqzi9caN/TppcEg="; fetchSubmodules = true; }; - preparePatch = patch: hash: fetchpatch { - url = "file://${src}/llm/patches/${patch}"; - inherit hash; - stripLen = 1; - extraPrefix = "llm/llama.cpp/"; - }; - inherit (lib) licenses platforms maintainers; - ollama = { - inherit pname version src; - vendorHash = "sha256-wXRbfnkbeXPTOalm7SFLvHQ9j46S/yLNbFy+OWNSamQ="; - - nativeBuildInputs = [ - cmake - ] ++ lib.optionals enableLinuxGpu [ - makeWrapper - ] ++ lib.optionals stdenv.isDarwin - metalFrameworks; - - patches = [ - # remove uses of `git` in the `go generate` script - # instead use `patch` where necessary - ./remove-git.patch - # replace a hardcoded use of `g++` with `$CXX` - ./replace-gcc.patch - - # ollama's patches of llama.cpp's example server - # `ollama/llm/generate/gen_common.sh` -> "apply temporary patches until fix is upstream" - (preparePatch "01-cache.diff" "sha256-PC4yN98hFvK+PEITiDihL8ki3bJuLVXrAm0CGf8GPJE=") - (preparePatch "02-shutdown.diff" "sha256-cElAp9Z9exxN964vB/YFuBhZoEcoAwGSMCnbh+l/V4Q=") - ]; - postPatch = '' - # use a patch from the nix store in the `go generate` script - substituteInPlace llm/generate/gen_common.sh \ - --subst-var-by cmakeIncludePatch '${./cmake-include.patch}' - # `ollama/llm/generate/gen_common.sh` -> "avoid duplicate main symbols when we link into the cgo binary" - substituteInPlace llm/llama.cpp/examples/server/server.cpp \ - --replace-fail 'int main(' 'int __main(' - # replace inaccurate version number with actual release version - substituteInPlace version/version.go --replace-fail 0.0.0 '${version}' - ''; - preBuild = '' - export OLLAMA_SKIP_PATCHING=true - # build llama.cpp libraries for ollama - go generate ./... - ''; - - ldflags = [ - "-s" - "-w" - "-X=github.com/jmorganca/ollama/version.Version=${version}" - "-X=github.com/jmorganca/ollama/server.mode=release" - ]; - meta = { - description = "Get up and running with large language models locally"; - homepage = "https://github.com/jmorganca/ollama"; - license = licenses.mit; - platforms = platforms.unix; - mainProgram = "ollama"; - maintainers = with maintainers; [ abysssol dit7ya elohmeier ]; - }; - }; + validAccel = lib.assertOneOf "ollama.acceleration" acceleration [ null "rocm" "cuda" ]; + warnIfNotLinux = api: (lib.warnIfNot stdenv.isLinux + "building ollama with `${api}` is only supported on linux; falling back to cpu" + stdenv.isLinux); + enableRocm = validAccel && (acceleration == "rocm") && (warnIfNotLinux "rocm"); + enableCuda = validAccel && (acceleration == "cuda") && (warnIfNotLinux "cuda"); rocmClang = linkFarm "rocm-clang" { llvm = rocmPackages.llvm.clang; @@ -120,10 +51,6 @@ let rocmClang ]; }; - rocmVars = { - ROCM_PATH = rocmPath; - CLBlast_DIR = "${clblast}/lib/cmake/CLBlast"; - }; cudaToolkit = buildEnv { name = "cuda-toolkit"; @@ -133,50 +60,121 @@ let cudaPackages.cuda_cudart ]; }; - cudaVars = { - CUDA_LIB_DIR = "${cudaToolkit}/lib"; - CUDACXX = "${cudaToolkit}/bin/nvcc"; - CUDAToolkit_ROOT = cudaToolkit; - }; - linuxGpuLibs = { - buildInputs = lib.optionals rocmIsEnabled [ - rocmPackages.clr - rocmPackages.hipblas - rocmPackages.rocblas - rocmPackages.rocsolver - rocmPackages.rocsparse - libdrm - ] ++ lib.optionals cudaIsEnabled [ - cudaPackages.cuda_cudart - ]; - }; - - appleGpuLibs = { buildInputs = metalFrameworks; }; - - runtimeLibs = lib.optionals rocmIsEnabled [ + runtimeLibs = lib.optionals enableRocm [ rocmPackages.rocm-smi - ] ++ lib.optionals cudaIsEnabled [ + ] ++ lib.optionals enableCuda [ linuxPackages.nvidia_x11 ]; - runtimeLibWrapper = { - postFixup = '' - mv "$out/bin/${pname}" "$out/bin/.${pname}-unwrapped" - makeWrapper "$out/bin/.${pname}-unwrapped" "$out/bin/${pname}" \ - --suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath runtimeLibs}' - ''; - }; + + appleFrameworks = darwin.apple_sdk_11_0.frameworks; + metalFrameworks = [ + appleFrameworks.Accelerate + appleFrameworks.Metal + appleFrameworks.MetalKit + appleFrameworks.MetalPerformanceShaders + ]; + goBuild = - if cudaIsEnabled then + if enableCuda then buildGoModule.override { stdenv = overrideCC stdenv gcc12; } else buildGoModule; + preparePatch = patch: hash: fetchpatch { + url = "file://${src}/llm/patches/${patch}"; + inherit hash; + stripLen = 1; + extraPrefix = "llm/llama.cpp/"; + }; + inherit (lib) licenses platforms maintainers; in -goBuild (ollama - // (lib.optionalAttrs rocmIsEnabled rocmVars) - // (lib.optionalAttrs cudaIsEnabled cudaVars) - // (lib.optionalAttrs enableLinuxGpu linuxGpuLibs) - // (lib.optionalAttrs enableLinuxGpu runtimeLibWrapper) +goBuild ((lib.optionalAttrs enableRocm { + ROCM_PATH = rocmPath; + CLBlast_DIR = "${clblast}/lib/cmake/CLBlast"; +}) // (lib.optionalAttrs enableCuda { + CUDA_LIB_DIR = "${cudaToolkit}/lib"; + CUDACXX = "${cudaToolkit}/bin/nvcc"; + CUDAToolkit_ROOT = cudaToolkit; +}) // { + inherit pname version src; + vendorHash = "sha256-zTrBighPBqZ9hhkEV3UawJZUYyPRay7+P6wkhDtpY7M="; + + nativeBuildInputs = [ + cmake + ] ++ lib.optionals (enableRocm || enableCuda) [ + makeWrapper + ] ++ lib.optionals stdenv.isDarwin + metalFrameworks; + + buildInputs = lib.optionals enableRocm [ + rocmPackages.clr + rocmPackages.hipblas + rocmPackages.rocblas + rocmPackages.rocsolver + rocmPackages.rocsparse + libdrm + ] ++ lib.optionals enableCuda [ + cudaPackages.cuda_cudart + ] ++ lib.optionals stdenv.isDarwin + metalFrameworks; + + patches = [ + # remove uses of `git` in the `go generate` script + # instead use `patch` where necessary + ./remove-git.patch + # replace a hardcoded use of `g++` with `$CXX` + ./replace-gcc.patch + + # ollama's patches of llama.cpp's example server + # `ollama/llm/generate/gen_common.sh` -> "apply temporary patches until fix is upstream" + (preparePatch "01-cache.diff" "sha256-MTTln2G0G8dntihUzEjPM1ruTsApb4ZToBczJb8EG68=") + (preparePatch "02-cudaleaks.diff" "sha256-Cu7E9iEcvddPL9mPPI5Z96qmwWigi3f0WgSpPRjGc88=") + ]; + postPatch = '' + # use a patch from the nix store in the `go generate` script + substituteInPlace llm/generate/gen_common.sh \ + --subst-var-by cmakeIncludePatch '${./cmake-include.patch}' + # `ollama/llm/generate/gen_common.sh` -> "avoid duplicate main symbols when we link into the cgo binary" + substituteInPlace llm/llama.cpp/examples/server/server.cpp \ + --replace-fail 'int main(' 'int __main(' + # replace inaccurate version number with actual release version + substituteInPlace version/version.go --replace-fail 0.0.0 '${version}' + ''; + preBuild = '' + export OLLAMA_SKIP_PATCHING=true + # build llama.cpp libraries for ollama + go generate ./... + ''; + postFixup = '' + # the app doesn't appear functional at the moment, so hide it + mv "$out/bin/app" "$out/bin/.ollama-app" + '' + lib.optionalString (enableRocm || enableCuda) '' + # expose runtime libraries necessary to use the gpu + mv "$out/bin/ollama" "$out/bin/.ollama-unwrapped" + makeWrapper "$out/bin/.ollama-unwrapped" "$out/bin/ollama" \ + --suffix LD_LIBRARY_PATH : '/run/opengl-driver/lib:${lib.makeLibraryPath runtimeLibs}' + ''; + + ldflags = [ + "-s" + "-w" + "-X=github.com/jmorganca/ollama/version.Version=${version}" + "-X=github.com/jmorganca/ollama/server.mode=release" + ]; - // (lib.optionalAttrs stdenv.isDarwin appleGpuLibs)) + # for now, just test that rocm and cuda build + passthru.tests = lib.optionalAttrs stdenv.isLinux { + rocm = pkgs.ollama.override { acceleration = "rocm"; }; + cuda = pkgs.ollama.override { acceleration = "cuda"; }; + }; + + meta = { + description = "Get up and running with large language models locally"; + homepage = "https://github.com/jmorganca/ollama"; + license = licenses.mit; + platforms = platforms.unix; + mainProgram = "ollama"; + maintainers = with maintainers; [ abysssol dit7ya elohmeier ]; + }; +}) diff --git a/nixpkgs/pkgs/tools/misc/outils/default.nix b/nixpkgs/pkgs/tools/misc/outils/default.nix deleted file mode 100644 index 065d641f4f30..000000000000 --- a/nixpkgs/pkgs/tools/misc/outils/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ stdenv, fetchFromGitHub, lib }: - -stdenv.mkDerivation rec { - pname = "outils"; - version = "0.10"; - - src = fetchFromGitHub { - owner = "leahneukirchen"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-xYjILa0Km57q/xNP+M34r29WLGC15tzUNoUgPzQTtIs="; - }; - - makeFlags = [ "PREFIX=$(out)" ]; - - meta = with lib; { - homepage = "https://github.com/leahneukirchen/outils"; - description = "Port of OpenBSD-exclusive tools such as `calendar`, `vis`, and `signify`"; - license = with licenses; [ - beerware - bsd2 - bsd3 - bsdOriginal - isc - mit - publicDomain - ]; - platforms = platforms.linux; - maintainers = with maintainers; [ somasis ]; - }; -} diff --git a/nixpkgs/pkgs/tools/misc/parallel/default.nix b/nixpkgs/pkgs/tools/misc/parallel/default.nix index d196de07f648..488039c80763 100644 --- a/nixpkgs/pkgs/tools/misc/parallel/default.nix +++ b/nixpkgs/pkgs/tools/misc/parallel/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "parallel"; - version = "20240122"; + version = "20240222"; src = fetchurl { url = "mirror://gnu/parallel/${pname}-${version}.tar.bz2"; - sha256 = "sha256-hZaIy7VkHNe2sWsrlgviSqTjfmVcyP/NivlxzX1bRJ8="; + sha256 = "sha256-66Cban4jj2Iik/fUYVl/NQdctW8XDQpzFI9T0lnshVY="; }; outputs = [ "out" "man" "doc" ]; diff --git a/nixpkgs/pkgs/tools/misc/rauc/default.nix b/nixpkgs/pkgs/tools/misc/rauc/default.nix index d6e8486681ac..8f244839803c 100644 --- a/nixpkgs/pkgs/tools/misc/rauc/default.nix +++ b/nixpkgs/pkgs/tools/misc/rauc/default.nix @@ -17,13 +17,13 @@ stdenv.mkDerivation rec { pname = "rauc"; - version = "1.11.1"; + version = "1.11.2"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "sha256-xvuBMOAXnuRYCkripjwfv64BCTLySNxebyHF3sB8EQw="; + sha256 = "sha256-IWfYjn8CCgYK2hna59Awr5tzWnXCtR6c1XpV5fCiSE4="; }; passthru = { diff --git a/nixpkgs/pkgs/tools/misc/tmuxp/default.nix b/nixpkgs/pkgs/tools/misc/tmuxp/default.nix index 1d1eaa53e7bb..b61f0bddaa26 100644 --- a/nixpkgs/pkgs/tools/misc/tmuxp/default.nix +++ b/nixpkgs/pkgs/tools/misc/tmuxp/default.nix @@ -2,12 +2,12 @@ python3Packages.buildPythonApplication rec { pname = "tmuxp"; - version = "1.34.0"; - format = "pyproject"; + version = "1.39.0"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-G93YtgXo4li+tLWKgJFaxx4Ax4sK4F+vK6M3WTXIeiU="; + hash = "sha256-E8Q1uCV3kl4rYg/bzwjk3CNQU/uP9lEZzSqcOFkLrY0="; }; nativeBuildInputs = [ diff --git a/nixpkgs/pkgs/tools/misc/topicctl/default.nix b/nixpkgs/pkgs/tools/misc/topicctl/default.nix index 3eb949381af8..e4f5c11a980a 100644 --- a/nixpkgs/pkgs/tools/misc/topicctl/default.nix +++ b/nixpkgs/pkgs/tools/misc/topicctl/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "topicctl"; - version = "1.14.0"; + version = "1.14.2"; src = fetchFromGitHub { owner = "segmentio"; repo = "topicctl"; rev = "v${version}"; - sha256 = "sha256-Vmx+6UXNWCnVmLskk1J4Pug3+99cdk4WXjA2zO4agvU="; + sha256 = "sha256-VOy6IoXw3MCa5hNQ/BmuGKwjbNRvDC+xwIcLXep8rRI="; }; vendorHash = "sha256-+mnnvdna1g6JE29weOJZmdO3jFp2a75dV9wK2XcWJ9s="; diff --git a/nixpkgs/pkgs/tools/misc/wit-bindgen/default.nix b/nixpkgs/pkgs/tools/misc/wit-bindgen/default.nix deleted file mode 100644 index 9f0fbe1f4565..000000000000 --- a/nixpkgs/pkgs/tools/misc/wit-bindgen/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ lib -, rustPlatform -, fetchFromGitHub -}: - -rustPlatform.buildRustPackage rec { - pname = "wit-bindgen"; - version = "0.17.0"; - - src = fetchFromGitHub { - owner = "bytecodealliance"; - repo = "wit-bindgen"; - rev = "wit-bindgen-cli-${version}"; - hash = "sha256-eFJkr/RqQdULPquCVbjhR8843aGjeEnUCF/Ws2U5fQk="; - }; - - cargoHash = "sha256-934lHOXzE2cLW6LMM0AQl/GJt4wSIKZlY1C7gmjGVrc="; - - # Some tests fail because they need network access to install the `wasm32-unknown-unknown` target. - # However, GitHub Actions ensures a proper build. - # See also: - # https://github.com/bytecodealliance/wit-bindgen/actions - # https://github.com/bytecodealliance/wit-bindgen/blob/main/.github/workflows/main.yml - doCheck = false; - - meta = with lib; { - description = "A language binding generator for WebAssembly interface types"; - homepage = "https://github.com/bytecodealliance/wit-bindgen"; - license = licenses.asl20; - maintainers = with maintainers; [ xrelkd ]; - mainProgram = "wit-bindgen"; - }; -} |