2024-02-02 07:49:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, qt6
|
|
|
|
, fmt
|
|
|
|
, shaderc
|
|
|
|
, vulkan-headers
|
|
|
|
, wayland
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-02-24 12:42:14 +00:00
|
|
|
pname = "gpt4all";
|
2024-03-12 17:14:09 +00:00
|
|
|
version = "2.7.3";
|
2024-02-02 07:49:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
fetchSubmodules = true;
|
2024-03-12 17:14:09 +00:00
|
|
|
hash = "sha256-hIfeADP3tiooGZr/OMVFIkOAniMWXj9AsVzMPlVbucE=";
|
2024-02-02 07:49:12 +00:00
|
|
|
owner = "nomic-ai";
|
|
|
|
repo = "gpt4all";
|
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/gpt4all-chat";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
2024-03-12 17:14:09 +00:00
|
|
|
--replace-fail 'set(CMAKE_INSTALL_PREFIX ''${CMAKE_BINARY_DIR}/install)' ""
|
2024-02-02 07:49:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
qt6.wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
fmt
|
|
|
|
qt6.qtwayland
|
|
|
|
qt6.qtquicktimeline
|
|
|
|
qt6.qtsvg
|
|
|
|
qt6.qthttpserver
|
|
|
|
qt6.qtwebengine
|
|
|
|
qt6.qt5compat
|
|
|
|
shaderc
|
|
|
|
vulkan-headers
|
|
|
|
wayland
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF"
|
|
|
|
"-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON"
|
|
|
|
"-DKOMPUTE_OPT_USE_BUILT_IN_FMT=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/include
|
|
|
|
rm -rf $out/lib/*.a
|
|
|
|
mv $out/bin/chat $out/bin/${finalAttrs.meta.mainProgram}
|
|
|
|
install -m 444 -D $src/gpt4all-chat/flatpak-manifest/io.gpt4all.gpt4all.desktop $out/share/applications/io.gpt4all.gpt4all.desktop
|
|
|
|
install -m 444 -D $src/gpt4all-chat/icons/logo.svg $out/share/icons/hicolor/scalable/apps/io.gpt4all.gpt4all.svg
|
|
|
|
substituteInPlace $out/share/applications/io.gpt4all.gpt4all.desktop \
|
2024-03-12 17:14:09 +00:00
|
|
|
--replace-fail 'Exec=chat' 'Exec=${finalAttrs.meta.mainProgram}'
|
2024-02-02 07:49:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2024-02-24 12:42:14 +00:00
|
|
|
changelog = "https://github.com/nomic-ai/gpt4all/releases/tag/v${finalAttrs.version}";
|
2024-02-02 07:49:12 +00:00
|
|
|
description = "A free-to-use, locally running, privacy-aware chatbot. No GPU or internet required";
|
2024-02-24 12:42:14 +00:00
|
|
|
homepage = "https://github.com/nomic-ai/gpt4all";
|
2024-02-02 07:49:12 +00:00
|
|
|
license = lib.licenses.mit;
|
2024-02-24 12:42:14 +00:00
|
|
|
mainProgram = "gpt4all";
|
2024-02-02 07:49:12 +00:00
|
|
|
maintainers = with lib.maintainers; [ drupol polygon ];
|
|
|
|
};
|
|
|
|
})
|