Merge pull request #251465 from gracicot/grc/init-vcpkg

vcpkg: init at 2023.10.19
This commit is contained in:
Peder Bergebakken Sundt 2023-12-08 02:14:17 +01:00 committed by GitHub
commit 09dc04054b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 185 additions and 0 deletions

View File

@ -6834,6 +6834,12 @@
githubId = 6893840;
name = "Yacine Hmito";
};
gracicot = {
email = "gracicot42@gmail.com";
github = "gracicot";
githubId = 2906673;
name = "Guillaume Racicot";
};
graham33 = {
email = "graham@grahambennett.org";
github = "graham33";
@ -6939,6 +6945,11 @@
githubId = 21156405;
name = "GuangTao Zhang";
};
guekka = {
github = "Guekka";
githubId = 39066502;
name = "Guekka";
};
guibert = {
email = "david.guibert@gmail.com";
github = "dguibert";

View File

@ -0,0 +1,32 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cmrc";
version = "2.0.1";
src = fetchFromGitHub {
owner = "vector-of-bool";
repo = "cmrc";
rev = finalAttrs.version;
hash = "sha256-++16WAs2K9BKk8384yaSI/YD1CdtdyXVBIjGhqi4JIk=";
};
installPhase = ''
runHook preInstall
install CMakeRC.cmake -DT $out/share/cmakerc/cmakerc-config.cmake
runHook postInstall
'';
meta = {
description = "A Resource Compiler in a Single CMake Script";
homepage = "https://github.com/vector-of-bool/cmrc";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ guekka ];
platforms = lib.platforms.all;
};
})

View File

@ -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);

View File

@ -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;
};
})

View File

@ -0,0 +1,51 @@
{ fetchFromGitHub
, stdenvNoCC
, lib
, vcpkg-tool
, writeShellScript
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "vcpkg";
version = "2023.10.19";
src = fetchFromGitHub {
owner = "microsoft";
repo = "vcpkg";
rev = finalAttrs.version;
hash = "sha256-u+4vyOphnowoaZgfkCbzF7Q4tuz2GN1bHylaKw352Lc=";
};
installPhase = let
# 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.
vcpkgScript = writeShellScript "vcpkg" ''
vcpkg_writable_path="$HOME/.vcpkg/root/"
VCPKG_ROOT="@out@/share/vcpkg" ${vcpkg-tool}/bin/vcpkg \
--x-downloads-root="$vcpkg_writable_path"/downloads \
--x-buildtrees-root="$vcpkg_writable_path"/buildtrees \
--x-packages-root="$vcpkg_writable_path"/packages \
"$@"
'';
in ''
runHook preInstall
mkdir -p $out/bin $out/share/vcpkg/scripts/buildsystems
cp --preserve=mode -r ./{docs,ports,triplets,scripts,.vcpkg-root,versions,LICENSE.txt} $out/share/vcpkg/
substitute ${vcpkgScript} $out/bin/vcpkg --subst-var-by out $out
chmod +x $out/bin/vcpkg
ln -s $out/bin/vcpkg $out/share/vcpkg/vcpkg
touch $out/share/vcpkg/vcpkg.disable-metrics
runHook postInstall
'';
meta = {
description = "C++ Library Manager";
homepage = "https://vcpkg.io/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ guekka gracicot ];
platforms = lib.platforms.all;
};
})

View File

@ -822,6 +822,10 @@ with pkgs;
sea-orm-cli = callPackage ../development/tools/sea-orm-cli { };
vcpkg-tool = callPackage ../by-name/vc/vcpkg-tool/package.nix {
fmt = fmt_10;
};
r3ctl = qt5.callPackage ../tools/misc/r3ctl { };
ptouch-print = callPackage ../misc/ptouch-print { };