about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/pt/pterm/0001-dtnetsubs-remove-null-check.patch16
-rw-r--r--pkgs/by-name/pt/pterm/package.nix48
2 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/by-name/pt/pterm/0001-dtnetsubs-remove-null-check.patch b/pkgs/by-name/pt/pterm/0001-dtnetsubs-remove-null-check.patch
new file mode 100644
index 0000000000000..043da784f0a7d
--- /dev/null
+++ b/pkgs/by-name/pt/pterm/0001-dtnetsubs-remove-null-check.patch
@@ -0,0 +1,16 @@
+diff --git a/dtnetsubs.c b/dtnetsubs.c
+index ad1c30d..c1fda9b 100644
+--- a/dtnetsubs.c
++++ b/dtnetsubs.c
+@@ -865,10 +865,7 @@ int dtSend (NetFet *fet, const void *buf, int len)
+     ** Update the IN pointer, then wake the send thread.
+     */
+     fet->sendin = in;
+-    if (ssemp (fet) != NULL)
+-    {
+-        sem_post (ssemp (fet));
+-    }
++    sem_post (ssemp (fet));
+     
+     if (dtSendFree (fet) == 0)
+         {
diff --git a/pkgs/by-name/pt/pterm/package.nix b/pkgs/by-name/pt/pterm/package.nix
new file mode 100644
index 0000000000000..c0d96e44f124a
--- /dev/null
+++ b/pkgs/by-name/pt/pterm/package.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, fetchurl
+, libsndfile
+, wxGTK32
+, SDL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pterm";
+  version = "6.0.4";
+
+  buildInputs = [ libsndfile SDL wxGTK32 ];
+
+  src = fetchurl {
+    url = "https://www.cyber1.org/download/linux/pterm-${version}.tar.bz2";
+    hash = "sha256-0OJvoCOGx/a51Ja7n3fOTeQJEcdyn/GhaJ0NtVCyuC8=";
+  };
+
+  patches = [ ./0001-dtnetsubs-remove-null-check.patch ];
+
+  preBuild = ''
+    substituteInPlace Makefile.common Makefile.wxpterm --replace "/bin/echo" "echo"
+    echo "exit 0" > wxversion.py
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  env.PTERMVERSION = "${version}";
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 "pterm" "$out/bin/pterm"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "terminal emulator for the Cyber1 mainframe-based CYBIS system";
+    homepage = "https://www.cyber1.org/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ sarcasticadmin ];
+    mainProgram = "pterm";
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin;
+  };
+}