diff --git a/pkgs/applications/version-management/jujutsu/default.nix b/pkgs/applications/version-management/jujutsu/default.nix deleted file mode 100644 index 1736287f2efd5..0000000000000 --- a/pkgs/applications/version-management/jujutsu/default.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ stdenv -, lib -, fetchFromGitHub -, fetchpatch2 -, rustPlatform -, Security -, SystemConfiguration -, pkg-config -, libiconv -, openssl -, gzip -, libssh2 -, libgit2 -, zstd -, installShellFiles -, nix-update-script -, testers -, jujutsu -}: - -rustPlatform.buildRustPackage rec { - pname = "jujutsu"; - version = "0.21.0"; - - src = fetchFromGitHub { - owner = "martinvonz"; - repo = "jj"; - rev = "v${version}"; - hash = "sha256-uZsfHhcYpobatWaDQczuc9Z3BWHN5VO0qr/8mu5kEio="; - }; - - cargoHash = "sha256-BOO1jP1Y5CNbE97zj+tpariiBdcuxKb1wyvI7i/VpYI="; - - cargoBuildFlags = [ "--bin" "jj" ]; # don't install the fake editors - useNextest = false; # nextest is the upstream integration framework, but is problematic for test skipping - ZSTD_SYS_USE_PKG_CONFIG = "1"; # disable vendored zlib - LIBGIT2_NO_VENDOR = "1"; # disable vendored libgit2 - LIBSSH2_SYS_USE_PKG_CONFIG = "1"; # disable vendored libssh2 - - nativeBuildInputs = [ - gzip - installShellFiles - pkg-config - ]; - - buildInputs = [ - openssl - zstd - libgit2 - libssh2 - ] ++ lib.optionals stdenv.isDarwin [ - Security - SystemConfiguration - libiconv - ]; - - postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - $out/bin/jj util mangen > ./jj.1 - installManPage ./jj.1 - - installShellCompletion --cmd jj \ - --bash <($out/bin/jj util completion bash) \ - --fish <($out/bin/jj util completion fish) \ - --zsh <($out/bin/jj util completion zsh) - ''; - - checkFlags = [ - # signing tests spin up an ssh-agent and do git checkouts - "--skip=test_ssh_signing" - ]; - - passthru = { - updateScript = nix-update-script { }; - tests = { - version = testers.testVersion { - package = jujutsu; - command = "jj --version"; - }; - }; - }; - - meta = with lib; { - description = "Git-compatible DVCS that is both simple and powerful"; - homepage = "https://github.com/martinvonz/jj"; - changelog = "https://github.com/martinvonz/jj/blob/v${version}/CHANGELOG.md"; - license = licenses.asl20; - maintainers = with maintainers; [ _0x4A6F thoughtpolice ]; - mainProgram = "jj"; - }; -} diff --git a/pkgs/by-name/ju/jujutsu/package.nix b/pkgs/by-name/ju/jujutsu/package.nix new file mode 100644 index 0000000000000..dc21d2fabc88c --- /dev/null +++ b/pkgs/by-name/ju/jujutsu/package.nix @@ -0,0 +1,124 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + installShellFiles, + pkg-config, + zstd, + libgit2, + libssh2, + openssl, + darwin, + libiconv, + git, + gnupg, + openssh, + buildPackages, + nix-update-script, + testers, + jujutsu, +}: + +let + version = "0.21.0"; +in + +rustPlatform.buildRustPackage { + pname = "jujutsu"; + inherit version; + + src = fetchFromGitHub { + owner = "martinvonz"; + repo = "jj"; + rev = "v${version}"; + hash = "sha256-uZsfHhcYpobatWaDQczuc9Z3BWHN5VO0qr/8mu5kEio="; + }; + + cargoHash = "sha256-BOO1jP1Y5CNbE97zj+tpariiBdcuxKb1wyvI7i/VpYI="; + + nativeBuildInputs = [ + installShellFiles + pkg-config + ]; + + buildInputs = + [ + zstd + libgit2 + libssh2 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ openssl ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.SystemConfiguration + libiconv + ]; + + nativeCheckInputs = [ + git + gnupg + openssh + ]; + + cargoBuildFlags = [ + # Don’t install the `gen-protos` build tool. + "--bin" + "jj" + ]; + + useNextest = true; + + cargoTestFlags = [ + # Don’t build the `gen-protos` build tool when running tests. + "-p" + "jj-lib" + "-p" + "jj-cli" + ]; + + env = { + # Disable vendored libraries. + ZSTD_SYS_USE_PKG_CONFIG = "1"; + LIBGIT2_NO_VENDOR = "1"; + LIBSSH2_SYS_USE_PKG_CONFIG = "1"; + }; + + postInstall = + let + jj = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/jj"; + in + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) '' + ${jj} util mangen > ./jj.1 + installManPage ./jj.1 + + installShellCompletion --cmd jj \ + --bash <(${jj} util completion bash) \ + --fish <(${jj} util completion fish) \ + --zsh <(${jj} util completion zsh) + ''; + + passthru = { + updateScript = nix-update-script { }; + tests = { + version = testers.testVersion { + package = jujutsu; + command = "jj --version"; + }; + }; + }; + + meta = { + description = "Git-compatible DVCS that is both simple and powerful"; + homepage = "https://github.com/martinvonz/jj"; + changelog = "https://github.com/martinvonz/jj/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + _0x4A6F + thoughtpolice + emily + bbigras + ]; + mainProgram = "jj"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 804ab2b4ac353..11c8bbe008cc8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31876,10 +31876,6 @@ with pkgs; clerk = callPackage ../applications/audio/clerk { }; - jujutsu = callPackage ../applications/version-management/jujutsu { - inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration; - }; - nbstripout = callPackage ../applications/version-management/nbstripout { }; ncmpc = callPackage ../applications/audio/ncmpc { };