diff --git a/pkgs/by-name/gi/git-unroll/package.nix b/pkgs/by-name/gi/git-unroll/package.nix new file mode 100644 index 000000000000..46caf7b662b3 --- /dev/null +++ b/pkgs/by-name/gi/git-unroll/package.nix @@ -0,0 +1,81 @@ +{ + lib, + stdenv, + fetchFromGitea, + makeWrapper, + bash, + + git, + nix-prefetch-git, + rWrapper, + rPackages, + + unstableGitUpdater, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "git-unroll"; + version = "0-unstable-2024-11-04"; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "gm6k"; + repo = "git-unroll"; + rev = "9243bb8a6a9f6875e21a5c64320b66f7fdaf9b3f"; + hash = "sha256-1MjbB1EVgmU0HlUibrKOkjmxQ8wseocSJENiAqyHcjU="; + }; + + postPatch = '' + substituteInPlace unroll \ + --replace-fail "#! /usr/bin/env nix-shell" "#!/usr/bin/env bash" \ + --replace-fail \ + "#! nix-shell -i bash -p git nix rWrapper rPackages.jsonlite rPackages.processx rPackages.dplyr rPackages.plyr rPackages.stringr -I nixpkgs=." \ + "" \ + --replace-fail '"$PWD/pkgs/build-support/fetchgit/nix-prefetch-git",' '"nix-prefetch-git"' + ''; + + nativeBuildInputs = [ + makeWrapper + ]; + + buildInputs = [ + bash + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 unroll $out/bin/unroll + wrapProgram $out/bin/unroll \ + --prefix PATH : ${ + lib.makeBinPath [ + git + nix-prefetch-git + (rWrapper.override { + packages = with rPackages; [ + jsonlite + processx + dplyr + plyr + stringr + ]; + }) + ] + } + + runHook postInstall + ''; + + passthru = { + updateScript = unstableGitUpdater { }; + }; + + meta = { + description = "Convert Git repositories with submodules to a Nix expression based on non-recursive Git sources"; + homepage = "https://codeberg.org/gm6k/git-unroll"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ GaetanLepage ]; + mainProgram = "unroll"; + platforms = lib.platforms.all; + }; +}) diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index e43e28fe42a4..84aa5ae4a8af 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -3,7 +3,7 @@ lib, fetchFromGitHub, fetchFromGitLab, - fetchFromGitea, + git-unroll, buildPythonPackage, python, runCommand, @@ -228,14 +228,6 @@ let rocmSupport; }; - git-unroll = fetchFromGitea { - domain = "codeberg.org"; - owner = "gm6k"; - repo = "git-unroll"; - rev = "9243bb8a6a9f6875e21a5c64320b66f7fdaf9b3f"; - hash = "sha256-1MjbB1EVgmU0HlUibrKOkjmxQ8wseocSJENiAqyHcjU="; - }; - unroll-src = writeShellScript "unroll-src" '' echo "{ version, @@ -244,7 +236,7 @@ let runCommand, }: assert version == "'"'$1'"'";" - ${git-unroll}/unroll https://github.com/pytorch/pytorch v$1 + ${lib.getExe git-unroll} https://github.com/pytorch/pytorch v$1 echo echo "# Update using: unroll-src [version]" '';