about summary refs log tree commit diff
path: root/pkgs/by-name/vc
diff options
context:
space:
mode:
authorGuillaume Racicot <gracicot42@gmail.com>2023-10-10 16:10:23 -0400
committerGuillaume Racicot <gracicot42@gmail.com>2023-12-07 10:01:00 -0300
commit673432ef6ea14b51d77a11a3abefdadf7b76668e (patch)
treeae878b65e61c58915fbaaa9034a0f3232e87e155 /pkgs/by-name/vc
parentc56fe286621d3381924a62af67353d1ab5b6d96f (diff)
downloadnixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar.gz
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar.bz2
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar.lz
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar.xz
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.tar.zst
nixlib-673432ef6ea14b51d77a11a3abefdadf7b76668e.zip
vcpkg-tool: init at 2023-09-15
Diffstat (limited to 'pkgs/by-name/vc')
-rw-r--r--pkgs/by-name/vc/vcpkg-tool/change-lock-location.patch14
-rw-r--r--pkgs/by-name/vc/vcpkg-tool/package.nix73
2 files changed, 87 insertions, 0 deletions
diff --git a/pkgs/by-name/vc/vcpkg-tool/change-lock-location.patch b/pkgs/by-name/vc/vcpkg-tool/change-lock-location.patch
new file mode 100644
index 000000000000..d3cf8e0f8137
--- /dev/null
+++ b/pkgs/by-name/vc/vcpkg-tool/change-lock-location.patch
@@ -0,0 +1,14 @@
+diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp
+index 3f588c21..e6f2bbed 100644
+--- a/src/vcpkg/vcpkgpaths.cpp
++++ b/src/vcpkg/vcpkgpaths.cpp
+@@ -579,7 +579,8 @@ namespace vcpkg
+                 if (!args.do_not_take_lock)
+                 {
+                     std::error_code ec;
+-                    const auto vcpkg_root_file = root / ".vcpkg-root";
++                    fs.create_directories(Path{"/tmp/vcpkg"}, VCPKG_LINE_INFO);
++                    const auto vcpkg_root_file = Path{"/tmp/vcpkg"} / Hash::get_string_sha256(root.c_str());
+                     if (args.wait_for_lock.value_or(false))
+                     {
+                         file_lock_handle = fs.take_exclusive_file_lock(vcpkg_root_file, ec);
diff --git a/pkgs/by-name/vc/vcpkg-tool/package.nix b/pkgs/by-name/vc/vcpkg-tool/package.nix
new file mode 100644
index 000000000000..0dbeac164369
--- /dev/null
+++ b/pkgs/by-name/vc/vcpkg-tool/package.nix
@@ -0,0 +1,73 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cacert
+, cmake
+, cmakerc
+, fmt
+, git
+, gzip
+, makeWrapper
+, meson
+, ninja
+, openssh
+, python3
+, zip
+, zstd
+, extraRuntimeDeps ? []
+}:
+stdenv.mkDerivation (finalAttrs: {
+  pname = "vcpkg-tool";
+  version = "2023-10-18";
+
+  src = fetchFromGitHub {
+    owner = "microsoft";
+    repo = "vcpkg-tool";
+    rev = finalAttrs.version;
+    hash = "sha256-Hm+GSKov9A6tmN10BHOTVy8aWkLOJNBMOQJNm4HnWuI=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    cmakerc
+    fmt
+    ninja
+    makeWrapper
+  ];
+
+  patches = [
+    ./change-lock-location.patch
+  ];
+
+  cmakeFlags = [
+    "-DVCPKG_DEPENDENCY_EXTERNAL_FMT=ON"
+    "-DVCPKG_DEPENDENCY_CMAKERC=ON"
+  ];
+
+  postFixup = let
+    # These are the most common binaries used by vcpkg
+    # Extra binaries can be added via overlay when needed
+    runtimeDeps = [
+      cacert
+      cmake
+      git
+      gzip
+      meson
+      ninja
+      openssh
+      python3
+      zip
+      zstd
+    ] ++ extraRuntimeDeps;
+  in ''
+    wrapProgram $out/bin/vcpkg --prefix PATH ${lib.makeBinPath runtimeDeps}
+  '';
+
+  meta = {
+    description = "Components of microsoft/vcpkg's binary";
+    homepage = "https://github.com/microsoft/vcpkg-tool";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ guekka gracicot ];
+    platforms = lib.platforms.all;
+  };
+})