Unverified Commit e7e14891 authored by figsoda's avatar figsoda Committed by GitHub
Browse files

Merge pull request #203457 from NixOS/backport-203279-to-release-22.11

[Backport release-22.11] patsh: init at 0.1.3
parents 525d803f 13bddf98
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, runCommand
, tree-sitter
}:

rustPlatform.buildRustPackage rec {
  pname = "patsh";
  version = "0.1.3";

  src = fetchFromGitHub {
    owner = "nix-community";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-KmQVZwZC7KHlzNnL2IKQ76wHUDNUZKz/aFaY4ujvBo4=";
  };

  cargoSha256 = "sha256-vozQKBxAVELdqTnqBpgHX0Wyk18EZAtpiRsKjwz8xKE=";

  # tests fail on darwin due to rpath issues
  doCheck = !stdenv.isDarwin;

  TREE_SITTER_BASH = runCommand "tree-sitter-bash" { } ''
    mkdir $out
    ln -s ${tree-sitter.builtGrammars.tree-sitter-bash}/parser $out/libtree-sitter-bash.a
  '';

  meta = with lib; {
    description = "A command-line tool for patching shell scripts inspired by resholve";
    homepage = "https://github.com/nix-community/patsh";
    changelog = "https://github.com/nix-community/patsh/blob/v${version}/CHANGELOG.md";
    license = licenses.mpl20;
    maintainers = with maintainers; [ figsoda ];
  };
}
+13 −18
Original line number Diff line number Diff line
{ lib
, bash
, coreutils
, stdenvNoCC
, fetchFromGitHub
, resholve
, patsh
, xorg
}:

resholve.mkDerivation rec {
stdenvNoCC.mkDerivation rec {
  pname = "sx";
  version = "2.1.7";

@@ -19,20 +18,16 @@ resholve.mkDerivation rec {

  makeFlags = [ "PREFIX=$(out)" ];

  solutions = {
    sx = {
      scripts = [ "bin/sx" ];
      interpreter = "${bash}/bin/sh";
      inputs = [
        coreutils
  nativeBuildInputs = [ patsh ];

  buildInputs = [
    xorg.xauth
    xorg.xorgserver
  ];
      execer = [
        "cannot:${xorg.xorgserver}/bin/Xorg"
      ];
    };
  };

  postInstall = ''
    patsh -f $out/bin/sx -s ${builtins.storeDir}
  '';

  meta = with lib; {
    description = "Simple alternative to both xinit and startx for starting a Xorg server";
+2 −0
Original line number Diff line number Diff line
@@ -17505,6 +17505,8 @@ with pkgs;
  patchelfUnstable = lowPrio (callPackage ../development/tools/misc/patchelf/unstable.nix { });
  patsh = callPackage ../development/tools/misc/patsh { };
  pax-rs = callPackage ../development/tools/pax-rs { };
  perfect-hash = callPackage ../development/tools/misc/perfect-hash { };