]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
nix: .#widnows: init
authorhutli <redacted>
Thu, 15 Feb 2024 13:25:04 +0000 (14:25 +0100)
committerSomeone <redacted>
Thu, 28 Mar 2024 07:48:27 +0000 (07:48 +0000)
initial nix build for windows using zig

mingwW64 build

removes nix zig windows build

removes nix zig windows build

removed unnessesary glibc.static

removed unnessesary import of pkgs in nix

fixed missing trailing newline on non-windows nix builds

overriding stdenv when building for crosscompiling to windows in nix

better variables when crosscompiling windows in nix

cross compile windows on macos

removed trailing whitespace

remove unnessesary overwrite of "CMAKE_SYSTEM_NAME" in nix windows build

nix: keep file extension when copying result files during cross compile for windows

nix: better checking for file extensions when using MinGW

nix: using hostPlatform instead of targetPlatform when cross compiling for Windows

using hostPlatform.extensions.executable to extract executable format

.devops/nix/package.nix
flake.nix

index b651f9e61f77185e181be4153867600c0cd41e5a..83858c82951b28312fb988ec901a712ee048f11a 100644 (file)
@@ -67,6 +67,8 @@ let
     strings.optionalString (suffices != [ ])
       ", accelerated with ${strings.concatStringsSep ", " suffices}";
 
+  executableSuffix = effectiveStdenv.hostPlatform.extensions.executable;
+
   # TODO: package the Python in this repository in a Nix-like way.
   # It'd be nice to migrate to buildPythonPackage, as well as ensure this repo
   # is PEP 517-compatible, and ensure the correct .dist-info is generated.
@@ -244,8 +246,8 @@ effectiveStdenv.mkDerivation (
     # TODO(SomeoneSerge): It's better to add proper install targets at the CMake level,
     # if they haven't been added yet.
     postInstall = ''
-      mv $out/bin/main $out/bin/llama
-      mv $out/bin/server $out/bin/llama-server
+      mv $out/bin/main${executableSuffix} $out/bin/llama${executableSuffix}
+      mv $out/bin/server${executableSuffix} $out/bin/llama-server${executableSuffix}
       mkdir -p $out/include
       cp $src/llama.h $out/include/
     '';
index 9a528a66b53035b9dbc185ef8f0b9ab7a2119c29..cdce3e0a9f5294f8d7cb193ebf934dcaa847a933 100644 (file)
--- a/flake.nix
+++ b/flake.nix
               {
                 default = config.legacyPackages.llamaPackages.llama-cpp;
                 vulkan = config.packages.default.override { useVulkan = true; };
+                windows = config.legacyPackages.llamaPackages.llama-cpp.override {
+                  stdenv = pkgs.pkgsCross.mingwW64.stdenv;
+                };
               }
               // lib.optionalAttrs pkgs.stdenv.isLinux {
                 opencl = config.packages.default.override { useOpenCL = true; };