picocom: switch to maintained fork; linenoise: use fixDarwinDylibNames (#341391)

This commit is contained in:
Emily
2024-09-12 19:10:42 +01:00
committed by GitHub
6 changed files with 114 additions and 54 deletions
+15
View File
@@ -0,0 +1,15 @@
diff --git a/picocom.c b/picocom.c
index ba2f9bd666..d4df60f2d3 100644
--- a/picocom.c
+++ b/picocom.c
@@ -243,8 +243,8 @@
.send_cmd = "",
.receive_cmd = "",
#else
- .send_cmd = "sz -vv",
- .receive_cmd = "rz -vv -E",
+ .send_cmd = "@lrzsz@/bin/sz -vv",
+ .receive_cmd = "@lrzsz@/bin/rz -vv -E",
#endif
.imap = M_I_DFL,
.omap = M_O_DFL,
+66
View File
@@ -0,0 +1,66 @@
{
lib,
stdenv,
fetchFromGitLab,
replaceVars,
pkg-config,
go-md2man,
installShellFiles,
linenoise,
darwin,
lrzsz,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "picocom";
version = "2024-07";
src = fetchFromGitLab {
owner = "wsakernel";
repo = "picocom";
rev = finalAttrs.version;
hash = "sha256-cQoEfi75iltjeAm26NvXgfrL7d1Hm+1veQ4dVe0S1q8=";
};
patches = [
./use-system-linenoise.patch
(replaceVars ./lrzsz-path.patch { inherit lrzsz; })
];
nativeBuildInputs = [
pkg-config
go-md2man
installShellFiles
];
buildInputs = [
linenoise
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
makeFlags = [
"HISTFILE=.cache/picocom_history"
"all"
"doc"
];
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
install -Dm555 -t $out/bin picocom
installManPage picocom.1
installShellCompletion --bash bash_completion/picocom
runHook postInstall
'';
meta = {
description = "Minimal dumb-terminal emulation program";
homepage = "https://gitlab.com/wsakernel/picocom";
changelog = "https://gitlab.com/wsakernel/picocom/-/releases";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
mainProgram = "picocom";
};
})
@@ -0,0 +1,30 @@
diff --git a/Makefile b/Makefile
index 8fca24ee38..33b59b5b96 100644
--- a/Makefile
+++ b/Makefile
@@ -39,9 +39,9 @@
## Comment these out to disable "linenoise"-library support
HISTFILE = .picocom_history
CPPFLAGS += -DHISTFILE=\"$(HISTFILE)\" \
- -DLINENOISE
-OBJS += linenoise-1.0/linenoise.o
-linenoise-1.0/linenoise.o : linenoise-1.0/linenoise.c linenoise-1.0/linenoise.h
+ -DLINENOISE \
+ $(shell pkg-config --cflags linenoise)
+LDFLAGS += $(shell pkg-config --libs linenoise)
## Comment this in to enable (force) custom baudrate support
## even on systems not enabled by default.
diff --git a/picocom.c b/picocom.c
index 775ee9c3bb..ba2f9bd666 100644
--- a/picocom.c
+++ b/picocom.c
@@ -48,7 +48,7 @@
#include "split.h"
#include "term.h"
#ifdef LINENOISE
-#include "linenoise-1.0/linenoise.h"
+#include <linenoise.h>
#endif
#include "custbaud.h"
@@ -2,6 +2,7 @@
, stdenv
, fetchFromGitHub
, validatePkgConfig
, fixDarwinDylibNames
}:
stdenv.mkDerivation {
@@ -15,7 +16,8 @@ stdenv.mkDerivation {
hash = "sha256-GsrYg16gpjHkkmpCU3yGzqNS/buZl+JoWALLvwzmT4A=";
};
nativeBuildInputs = [ validatePkgConfig ];
nativeBuildInputs = [ validatePkgConfig ]
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
buildPhase = ''
runHook preBuild
-49
View File
@@ -1,49 +0,0 @@
{ lib, stdenv
, fetchFromGitHub
, installShellFiles
, lrzsz
, IOKit
}:
stdenv.mkDerivation rec {
pname = "picocom";
# last tagged release is 3.1 but 3.2 is still considered a release
version = "3.2a";
# upstream is quiet as the original author is no longer active since March 2018
src = fetchFromGitHub {
owner = "npat-efault";
repo = "picocom";
rev = "1acf1ddabaf3576b4023c4f6f09c5a3e4b086fb8";
sha256 = "sha256-cs2bxqZfTbnY5d+VJ257C5hssaFvYup3tBKz68ROnAo=";
};
postPatch = ''
substituteInPlace Makefile \
--replace '.picocom_history' '.cache/picocom_history'
substituteInPlace picocom.c \
--replace '"rz -vv -E"' '"${lrzsz}/bin/rz -vv -E"' \
--replace '"sz -vv"' '"${lrzsz}/bin/sz -vv"'
'';
enableParallelBuilding = true;
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optional stdenv.isDarwin IOKit;
installPhase = ''
install -Dm555 -t $out/bin picocom
installManPage picocom.1
installShellCompletion --bash bash_completion/picocom
'';
meta = with lib; {
description = "Minimal dumb-terminal emulation program";
homepage = "https://github.com/npat-efault/picocom/";
license = licenses.gpl2Plus;
platforms = platforms.unix;
mainProgram = "picocom";
};
}
-4
View File
@@ -32589,10 +32589,6 @@ with pkgs;
picard = callPackage ../applications/audio/picard { };
picocom = callPackage ../tools/misc/picocom {
inherit (darwin.apple_sdk.frameworks) IOKit;
};
picoloop = callPackage ../applications/audio/picoloop { };
picosnitch = callPackage ../tools/networking/picosnitch { };