9 stdenvNoCC.mkDerivation (finalAttrs: {
11 version = "2024.09.30";
13 src = fetchFromGitHub {
16 rev = finalAttrs.version;
17 hash = "sha256-lPvThSB8xYZQBRKTJmFwoCKBd5lOHaAOttrtcuQDIUg=";
21 VCPKG_BASELINE_COMMIT_SHA=$(git rev-parse --verify HEAD)
22 # We only needed the .git folder for that previous command, so we can safely delete it now.
23 # If we don’t delete it, then we might run into problems (see #8567).
25 # Here's the code that Creates this json file in Visual Studio deployment and the code that reads it:
26 # https://github.com/microsoft/vcpkg-tool/blob/f098d3e0aaa7e46ea84a1f7079586e1ec5af8ab5/vcpkg-init/mint-standalone-bundle.ps1#L21
27 # https://github.com/microsoft/vcpkg-tool/blob/f098d3e0aaa7e46ea84a1f7079586e1ec5af8ab5/src/vcpkg/bundlesettings.cpp#L87
29 # Here's the code that we target with this setting. If we use embeddedsha combined with usegitregistry, vcpkg
30 # will checkout a remote instead of trying to do git operation in the vcpkg root
31 # https://github.com/microsoft/vcpkg-tool/blob/d272c0d4f5175b26bd56c6109d4c4935b791a157/src/vcpkg/vcpkgpaths.cpp#L920
32 # https://github.com/microsoft/vcpkg-tool/blob/d272c0d4f5175b26bd56c6109d4c4935b791a157/src/vcpkg/configuration.cpp#L718
33 echo '{ "readonly": true, "usegitregistry": true, "deployment": "Git", "embeddedsha": "'"$VCPKG_BASELINE_COMMIT_SHA"'" }' > vcpkg-bundle.json
37 nativeBuildInputs = [ makeWrapper ];
40 substituteInPlace scripts/toolchains/linux.cmake \
41 --replace-fail "aarch64-linux-gnu-as" "aarch64-unknown-linux-gnu-as" \
42 --replace-fail "aarch64-linux-gnu-gcc" "aarch64-unknown-linux-gnu-gcc" \
43 --replace-fail "aarch64-linux-gnu-g++" "aarch64-unknown-linux-gnu-g++" \
44 --replace-fail "arm-linux-gnueabihf-as" "armv7l-unknown-linux-gnueabihf-as" \
45 --replace-fail "arm-linux-gnueabihf-gcc" "armv7l-unknown-linux-gnueabihf-gcc" \
46 --replace-fail "arm-linux-gnueabihf-g++" "armv7l-unknown-linux-gnueabihf-g++"
47 # If we don’t turn this off, then you won’t be able to run binaries that
48 # are installed by vcpkg.
49 find triplets -name '*linux*.cmake' -exec bash -c 'echo "set(X_VCPKG_RPATH_KEEP_SYSTEM_PATHS ON)" >> "$1"' -- {} \;
55 mkdir -p "$out/bin" "$out/share/vcpkg/scripts/buildsystems"
56 cp --preserve=mode -r ./{docs,ports,triplets,scripts,.vcpkg-root,versions,LICENSE.txt,vcpkg-bundle.json} "$out/share/vcpkg/"
58 ${lib.optionalString doWrap ''
59 makeWrapper "${vcpkg-tool}/bin/vcpkg" "$out/bin/vcpkg" \
60 --set-default VCPKG_ROOT "$out/share/vcpkg"
63 ln -s "$out/bin/vcpkg" "$out/share/vcpkg/vcpkg"
64 touch "$out/share/vcpkg/vcpkg.disable-metrics"
70 description = "C++ Library Manager for Windows, Linux, and macOS";
71 mainProgram = "vcpkg";
72 homepage = "https://vcpkg.io/";
73 license = lib.licenses.mit;
74 maintainers = with lib.maintainers; [ guekka gracicot h7x4 ];
75 platforms = lib.platforms.all;