about summary refs log tree commit diff
path: root/pkgs/by-name/ju
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ju')
-rw-r--r--pkgs/by-name/ju/jujutsu/package.nix124
-rw-r--r--pkgs/by-name/ju/junest/package.nix33
-rw-r--r--pkgs/by-name/ju/jupp/package.nix52
-rw-r--r--pkgs/by-name/ju/just/fix-just-path-in-tests.patch20
-rw-r--r--pkgs/by-name/ju/just/package.nix37
-rw-r--r--pkgs/by-name/ju/just/setup-hook.sh23
-rw-r--r--pkgs/by-name/ju/justbuild/package.nix34
7 files changed, 283 insertions, 40 deletions
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/by-name/ju/junest/package.nix b/pkgs/by-name/ju/junest/package.nix
new file mode 100644
index 0000000000000..2890f345964b9
--- /dev/null
+++ b/pkgs/by-name/ju/junest/package.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, stdenvNoCC, wget }:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "junest";
+  version = "7.4.9";
+
+  src = fetchFromGitHub {
+    owner = "fsquillace";
+    repo = "junest";
+    rev = "refs/tags/${version}";
+    hash = "sha256-iPZN4zPHRsOh5GjRUbeEQj7BYO2Ng93mNn8TvxpDN3Q=";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/lib
+    cp -r $src/bin/ $out/
+    cp -r $src/lib/ $out/
+    substituteInPlace $out/lib/core/common.sh --replace-fail "wget" ${lib.getExe wget}
+  '';
+
+  meta = {
+    description = "Arch distro that runs on top of another without root";
+    homepage = "https://github.com/fsquillace/junest";
+    license = lib.licenses.gpl3Only;
+    mainProgram = "junest";
+    maintainers = with lib.maintainers; [ jdev082 ];
+    platforms = lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/by-name/ju/jupp/package.nix b/pkgs/by-name/ju/jupp/package.nix
new file mode 100644
index 0000000000000..72e82da61ddad
--- /dev/null
+++ b/pkgs/by-name/ju/jupp/package.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchurl
+, ncurses
+, gpm
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jupp";
+  version = "40";
+  srcName = "joe-3.1${pname}${version}";
+
+  src = fetchurl {
+    urls = [
+      "https://www.mirbsd.org/MirOS/dist/jupp/${srcName}.tgz"
+      "https://pub.allbsd.org/MirOS/dist/jupp/${srcName}.tgz"
+    ];
+    sha256 = "S+1DnN5/K+KU6W5J7z6RPqkPvl6RTbiIQD46J+gDWxo=";
+  };
+
+  preConfigure = "chmod +x ./configure";
+
+  buildInputs = [
+    gpm
+    ncurses
+  ];
+
+  configureFlags = [
+    "--enable-curses"
+    "--enable-getpwnam"
+    "--enable-largefile"
+    "--enable-termcap"
+    "--enable-termidx"
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.mirbsd.org/jupp.htm";
+    downloadPage = "https://www.mirbsd.org/MirOS/dist/jupp/";
+    description = "Portable fork of Joe's editor";
+    longDescription = ''
+      This is the portable version of JOE's Own Editor, which is currently
+      developed at sourceforge, licenced under the GNU General Public License,
+      Version 1, using autoconf/automake. This version has been enhanced by
+      several functions intended for programmers or other professional users,
+      and has a lot of bugs fixed. It is based upon an older version of joe
+      because these behave better overall.
+    '';
+    license = licenses.gpl1Only;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/pkgs/by-name/ju/just/fix-just-path-in-tests.patch b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch
new file mode 100644
index 0000000000000..63587ebc698aa
--- /dev/null
+++ b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch
@@ -0,0 +1,20 @@
+diff --git a/tests/completions/just.bash b/tests/completions/just.bash
+index 6d5c12c..13bff87 100755
+--- a/tests/completions/just.bash
++++ b/tests/completions/just.bash
+@@ -17,11 +17,13 @@ reply_equals() {
+   fi
+ }
+ 
++just() {
++  cargo run -- "$@"
++}
++
+ # --- Initial Setup ---
+ source "$1"
+ cd tests/completions
+-cargo build
+-PATH="$(git rev-parse --show-toplevel)/target/debug:$PATH"
+ exit_code=0
+ 
+ # --- Tests ---
diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix
index c613853ef3d91..1698299526414 100644
--- a/pkgs/by-name/ju/just/package.nix
+++ b/pkgs/by-name/ju/just/package.nix
@@ -2,6 +2,7 @@
 , stdenv
 , fetchFromGitHub
 , rustPlatform
+, bashInteractive
 , coreutils
 , installShellFiles
 , libiconv
@@ -11,20 +12,20 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "just";
-  version = "1.25.2";
+  version = "1.35.0";
   outputs = [ "out" "man" "doc" ];
 
   src = fetchFromGitHub {
     owner = "casey";
     repo = pname;
     rev = "refs/tags/${version}";
-    hash = "sha256-w7tHLjIFnlvyuTw5yG6zxJtQ7oDNdKRXHIRKY638vTo=";
+    hash = "sha256-/5UzieioBzltFhzUoPOm6B4QKHFEquXCKo/2SPHkp2M=";
   };
 
-  cargoHash = "sha256-VL2uNbEtqOv3xmLukhdCmo3lrfx5yFwOAMGwgBlgAVw=";
+  cargoHash = "sha256-X3noVDRnnrR6xuOBfoH4JPdcPLOBHbGQb6opNvzK/TE=";
 
   nativeBuildInputs = [ installShellFiles mdbook ];
-  buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
 
   preCheck = ''
     # USER must not be empty
@@ -42,11 +43,27 @@ rustPlatform.buildRustPackage rec {
 
     # Return unchanged string.rs
     cp $TMPDIR/string.rs tests/string.rs
+
+    # For shell completion tests
+    export PATH=${bashInteractive}/bin:$PATH
+    patchShebangs tests
   '';
 
+  patches = [
+    ./fix-just-path-in-tests.patch
+  ];
+
   postBuild = ''
     cargo run --package generate-book
 
+    mkdir -p completions man
+
+    cargo run -- --man > man/just.1
+
+    for shell in bash fish zsh; do
+        cargo run -- --completions $shell > completions/just.$shell
+    done
+
     # No linkcheck in sandbox
     echo 'optional = true' >> book/en/book.toml
     mdbook build book/en
@@ -54,10 +71,12 @@ rustPlatform.buildRustPackage rec {
   '';
 
   checkFlags = [
-    "--skip=edit" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched
-    "--skip=run_shebang" # test case very rarely fails with "Text file busy"
-    "--skip=invoke_error_function" # wants JUST_CHOOSER to be fzf
+    "--skip=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell
+    "--skip=choose::invoke_error_function" # wants JUST_CHOOSER to be fzf
     "--skip=choose::default" # symlinks cat->fzf which fails as coreutils doesn't understand name
+    "--skip=config::tests::show_arguments" # interferes with JUST_CHOOSER being set
+    "--skip=edit::editor_precedence" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched
+    "--skip=shebang::run_shebang" # test case very rarely fails with "Text file busy"
   ];
 
   postInstall = ''
@@ -78,9 +97,9 @@ rustPlatform.buildRustPackage rec {
   meta = with lib; {
     homepage = "https://github.com/casey/just";
     changelog = "https://github.com/casey/just/blob/${version}/CHANGELOG.md";
-    description = "A handy way to save and run project-specific commands";
+    description = "Handy way to save and run project-specific commands";
     license = licenses.cc0;
-    maintainers = with maintainers; [ xrelkd jk adamcstephens ];
+    maintainers = with maintainers; [ xrelkd jk ];
     mainProgram = "just";
   };
 }
diff --git a/pkgs/by-name/ju/just/setup-hook.sh b/pkgs/by-name/ju/just/setup-hook.sh
index 0ffcfc187ebfa..d171ac7610bbc 100644
--- a/pkgs/by-name/ju/just/setup-hook.sh
+++ b/pkgs/by-name/ju/just/setup-hook.sh
@@ -1,7 +1,10 @@
+# shellcheck shell=bash
+
 justBuildPhase() {
     runHook preBuild
 
-    local flagsArray=($justFlags "${justFlagsArray[@]}")
+    local flagsArray=()
+    concatTo flagsArray justFlags justFlagsArray
 
     echoCmd 'build flags' "${flagsArray[@]}"
     just "${flagsArray[@]}"
@@ -14,17 +17,15 @@ justCheckPhase() {
 
     if [ -z "${checkTarget:-}" ]; then
         if just -n test >/dev/null 2>&1; then
-            checkTarget=test
+            checkTarget="test"
         fi
     fi
 
     if [ -z "${checkTarget:-}" ]; then
         echo "no test target found in just, doing nothing"
     else
-        local flagsArray=(
-            $justFlags "${justFlagsArray[@]}"
-            $checkTarget
-        )
+        local flagsArray=()
+        concatTo flagsArray justFlags justFlagsArray checkTarget
 
         echoCmd 'check flags' "${flagsArray[@]}"
         just "${flagsArray[@]}"
@@ -36,8 +37,8 @@ justCheckPhase() {
 justInstallPhase() {
     runHook preInstall
 
-    # shellcheck disable=SC2086
-    local flagsArray=($justFlags "${justFlagsArray[@]}" ${installTargets:-install})
+    local flagsArray=()
+    concatTo flagsArray justFlags justFlagsArray installTargets=install
 
     echoCmd 'install flags' "${flagsArray[@]}"
     just "${flagsArray[@]}"
@@ -45,14 +46,14 @@ justInstallPhase() {
     runHook postInstall
 }
 
-if [ -z "${dontUseJustBuild-}" -a -z "${buildPhase-}" ]; then
+if [ -z "${dontUseJustBuild-}" ] && [ -z "${buildPhase-}" ]; then
     buildPhase=justBuildPhase
 fi
 
-if [ -z "${dontUseJustCheck-}" -a -z "${checkPhase-}" ]; then
+if [ -z "${dontUseJustCheck-}" ] && [ -z "${checkPhase-}" ]; then
     checkPhase=justCheckPhase
 fi
 
-if [ -z "${dontUseJustInstall-}" -a -z "${installPhase-}" ]; then
+if [ -z "${dontUseJustInstall-}" ] && [ -z "${installPhase-}" ]; then
     installPhase=justInstallPhase
 fi
diff --git a/pkgs/by-name/ju/justbuild/package.nix b/pkgs/by-name/ju/justbuild/package.nix
index 550aa33497357..86274edd4f3e2 100644
--- a/pkgs/by-name/ju/justbuild/package.nix
+++ b/pkgs/by-name/ju/justbuild/package.nix
@@ -11,7 +11,7 @@
   openssl,
 
   pkg-config,
-  protobuf_24,
+  protobuf_25,
   grpc,
   pandoc,
   python3,
@@ -19,6 +19,7 @@
   wget,
   lib,
   jq,
+  coreutils,
 
   curl,
   libarchive,
@@ -27,23 +28,23 @@ let stdenv = gccStdenv;
 in
 stdenv.mkDerivation rec {
   pname = "justbuild";
-  version = "1.2.4";
+  version = "1.3.1";
 
   src = fetchFromGitHub {
     owner = "just-buildsystem";
     repo = "justbuild";
     rev = "v${version}";
-    sha256 = "sha256-+ZQuMWqZyK7x/tPSi2ldSOpAexpX6ku4ikk/V8m6Ksg=";
+    hash = "sha256-kv7HpDEYZml5uk06s8Cxt5rEpxaJBz9s+or6Od1q4Io=";
   };
 
   bazelapi = fetchurl {
     url = "https://github.com/bazelbuild/remote-apis/archive/e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0.tar.gz";
-    sha256 = "7421abd5352ccf927c2050453a4dbfa1f7b1c7170ec3e8702b6fe2d39b8805fe";
+    hash = "sha256-dCGr1TUsz5J8IFBFOk2/ofexxxcOw+hwK2/i05uIBf4=";
   };
 
   googleapi = fetchurl {
     url = "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz";
-    sha256 = "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0";
+    hash = "sha256-W7awJTzPZLU9bHJJYlp+P2w7xkAqvVLTd4v6SCWHA6A=";
   };
 
   nativeBuildInputs =
@@ -54,6 +55,7 @@ stdenv.mkDerivation rec {
       python3
       unzip
       wget
+      coreutils
 
       # Dependencies of just
       cli11
@@ -75,27 +77,20 @@ stdenv.mkDerivation rec {
     grpc
     libgit2
     openssl
-    # Using protobuf 24 because the current version of grpc is build using
-    # protobuf 24 and therefore the older protobuf version causes errors
-    # during build.
-    # Upstream currently uses protobuf 23 for bundled builds
-    # For future updates: The currently used version can be found in the file
-    # etc/repos.json: https://github.com/just-buildsystem/justbuild/blob/master/etc/repos.json
-    # under the key .repositories.protobuf
-    protobuf_24
+    protobuf_25
     python3
   ];
 
   postPatch = ''
     sed -ie 's|\./bin/just-mr.py|${python3}/bin/python3 ./bin/just-mr.py|' bin/bootstrap.py
     sed -ie 's|#!/usr/bin/env python3|#!${python3}/bin/python3|' bin/parallel-bootstrap-traverser.py
-    jq '.repositories.protobuf.pkg_bootstrap.local_path = "${protobuf_24}"' etc/repos.json > etc/repos.json.patched
+    jq '.repositories.protobuf.pkg_bootstrap.local_path = "${protobuf_25}"' etc/repos.json > etc/repos.json.patched
     mv etc/repos.json.patched etc/repos.json
     jq '.repositories.com_github_grpc_grpc.pkg_bootstrap.local_path = "${grpc}"' etc/repos.json > etc/repos.json.patched
     mv etc/repos.json.patched etc/repos.json
     jq '.unknown.PATH = []' etc/toolchain/CC/TARGETS > etc/toolchain/CC/TARGETS.patched
     mv etc/toolchain/CC/TARGETS.patched etc/toolchain/CC/TARGETS
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     sed -ie 's|-Wl,-z,stack-size=8388608|-Wl,-stack_size,0x800000|' bin/bootstrap.py
   '';
 
@@ -133,7 +128,6 @@ stdenv.mkDerivation rec {
     __EOF__
     export PKG_CONFIG_PATH=`pwd`/.pkgconfig''${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH
 
-
     # Bootstrap just
     export PACKAGE=YES
     export NON_LOCAL_DEPS='[ "google_apis", "bazel_remote_apis" ]'
@@ -143,8 +137,7 @@ stdenv.mkDerivation rec {
     python3 ./bin/bootstrap.py `pwd` ../build "`pwd`/.distfiles"
 
     # Build compiled just-mr
-    mkdir ../build-root
-    ../build/out/bin/just install 'installed just-mr' -c ../build/build-conf.json -C ../build/repo-conf.json --output-dir ../build/out --local-build-root ../build-root
+    ../build/out/bin/just install 'installed just-mr' -c ../build/build-conf.json -C ../build/repo-conf.json --output-dir ../build/out --local-build-root ../build/.just
 
     # convert man pages from Markdown to man
     find "./share/man" -name "*.md" -exec sh -c '${pandoc}/bin/pandoc --standalone --to man -o "''${0%.md}" "''${0}"' {} \;
@@ -160,6 +153,7 @@ stdenv.mkDerivation rec {
     install -m 755 -Dt "$out/bin" "../build/out/bin/just"
     install -m 755 -Dt "$out/bin" "../build/out/bin/just-mr"
     install -m 755 -DT "bin/just-import-git.py" "$out/bin/just-import-git"
+    install -m 755 -DT "bin/just-deduplicate-repos.py" "$out/bin/just-deduplicate-repos"
 
     mkdir -p "$out/share/bash-completion/completions"
     install -m 0644 ./share/just_complete.bash "$out/share/bash-completion/completions/just"
@@ -172,8 +166,8 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
-    description = "a generic build tool";
+    broken = stdenv.hostPlatform.isDarwin;
+    description = "Generic build tool";
     homepage = "https://github.com/just-buildsystem/justbuild";
     license = licenses.asl20;
     maintainers = with maintainers; [clkamp];