From 7dd0fd6dc650e76b58c83ab2f1356bc9a7e61abb Mon Sep 17 00:00:00 2001 From: Guillaume Racicot Date: Tue, 10 Oct 2023 16:10:02 -0400 Subject: [PATCH 1/5] maintainers: add guekka --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index cb4c01341c65..9bdd4e4f97d4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6939,6 +6939,11 @@ githubId = 21156405; name = "GuangTao Zhang"; }; + guekka = { + github = "Guekka"; + githubId = 39066502; + name = "Guekka"; + }; guibert = { email = "david.guibert@gmail.com"; github = "dguibert"; From 84ab279895d8ffa6be3a436e4548c0f0da132cfe Mon Sep 17 00:00:00 2001 From: Guillaume Racicot Date: Tue, 10 Oct 2023 16:10:12 -0400 Subject: [PATCH 2/5] cmakerc: init at 2.0.1 --- pkgs/by-name/cm/cmakerc/package.nix | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkgs/by-name/cm/cmakerc/package.nix diff --git a/pkgs/by-name/cm/cmakerc/package.nix b/pkgs/by-name/cm/cmakerc/package.nix new file mode 100644 index 000000000000..cf96ae46db5e --- /dev/null +++ b/pkgs/by-name/cm/cmakerc/package.nix @@ -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; + }; +}) From c56fe286621d3381924a62af67353d1ab5b6d96f Mon Sep 17 00:00:00 2001 From: Guillaume Racicot Date: Tue, 10 Oct 2023 16:10:17 -0400 Subject: [PATCH 3/5] maintainers: add gracicot --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9bdd4e4f97d4..be3aae56713f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -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"; From 673432ef6ea14b51d77a11a3abefdadf7b76668e Mon Sep 17 00:00:00 2001 From: Guillaume Racicot Date: Tue, 10 Oct 2023 16:10:23 -0400 Subject: [PATCH 4/5] vcpkg-tool: init at 2023-09-15 --- .../vc/vcpkg-tool/change-lock-location.patch | 14 ++++ pkgs/by-name/vc/vcpkg-tool/package.nix | 73 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 + 3 files changed, 91 insertions(+) create mode 100644 pkgs/by-name/vc/vcpkg-tool/change-lock-location.patch create mode 100644 pkgs/by-name/vc/vcpkg-tool/package.nix 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; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67aaee744cdf..8440b1581993 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; From 810da0480b8bf24b1a2f2e0278494cceb5f31964 Mon Sep 17 00:00:00 2001 From: Guillaume Racicot Date: Tue, 10 Oct 2023 16:10:28 -0400 Subject: [PATCH 5/5] vcpkg: init at 2023.08.09 --- pkgs/by-name/vc/vcpkg/package.nix | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pkgs/by-name/vc/vcpkg/package.nix diff --git a/pkgs/by-name/vc/vcpkg/package.nix b/pkgs/by-name/vc/vcpkg/package.nix new file mode 100644 index 000000000000..e8beeb0756a1 --- /dev/null +++ b/pkgs/by-name/vc/vcpkg/package.nix @@ -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; + }; +})