2023-10-10 20:10:23 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cacert
|
|
|
|
, cmake
|
|
|
|
, cmakerc
|
|
|
|
, fmt
|
|
|
|
, git
|
|
|
|
, gzip
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssh
|
|
|
|
, python3
|
|
|
|
, zip
|
|
|
|
, zstd
|
|
|
|
, extraRuntimeDeps ? []
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "vcpkg-tool";
|
2024-06-13 03:02:28 +00:00
|
|
|
version = "2024-06-10";
|
2023-10-10 20:10:23 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "vcpkg-tool";
|
|
|
|
rev = finalAttrs.version;
|
2024-06-13 03:02:28 +00:00
|
|
|
hash = "sha256-TGRTzUd1FtErD+h/ksUsUm1Rhank9/yVy06JbAgEEw0=";
|
2023-10-10 20:10:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
];
|
|
|
|
|
2024-06-20 15:00:16 +00:00
|
|
|
buildInputs = [
|
|
|
|
cmakerc
|
|
|
|
fmt
|
|
|
|
];
|
|
|
|
|
2023-10-10 20:10:23 +00:00
|
|
|
patches = [
|
|
|
|
./change-lock-location.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DVCPKG_DEPENDENCY_EXTERNAL_FMT=ON"
|
|
|
|
"-DVCPKG_DEPENDENCY_CMAKERC=ON"
|
|
|
|
];
|
|
|
|
|
2024-07-01 17:51:39 +00:00
|
|
|
|
|
|
|
# vcpkg needs two directories to write to that is independent of installation directory.
|
|
|
|
# Since vcpkg already creates $HOME/.vcpkg/ we use that to create a root where vcpkg can write into.
|
|
|
|
passAsFile = [ "vcpkgWrapper" ];
|
|
|
|
vcpkgWrapper = let
|
2023-10-10 20:10:23 +00:00
|
|
|
# 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 ''
|
2024-07-01 17:51:39 +00:00
|
|
|
vcpkg_writable_path="$HOME/.vcpkg/root/"
|
|
|
|
|
|
|
|
export PATH="${lib.makeBinPath runtimeDeps}''${PATH:+":$PATH"}"
|
|
|
|
|
|
|
|
"${placeholder "out"}/bin/vcpkg" \
|
|
|
|
--x-downloads-root="$vcpkg_writable_path"/downloads \
|
|
|
|
--x-buildtrees-root="$vcpkg_writable_path"/buildtrees \
|
|
|
|
--x-packages-root="$vcpkg_writable_path"/packages \
|
|
|
|
"$@"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
mv "$out/bin/vcpkg" "$out/bin/.vcpkg-wrapped"
|
|
|
|
install -Dm555 "$vcpkgWrapperPath" "$out/bin/vcpkg"
|
2023-10-10 20:10:23 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Components of microsoft/vcpkg's binary";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "vcpkg";
|
2023-10-10 20:10:23 +00:00
|
|
|
homepage = "https://github.com/microsoft/vcpkg-tool";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ guekka gracicot ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
})
|