├── README.md ├── nvi-patched ├── nvi-04-confdefs.patch ├── nvi-08-safe_printf.patch ├── nvi-11-backward_sentence_moving.patch ├── nvi-12-horiz_scroll_count.patch ├── nvi-26-trailing_tab_segv.patch ├── nvi-18-dbpagesize_binpower.patch ├── nvi-06-default_value_escapetime.patch ├── nvi-03-db4.patch ├── nvi-30-regex-character-class.patch ├── nvi-09-casting.patch ├── nvi-10-no_one_line_visual.patch ├── nvi-19-include_term_h.patch ├── nvi-20-glibc_has_grantpt.patch ├── nvi-15-search_word.patch ├── nvi-08-tempfile_umask.patch ├── nvi-24-fallback_to_dumb_term.patch ├── nvi-29-file_backup.patch ├── nvi-08-lfs.patch ├── nvi-27-support_C_locale.patch ├── nvi-31-64bit-int-crash.patch ├── nvi-14-private_regex_fixes.patch ├── nvi-23-debian_alternatives.patch ├── nvi-07-flush_cache.patch ├── nvi-40-add-more-function-prototypes-to-fix-Wimplicit-functi.patch ├── nvi-21-exrc_writability_check.patch ├── nvi-50-nvi-o_path.patch ├── default.nix ├── nvi-13-widechar_horrors.patch └── nvi-39-add-function-prototypes-to-fix-implicit-function-dec.patch ├── openbsd-ed └── default.nix ├── flake.lock ├── vipe └── default.nix ├── tempo └── default.nix ├── yss └── default.nix ├── again └── default.nix ├── emltombox └── default.nix ├── ipinfo └── default.nix ├── sponge └── default.nix ├── dmarcreport └── default.nix ├── thermal └── default.nix ├── utfdumpcode └── default.nix ├── wakeonlan └── default.nix ├── htmlentify └── default.nix ├── go-pushover └── default.nix ├── ldifview └── default.nix ├── csvview └── default.nix ├── wg └── default.nix ├── printerinfo └── default.nix ├── s-nail └── default.nix ├── wifycon └── default.nix ├── dig-only └── default.nix └── flake.nix /README.md: -------------------------------------------------------------------------------- 1 | nix-yp 2 | ====== 3 | 4 | Personal NixOS packages 5 | -------------------------------------------------------------------------------- /nvi-patched/nvi-04-confdefs.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 04confdefs.dpatch by 3 | ## 4 | ## DP: Help configure by decreeing that some headers are present. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/build/confdefs.h nvi-1.81.6/build/confdefs.h 8 | --- nvi-1.81.6.orig/build/confdefs.h 1970-01-01 01:00:00.000000000 +0100 9 | +++ nvi-1.81.6/build/confdefs.h 2008-05-01 18:05:00.000000000 +0200 10 | @@ -0,0 +1,3 @@ 11 | + 12 | +#define HAVE_SYS_MMAN_H 1 13 | +#define HAVE_SYS_SELECT_H 1 14 | -------------------------------------------------------------------------------- /nvi-patched/nvi-08-safe_printf.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 08safe_printf.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/common/exf.c nvi-1.81.6/common/exf.c 8 | --- nvi-1.81.6.orig/common/exf.c 2008-05-01 18:10:20.000000000 +0200 9 | +++ nvi-1.81.6/common/exf.c 2008-05-01 18:10:30.000000000 +0200 10 | @@ -1075,7 +1075,7 @@ 11 | *--s = '.'; 12 | } 13 | } 14 | - msgq(sp, M_INFO, s); 15 | + msgq(sp, M_INFO, "%s", s); 16 | if (nf) 17 | FREE_SPACE(sp, p, 0); 18 | return (0); 19 | -------------------------------------------------------------------------------- /openbsd-ed/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | }: 5 | 6 | stdenv.mkDerivation { 7 | pname = "openbsd-ed"; 8 | version = "0.6"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "Ypnose"; 12 | repo = "openbsd-ed"; 13 | rev = "1cbf408584e430915ca91c272db4b1462817695f"; 14 | sha256 = "sha256-g2U1ZV05BCf4o/6YChx8LF/HoOj17gBsU/DyUxwqmpw="; 15 | }; 16 | 17 | dontConfigure = true; 18 | 19 | installPhase = '' 20 | install -Dm 0755 ed $out/bin/ed 21 | ''; 22 | 23 | meta = { 24 | homepage = "https://www.openbsd.org/"; 25 | description = "Line-oriented text editor"; 26 | platforms = lib.platforms.unix; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1762111121, 6 | "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "ref": "nixos-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /vipe/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "vipe"; 9 | version = "20250717"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "dce4bbcb3beaa09d4661e9479e3b19ce02c1e04e"; 15 | hash = "sha256-mMA9Unb0VeKfxtDGEh19cvlE6SJ1Ac85E9C6jmggne0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/vipe"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to edit piped data"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-11-backward_sentence_moving.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 11backward_sentence_moving.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/vi/v_sentence.c nvi-1.81.6/vi/v_sentence.c 8 | --- nvi-1.81.6.orig/vi/v_sentence.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/vi/v_sentence.c 2008-05-01 18:15:37.000000000 +0200 10 | @@ -291,7 +291,7 @@ 11 | * we can end up where we started. Fix it. 12 | */ 13 | if (vp->m_start.lno != cs.cs_lno || 14 | - vp->m_start.cno != cs.cs_cno) 15 | + vp->m_start.cno > cs.cs_cno) 16 | goto okret; 17 | 18 | /* 19 | -------------------------------------------------------------------------------- /tempo/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "tempo"; 9 | version = "20250403"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "bbdcf69422378cfc4126a4183722cc7128c3b316"; 15 | hash = "sha256-BiuF3XT7o0nILgDsLkJbU0RXSaYg79rpHS1cRhy54G0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/tempo"; 21 | 22 | ldflags = [ "-s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to get EDF Tempo color"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /yss/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | }: 5 | 6 | stdenv.mkDerivation { 7 | pname = "yss"; 8 | version = "20250220"; 9 | 10 | src = fetchurl { 11 | url = "https://framagit.org/Ypnose/yss/-/raw/master/yss"; 12 | hash = "sha256-e47NvHr/0g3C6c0vmZTafyTF3lSDqGp/PhqPd6QH1NI="; 13 | }; 14 | 15 | dontUnpack = true; 16 | dontConfigure = true; 17 | dontBuild = true; 18 | 19 | installPhase = '' 20 | install -Dm 0755 $src $out/bin/yss 21 | ''; 22 | 23 | meta = { 24 | homepage = "https://framagit.org/Ypnose/yss"; 25 | description = "Script to display some information about the current system"; 26 | platforms = lib.platforms.all; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /again/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "again"; 9 | version = "20250717"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "dce4bbcb3beaa09d4661e9479e3b19ce02c1e04e"; 15 | hash = "sha256-mMA9Unb0VeKfxtDGEh19cvlE6SJ1Ac85E9C6jmggne0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/again"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to execute commands repeatedly"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /emltombox/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "emltombox"; 9 | version = "20250717"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "dce4bbcb3beaa09d4661e9479e3b19ce02c1e04e"; 15 | hash = "sha256-mMA9Unb0VeKfxtDGEh19cvlE6SJ1Ac85E9C6jmggne0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/emltombox"; 21 | 22 | ldflags = [ "-s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to merge EML files to MBOX"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /ipinfo/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "ipinfo"; 9 | version = "20251127"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "9bb3b21dde867f87ebdffdf39cf427be19167207"; 15 | hash = "sha256-Wsh1ue5k0UEkobJ23koNdkOLO4RQUxPq/ga+/G8tuy8="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/ipinfo"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to gather information from IPinfo.io"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /sponge/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "sponge"; 9 | version = "20250717"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "dce4bbcb3beaa09d4661e9479e3b19ce02c1e04e"; 15 | hash = "sha256-mMA9Unb0VeKfxtDGEh19cvlE6SJ1Ac85E9C6jmggne0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/sponge"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to absorb stdin to write it in a file"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /dmarcreport/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "dmarcreport"; 9 | version = "20250930"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "89af542b73e88568d8e26b23b6817373c2c74482"; 15 | hash = "sha256-kkoYJbdy5QNPWqP60RLLHyzZVVD22CcHrWfODxBj/IQ="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/dmarcreport"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to display DMARC reports"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /thermal/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "thermal"; 9 | version = "20250731"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "7b69e2bf920f7b1322c003685cd2ff301dc19e70"; 15 | hash = "sha256-2n1E8ntWnyx0d1OAIJvOQaX/OupAZYFPp+hwG1++NWk="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/thermal"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to display sensors and thermal values"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /utfdumpcode/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "utfdumpcode"; 9 | version = "20250717"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "dce4bbcb3beaa09d4661e9479e3b19ce02c1e04e"; 15 | hash = "sha256-mMA9Unb0VeKfxtDGEh19cvlE6SJ1Ac85E9C6jmggne0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/utfdumpcode"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to dump Unicode code points"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /wakeonlan/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "wakeonlan"; 9 | version = "20250609"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "c2541b65a5b4a77fc0e739be5406bff695335055"; 15 | hash = "sha256-hb1N2UPkNuuXlV14UrFz0QPZ/Ye2HTRZL6vCcasX+VI="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/wakeonlan"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to send Wake-on-LAN magic packet"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /htmlentify/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "htmlentify"; 9 | version = "20251018"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "864cd1fd27dbd30cd08dc38fe947e6434d280d96"; 15 | hash = "sha256-pqkjGVnvaIfiycYClmg3t7tG/y8fCaF3kYEtY0sp9Z0="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/htmlentify"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to convert text to HTML entities"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /go-pushover/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "go-pushover"; 9 | version = "20251217"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "db1ada6b4998c0357add26ea7f1cbb582ff7c96d"; 15 | hash = "sha256-StSBMZ95LM2SaAX3KqQKzDg6UQR63bJtctgI9DS/ufo="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/go-pushover"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to send data to Pushover Message API"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /ldifview/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "ldifview"; 9 | version = "20250930"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "89af542b73e88568d8e26b23b6817373c2c74482"; 15 | hash = "sha256-kkoYJbdy5QNPWqP60RLLHyzZVVD22CcHrWfODxBj/IQ="; 16 | }; 17 | 18 | vendorHash = null; 19 | 20 | sourceRoot = "${src.name}/ldifview"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to display LDAP directory structure from LDIF"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-12-horiz_scroll_count.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 12horiz_scroll_count.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/vi/vs_refresh.c nvi-1.81.6/vi/vs_refresh.c 8 | --- nvi-1.81.6.orig/vi/vs_refresh.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/vi/vs_refresh.c 2008-05-01 18:16:01.000000000 +0200 10 | @@ -569,7 +569,7 @@ 11 | * for the number option offset. 12 | */ 13 | cnt = vs_columns(sp, NULL, LNO, &CNO, NULL); 14 | - if (O_ISSET(sp, O_NUMBER)) 15 | + if (O_ISSET(sp, O_NUMBER) && cnt) 16 | cnt -= O_NUMBER_LENGTH; 17 | 18 | /* Adjust the window towards the beginning of the line. */ 19 | -------------------------------------------------------------------------------- /csvview/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "csvview"; 9 | version = "20251021"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "9f603ec8ffae56bb6b3b7c4b0093cf7126b1cd19"; 15 | hash = "sha256-At8WwuOOCw0NFCKTu+G5rWNv7m2HtAFAnV6WDATcz+M="; 16 | }; 17 | 18 | vendorHash = "sha256-ew4OejtBoLuAnT2GbQWKSbvO9efLw/BUKfhSmX4y7c0="; 19 | 20 | sourceRoot = "${src.name}/csvview"; 21 | 22 | ldflags = [ "-s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to view and edit CSV files"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /wg/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchzip 4 | }: 5 | 6 | stdenv.mkDerivation rec { 7 | pname = "wg"; 8 | version = "1.0.20210914"; 9 | 10 | src = fetchzip { 11 | url = "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${version}.tar.xz"; 12 | sha256 = "sha256-eGGkTVdPPTWK6iEyowW11F4ywRhd+0IXJTZCqY3OZws="; 13 | }; 14 | 15 | sourceRoot = "${src.name}/src"; 16 | 17 | dontConfigure = true; 18 | 19 | installPhase = '' 20 | install -Dm 0755 wg $out/bin/wg 21 | ''; 22 | 23 | meta = { 24 | description = "Configuration tool for setting WireGuard tunnel interfaces"; 25 | homepage = "https://www.wireguard.com/"; 26 | platforms = lib.platforms.unix; 27 | license = lib.licenses.gpl2; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /printerinfo/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , buildGoModule 5 | }: 6 | 7 | buildGoModule rec { 8 | pname = "printerinfo"; 9 | version = "20251021"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ypnose"; 13 | repo = "gools"; 14 | rev = "9f603ec8ffae56bb6b3b7c4b0093cf7126b1cd19"; 15 | hash = "sha256-At8WwuOOCw0NFCKTu+G5rWNv7m2HtAFAnV6WDATcz+M="; 16 | }; 17 | 18 | vendorHash = "sha256-95aTIiAZja0HFdrBq4h9EwzNygBOEWlbjRBXLuXYdm4="; 19 | 20 | sourceRoot = "${src.name}/printerinfo"; 21 | 22 | ldflags = [ "-w -s" ]; 23 | 24 | meta = { 25 | homepage = "https://github.com/Ypnose/gools"; 26 | description = "Simple tool to show printer info using SNMP"; 27 | platforms = lib.platforms.unix; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-26-trailing_tab_segv.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 26trailing_tab_segv.dpatch by 3 | ## 4 | ## DP: Prevent a segfault if a trailing tab is pushed to a new line by inserting 5 | ## DP: characters before it if 'set number' is in effect. 6 | 7 | @DPATCH@ 8 | --- nvi-1.81.6+debian.orig/vi/vs_relative.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6+debian/vi/vs_relative.c 2008-06-13 03:22:55.000000000 +0200 10 | @@ -133,7 +133,7 @@ 11 | * Initialize the pointer into the buffer and current offset. 12 | */ 13 | p = lp; 14 | - curoff = 0; 15 | + curoff = scno; 16 | 17 | /* Macro to return the display length of any signal character. */ 18 | #define CHLEN(val) (ch = *(UCHAR_T *)p++) == '\t' && \ 19 | -------------------------------------------------------------------------------- /nvi-patched/nvi-18-dbpagesize_binpower.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 18dbpagesize_binpower.dpatch by 3 | ## 4 | ## DP: Make sure that the pagesize passed to db__set_pagesize() is 5 | ## DP: a power of two. 6 | 7 | @DPATCH@ 8 | --- nvi-1.81.6.orig/common/exf.c 2009-03-09 01:48:01.695862889 +0100 9 | +++ nvi-1.81.6/common/exf.c 2009-03-09 10:42:41.147866272 +0100 10 | @@ -249,11 +249,10 @@ 11 | * (vi should have good locality) or smaller than 1K. 12 | */ 13 | psize = ((sb.st_size / 15) + 1023) / 1024; 14 | - if (psize > 10) 15 | - psize = 10; 16 | - if (psize == 0) 17 | - psize = 1; 18 | - psize *= 1024; 19 | + if (psize >= 8) psize=8<<10; 20 | + else if (psize >= 4) psize=4<<10; 21 | + else if (psize >= 2) psize=2<<10; 22 | + else psize=1<<10; 23 | 24 | F_SET(ep, F_DEVSET); 25 | ep->mdev = sb.st_dev; 26 | -------------------------------------------------------------------------------- /nvi-patched/nvi-06-default_value_escapetime.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 06default_value_escapetime.dpatch by 3 | ## 4 | ## DP: Increase the default 'escapetime' setting to accommodate slow lines. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/common/options.c nvi-1.81.6/common/options.c 8 | --- nvi-1.81.6.orig/common/options.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/common/options.c 2008-05-01 18:06:18.000000000 +0200 10 | @@ -356,7 +356,7 @@ 11 | (void)SPRINTF(b2, SIZE(b2), 12 | L("directory=%s"), (s = getenv("TMPDIR")) == NULL ? _PATH_TMP : s); 13 | OI(O_TMP_DIRECTORY, b2); 14 | - OI(O_ESCAPETIME, L("escapetime=1")); 15 | + OI(O_ESCAPETIME, L("escapetime=3")); 16 | OI(O_KEYTIME, L("keytime=6")); 17 | OI(O_MATCHTIME, L("matchtime=7")); 18 | (void)SPRINTF(b2, SIZE(b2), L("msgcat=%s"), _PATH_MSGCAT); 19 | -------------------------------------------------------------------------------- /nvi-patched/nvi-03-db4.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 03db4.dpatch by 3 | ## 4 | ## DP: libdb4 compatibility adjustments. 5 | 6 | @DPATCH@ 7 | --- nvi-1.81.6.orig/common/msg.c 2009-02-26 14:26:58.350336128 +0100 8 | +++ nvi-1.81.6/common/msg.c 2009-02-26 14:29:05.235335829 +0100 9 | @@ -724,9 +724,18 @@ 10 | p = buf; 11 | } else 12 | p = file; 13 | + if (access(p, F_OK) != 0) { 14 | + if (first) { 15 | + first = 0; 16 | + return (1); 17 | + } 18 | + sp->db_error = ENOENT; 19 | + msgq_str(sp, M_DBERR, p, "%s"); 20 | + return (1); 21 | + } 22 | if ((sp->db_error = db_create(&db, 0, 0)) != 0 || 23 | (sp->db_error = db->set_re_source(db, p)) != 0 || 24 | - (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) { 25 | + (sp->db_error = db_open(db, NULL, DB_RECNO, DB_CREATE, 0)) != 0) { 26 | if (first) { 27 | first = 0; 28 | return (1); 29 | -------------------------------------------------------------------------------- /nvi-patched/nvi-30-regex-character-class.patch: -------------------------------------------------------------------------------- 1 | From: Wolfgang Jenkner 2 | Date: Thu, 22 May 2008 16:33:57 +0200 3 | Subject: [PATCH] p_b_cclass found the wrong cclass, due to a logical glitch. 4 | 5 | E.g., it would find the cclass corresponding to [:alpha:] when searching 6 | for the [:alnum:] one. 7 | --- 8 | regex/regcomp.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/regex/regcomp.c b/regex/regcomp.c 12 | index b7509413..0b276aff 100644 13 | --- a/regex/regcomp.c 14 | +++ b/regex/regcomp.c 15 | @@ -818,7 +818,7 @@ p_b_cclass(register struct parse *p, register cset *cs) 16 | NEXT(); 17 | len = p->next - sp; 18 | for (cp = cclasses; cp->name != NULL; cp++) 19 | - if (STRLEN(cp->name) == len && MEMCMP(cp->name, sp, len)) 20 | + if (STRLEN(cp->name) == len && !MEMCMP(cp->name, sp, len)) 21 | break; 22 | if (cp->name == NULL) { 23 | /* oops, didn't find it */ 24 | -- 25 | 2.37.2 26 | 27 | -------------------------------------------------------------------------------- /nvi-patched/nvi-09-casting.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 09casting.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/vi/v_ch.c nvi-1.81.6/vi/v_ch.c 8 | --- nvi-1.81.6.orig/vi/v_ch.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/vi/v_ch.c 2008-05-01 18:14:03.000000000 +0200 10 | @@ -165,7 +165,7 @@ 11 | endp = (startp = p) + len; 12 | p += vp->m_start.cno; 13 | for (cnt = F_ISSET(vp, VC_C1SET) ? vp->count : 1; cnt--;) { 14 | - while (++p < endp && *p != key); 15 | + while (++p < endp && *p != (char) key); 16 | if (p == endp) { 17 | notfound(sp, key); 18 | return (1); 19 | @@ -247,7 +247,7 @@ 20 | endp = p - 1; 21 | p += vp->m_start.cno; 22 | for (cnt = F_ISSET(vp, VC_C1SET) ? vp->count : 1; cnt--;) { 23 | - while (--p > endp && *p != key); 24 | + while (--p > endp && *p != (char) key); 25 | if (p == endp) { 26 | notfound(sp, key); 27 | return (1); 28 | -------------------------------------------------------------------------------- /nvi-patched/nvi-10-no_one_line_visual.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 10no_one_line_visual.dpatch by 3 | ## 4 | ## DP: Catch segfaults when the screen is only one line high. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/vi/vi.c nvi-1.81.6/vi/vi.c 8 | --- nvi-1.81.6.orig/vi/vi.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/vi/vi.c 2008-05-01 18:15:14.000000000 +0200 10 | @@ -974,6 +974,14 @@ 11 | sp->rows = vip->srows = O_VAL(sp, O_LINES); 12 | sp->cols = O_VAL(sp, O_COLUMNS); 13 | sp->t_rows = sp->t_minrows = O_VAL(sp, O_WINDOW); 14 | + /* 15 | + * To avoid segfaults on terminals with only one line, 16 | + * catch this corner case now and die explicitly. 17 | + */ 18 | + if (sp->t_rows == 0) { 19 | + (void)fprintf(stderr, "Error: Screen too small for visual mode.\n"); 20 | + return 1; 21 | + } 22 | if (sp->rows != 1) { 23 | if (sp->t_rows > sp->rows - 1) { 24 | sp->t_minrows = sp->t_rows = sp->rows - 1; 25 | -------------------------------------------------------------------------------- /nvi-patched/nvi-19-include_term_h.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 19include_term_h.dpatch by 3 | ## 4 | ## DP: Add to the include list to suppress a few warnings. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/cl/cl_funcs.c nvi-1.81.6/cl/cl_funcs.c 8 | --- nvi-1.81.6.orig/cl/cl_funcs.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/cl/cl_funcs.c 2008-05-01 18:23:08.000000000 +0200 10 | @@ -18,6 +18,7 @@ 11 | #include 12 | 13 | #include 14 | +#include 15 | #include 16 | #include 17 | #include 18 | diff -Naur nvi-1.81.6.orig/cl/cl_screen.c nvi-1.81.6/cl/cl_screen.c 19 | --- nvi-1.81.6.orig/cl/cl_screen.c 2007-11-18 17:41:42.000000000 +0100 20 | +++ nvi-1.81.6/cl/cl_screen.c 2008-05-01 18:23:02.000000000 +0200 21 | @@ -17,6 +17,7 @@ 22 | #include 23 | 24 | #include 25 | +#include 26 | #include 27 | #include 28 | #include 29 | -------------------------------------------------------------------------------- /nvi-patched/nvi-20-glibc_has_grantpt.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 20glibc_has_grantpt.dpatch by 3 | ## 4 | ## DP: glibc has grantpt(), so only hceck for HAVE_SYS5_PTY 5 | ## DP: on non-glibc installations. 6 | 7 | @DPATCH@ 8 | diff -Naur nvi-1.81.6.orig/ex/ex_script.c nvi-1.81.6/ex/ex_script.c 9 | --- nvi-1.81.6.orig/ex/ex_script.c 2007-11-18 17:41:42.000000000 +0100 10 | +++ nvi-1.81.6/ex/ex_script.c 2008-05-01 18:24:06.000000000 +0200 11 | @@ -23,7 +23,8 @@ 12 | #include 13 | #endif 14 | #include 15 | -#ifdef HAVE_SYS5_PTY 16 | +/* glibc2.1 defines grantpt but there is no stropts.h */ 17 | +#if defined(HAVE_SYS5_PTY) && !defined(__GLIBC__) 18 | #include 19 | #endif 20 | #include 21 | @@ -664,7 +665,7 @@ 22 | F_CLR(gp, G_SCRWIN); 23 | } 24 | 25 | -#ifdef HAVE_SYS5_PTY 26 | +#if defined(HAVE_SYS5_PTY) && !defined(__GLIBC__) 27 | static int ptys_open __P((int, char *)); 28 | static int ptym_open __P((char *)); 29 | 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-15-search_word.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 15search_word.dpatch by Al Viro 3 | ## 4 | ## DP: Fix {^A} command. (End-of-word was not included in search 5 | ## DP: regexp leading to false positives.) 6 | 7 | @DPATCH@ 8 | --- nvi-1.81.6.orig/vi/v_search.c 2007-11-18 11:41:42.000000000 -0500 9 | +++ nvi-1.81.6/vi/v_search.c 2009-03-05 15:37:37.000000000 -0500 10 | @@ -322,16 +322,17 @@ 11 | v_searchw(SCR *sp, VICMD *vp) 12 | { 13 | size_t blen, len; 14 | + size_t olen = STRLEN(VIP(sp)->keyw); 15 | int rval; 16 | CHAR_T *bp, *p; 17 | 18 | - len = VIP(sp)->klen + RE_WSTART_LEN + RE_WSTOP_LEN; 19 | + len = olen + RE_WSTART_LEN + RE_WSTOP_LEN; 20 | GET_SPACE_RETW(sp, bp, blen, len); 21 | MEMCPY(bp, RE_WSTART, RE_WSTART_LEN); 22 | p = bp + RE_WSTART_LEN; 23 | - MEMCPY(p, VIP(sp)->keyw, VIP(sp)->klen); 24 | - p += VIP(sp)->klen; 25 | + MEMCPY(p, VIP(sp)->keyw, olen); 26 | + p += olen; 27 | MEMCPY(p, RE_WSTOP, RE_WSTOP_LEN); 28 | 29 | rval = v_search(sp, vp, bp, len, SEARCH_SET, FORWARD); 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-08-tempfile_umask.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 08tempfile_umask.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/common/exf.c nvi-1.81.6/common/exf.c 8 | --- nvi-1.81.6.orig/common/exf.c 2008-05-01 18:10:45.000000000 +0200 9 | +++ nvi-1.81.6/common/exf.c 2008-05-01 18:13:23.000000000 +0200 10 | @@ -207,16 +207,21 @@ 11 | */ 12 | oname = frp->name; 13 | if (LF_ISSET(FS_OPENERR) || oname == NULL || !exists) { 14 | + mode_t orig_umask; 15 | if (opts_empty(sp, O_TMP_DIRECTORY, 0)) 16 | goto err; 17 | + orig_umask = umask(0); 18 | + umask(orig_umask & 0177); 19 | (void)snprintf(tname, sizeof(tname), 20 | "%s/vi.XXXXXX", O_STR(sp, O_TMP_DIRECTORY)); 21 | if ((fd = mkstemp(tname)) == -1) { 22 | + umask(orig_umask); 23 | msgq(sp, M_SYSERR, 24 | "237|Unable to create temporary file"); 25 | goto err; 26 | } 27 | (void)close(fd); 28 | + umask(orig_umask); 29 | 30 | if (frp->name == NULL) 31 | F_SET(frp, FR_TMPFILE); 32 | -------------------------------------------------------------------------------- /s-nail/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , perl 5 | , ncurses 6 | , openssl 7 | , libidn2 8 | }: 9 | 10 | stdenv.mkDerivation rec { 11 | pname = "s-nail"; 12 | version = "14.9.25"; 13 | 14 | src = fetchurl { 15 | url = "https://www.sdaoden.eu/downloads/s-nail-${version}.tar.xz"; 16 | hash = "sha256-IP8FW+mCm2nUbrxADf5RakDSh9fOgQx0NV1r3Boo2Kk="; 17 | }; 18 | 19 | nativeBuildInputs = [ perl ]; 20 | buildInputs = [ ncurses openssl libidn2 ]; 21 | 22 | strictDeps = true; 23 | dontConfigure = true; 24 | 25 | buildPhase = '' 26 | make config \ 27 | OPT_GSSAPI=no \ 28 | OPT_POP3=no \ 29 | VAL_PAGER=less \ 30 | VAL_PREFIX=/ \ 31 | VAL_SYSCONFDIR=/etc \ 32 | VAL_MAIL=/var/spool/mail 33 | make build 34 | ''; 35 | 36 | installPhase = '' 37 | make DESTDIR=$out packager-install 38 | ''; 39 | 40 | meta = { 41 | homepage = "https://www.sdaoden.eu/code.html#s-mailx"; 42 | description = "Environment for sending and receiving mail"; 43 | platforms = lib.platforms.unix; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /nvi-patched/nvi-24-fallback_to_dumb_term.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 24fallback_to_dumb_term.dpatch by 3 | ## 4 | ## DP: If there's no $TERM around, just fall back to "dumb". 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/cl/cl_main.c nvi-1.81.6/cl/cl_main.c 8 | --- nvi-1.81.6.orig/cl/cl_main.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/cl/cl_main.c 2008-05-01 18:29:13.000000000 +0200 10 | @@ -96,6 +96,7 @@ 11 | if ((ttype = getenv("TERM")) == NULL) 12 | ttype = "unknown"; 13 | term_init(gp->progname, ttype); 14 | + ttype = getenv("TERM"); 15 | 16 | /* Add the terminal type to the global structure. */ 17 | if ((OG_D_STR(gp, GO_TERM) = 18 | @@ -233,6 +234,11 @@ 19 | 20 | /* Set up the terminal database information. */ 21 | setupterm(ttype, STDOUT_FILENO, &err); 22 | + if (err == 0) { 23 | + (void)fprintf(stderr, "%s: %s: unknown terminal type, falling back to 'dumb'\n", name, ttype); 24 | + setenv("TERM", "dumb", 1); 25 | + setupterm("dumb", STDOUT_FILENO, &err); 26 | + } 27 | switch (err) { 28 | case -1: 29 | (void)fprintf(stderr, 30 | -------------------------------------------------------------------------------- /nvi-patched/nvi-29-file_backup.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 29file_backup.dpatch by 3 | ## 4 | ## DP: Save the intermediate CHAR2INT conversion pointer because 5 | ## DP: that pointer is reused by later conversions in calls below. 6 | 7 | @DPATCH@ 8 | --- nvi-1.81.6.orig/common/exf.c 2009-07-24 11:30:05.962060755 +0200 9 | +++ nvi-1.81.6/common/exf.c 2009-07-24 12:09:57.511311177 +0200 10 | @@ -1092,8 +1092,8 @@ 11 | size_t blen; 12 | int flags, maxnum, nr, num, nw, rfd, wfd, version; 13 | char *bp, *estr, *p, *pct, *slash, *t, *wfname, buf[8192]; 14 | - CHAR_T *wp; 15 | - size_t wlen; 16 | + CHAR_T *wp, *wp2; 17 | + size_t wlen, wlen2; 18 | size_t nlen; 19 | char *d = NULL; 20 | 21 | @@ -1148,8 +1148,13 @@ 22 | } else 23 | version = 0; 24 | CHAR2INT(sp, bname, strlen(bname) + 1, wp, wlen); 25 | - if (argv_exp2(sp, &cmd, wp, wlen - 1)) 26 | + GET_SPACE_RETW(sp, wp2, wlen2, wlen); 27 | + MEMCPY(wp2, wp, wlen); 28 | + if (argv_exp2(sp, &cmd, wp2, wlen2 - 1)) { 29 | + FREE_SPACEW(sp, wp2, wlen2); 30 | return (1); 31 | + } 32 | + FREE_SPACEW(sp, wp2, wlen2); 33 | 34 | /* 35 | * 0 args: impossible. 36 | -------------------------------------------------------------------------------- /wifycon/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , pkgs 3 | , stdenv 4 | , fetchurl 5 | , makeWrapper 6 | , iproute2 7 | , procps 8 | , wpa_supplicant 9 | , dhcpcd 10 | }: 11 | 12 | let 13 | path = lib.makeBinPath ([ 14 | iproute2 15 | procps 16 | wpa_supplicant 17 | dhcpcd 18 | ]); 19 | in stdenv.mkDerivation { 20 | pname = "wifycon"; 21 | version = "20250706"; 22 | 23 | src = fetchurl { 24 | url = "https://raw.githubusercontent.com/Ypnose/dotfiles/master/bin/wifycon"; 25 | hash = "sha256-2EtE7/Kh8Tpeb9ChKRmJ9K64DA7ooqdgfFoXx4pG5ZQ="; 26 | }; 27 | 28 | dontUnpack = true; 29 | dontConfigure = true; 30 | dontBuild = true; 31 | 32 | nativeBuildInputs = [ makeWrapper ]; 33 | 34 | installPhase = '' 35 | install -Dm 0755 $src $out/bin/wifycon 36 | # Make sure shebang is modified 37 | sed -i "1 s|/usr/bin/mksh|${lib.getBin pkgs.mksh}/bin/mksh|" \ 38 | $out/bin/wifycon 39 | wrapProgram $out/bin/wifycon \ 40 | --prefix PATH : ${path} 41 | ''; 42 | 43 | meta = { 44 | homepage = "https://github.com/Ypnose/dotfiles"; 45 | description = "Script to connect on Wi-Fi networks"; 46 | platforms = lib.platforms.all; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /nvi-patched/nvi-08-lfs.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 08lfs.dpatch by 3 | ## 4 | ## DP: Insert a safety check to save large files from being overwritten. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/common/exf.c nvi-1.81.6/common/exf.c 8 | --- nvi-1.81.6.orig/common/exf.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/common/exf.c 2008-05-01 18:09:55.000000000 +0200 10 | @@ -157,6 +157,18 @@ 11 | */ 12 | if (file_spath(sp, frp, &sb, &exists)) 13 | return (1); 14 | + /* 15 | + * On LFS systems, it's possible that stat returned an error because 16 | + * the file is >2GB, which nvi would normally treat as "doesn't exist" 17 | + * and eventually overwrite. That's no good. Rather than mess with 18 | + * every stat() call in file_spath, we'll just check again here. 19 | + */ 20 | + if (!exists && stat(frp->name, &sb)) { 21 | + if (errno == EOVERFLOW) { 22 | + msgq(sp, M_ERR, "File too large (>2GB, probably)"); 23 | + goto err; 24 | + } 25 | + } 26 | 27 | /* 28 | * Check whether we already have this file opened in some 29 | -------------------------------------------------------------------------------- /nvi-patched/nvi-27-support_C_locale.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 27support_C_locale.dpatch by 3 | ## 4 | ## DP: Allow users to edit 8-bit files even under LC_CTYPE=C. 5 | 6 | @DPATCH@ 7 | --- nvi-1.81.6.orig/common/conv.c 2007-11-18 17:41:42.000000000 +0100 8 | +++ nvi-1.81.6/common/conv.c 2009-03-09 16:45:37.812022582 +0100 9 | @@ -322,11 +322,16 @@ 10 | else { 11 | setlocale(LC_ALL, ""); 12 | #ifdef USE_WIDECHAR 13 | - sp->conv.sys2int = cs_char2int; 14 | - sp->conv.int2sys = cs_int2char; 15 | - sp->conv.file2int = fe_char2int; 16 | - sp->conv.int2file = fe_int2char; 17 | - sp->conv.input2int = ie_char2int; 18 | + if (!strcmp(LANGCODESET, "ANSI_X3.4-1968")) { 19 | + sp->conv.file2int = sp->conv.input2int = sp->conv.sys2int = raw2int; 20 | + sp->conv.int2sys = sp->conv.int2file = int2raw; 21 | + } else { 22 | + sp->conv.sys2int = cs_char2int; 23 | + sp->conv.int2sys = cs_int2char; 24 | + sp->conv.file2int = fe_char2int; 25 | + sp->conv.int2file = fe_int2char; 26 | + sp->conv.input2int = ie_char2int; 27 | + } 28 | #endif 29 | #ifdef USE_ICONV 30 | o_set(sp, O_FILEENCODING, OS_STRDUP, nl_langinfo(CODESET), 0); 31 | -------------------------------------------------------------------------------- /nvi-patched/nvi-31-64bit-int-crash.patch: -------------------------------------------------------------------------------- 1 | From: Sven Verdoolaege 2 | Date: Wed, 30 Dec 2009 08:36:11 +0100 3 | Subject: [PATCH] common/conv.c: fix segmentation fault during conversion on 4 | 64bit machines 5 | 6 | The second argument of iconv is of type size_t * and not of type int *. 7 | --- 8 | common/conv.c | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/common/conv.c b/common/conv.c 12 | index 02dfd32b..9884a634 100644 13 | --- a/common/conv.c 14 | +++ b/common/conv.c 15 | @@ -89,7 +89,7 @@ int 16 | default_char2int(SCR *sp, const char * str, ssize_t len, CONVWIN *cw, 17 | size_t *tolen, CHAR_T **dst, char *enc) 18 | { 19 | - int i = 0, j; 20 | + size_t i = 0, j; 21 | CHAR_T **tostr = (CHAR_T **)&cw->bp1; 22 | size_t *blen = &cw->blen1; 23 | mbstate_t mbs; 24 | @@ -210,7 +210,7 @@ int 25 | default_int2char(SCR *sp, const CHAR_T * str, ssize_t len, CONVWIN *cw, 26 | size_t *tolen, char **pdst, char *enc) 27 | { 28 | - int i, j, offset = 0; 29 | + size_t i, j, offset = 0; 30 | char **tostr = (char **)&cw->bp1; 31 | size_t *blen = &cw->blen1; 32 | mbstate_t mbs; 33 | -- 34 | 2.37.2 35 | 36 | -------------------------------------------------------------------------------- /nvi-patched/nvi-14-private_regex_fixes.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 14private_regex_fixes.dpatch by 3 | ## 4 | ## DP: Fixes to the private regex library; includes fix for #523934. 5 | 6 | @DPATCH@ 7 | diff -Naur regex.orig/regcomp.c regex/regcomp.c 8 | --- nvi-1.81.6.orig/regex/regcomp.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/regex/regcomp.c 2008-05-01 18:37:57.000000000 +0200 10 | @@ -606,7 +606,8 @@ 11 | REQUIRE(starordinary, REG_BADRPT); 12 | /* FALLTHROUGH */ 13 | default: 14 | - ordinary(p, c &~ BACKSL); 15 | + /* ordinary(p, c &~ BACKSL); -- Fix potential overflow */ 16 | + ordinary(p, c & 0xff); 17 | break; 18 | } 19 | 20 | diff -Naur regex.orig/regexec.c regex/regexec.c 21 | --- nvi-1.81.6.orig/regex/regexec.c 2007-11-18 17:41:42.000000000 +0100 22 | +++ nvi-1.81.6/regex/regexec.c 2008-05-01 18:38:00.000000000 +0200 23 | @@ -63,7 +63,7 @@ 24 | 25 | /* macros for manipulating states, small version */ 26 | #define states int 27 | -#define states1 states /* for later use in regexec() decision */ 28 | +typedef states states1; /* for later use in regexec() decision */ 29 | #define CLEAR(v) ((v) = 0) 30 | #define SET0(v, n) ((v) &= ~(1 << (n))) 31 | #define SET1(v, n) ((v) |= 1 << (n)) 32 | -------------------------------------------------------------------------------- /nvi-patched/nvi-23-debian_alternatives.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 23debian_alternatives.dpatch by 3 | ## 4 | ## DP: Adapt the internal program name if nvi was called via one of 5 | ## DP: the Debian alternative symlinks. 6 | 7 | @DPATCH@ 8 | diff -Naur nvi-1.81.6.orig/common/gs.c nvi-1.81.6/common/gs.c 9 | --- nvi-1.81.6.orig/common/gs.c 2007-11-18 17:41:42.000000000 +0100 10 | +++ nvi-1.81.6/common/gs.c 2008-05-01 18:28:44.000000000 +0200 11 | @@ -45,6 +45,24 @@ 12 | 13 | gp->progname = name; 14 | 15 | +#ifdef DEBIAN 16 | + /* This is because of the Debian alternatives system. The 17 | + definitions of editor, vi, view, and ex are transient. This 18 | + would be ok, except that the recovery file hardcodes the 19 | + name. The downside of this is that the error messages may 20 | + not quite match what the user expects */ 21 | + 22 | + if (!strcmp(name, "editor")) { 23 | + gp->progname = "nvi"; 24 | + } else if (!strcmp(name, "vi")){ 25 | + gp->progname = "nvi"; 26 | + } else if (!strcmp(name, "view")){ 27 | + gp->progname = "nview"; 28 | + } else if (!strcmp(name, "ex")){ 29 | + gp->progname = "nex"; 30 | + } 31 | +#endif /* DEBIAN */ 32 | + 33 | /* Common global structure initialization. */ 34 | /* others will need to be copied from main.c */ 35 | CIRCLEQ_INIT(&gp->dq); 36 | -------------------------------------------------------------------------------- /dig-only/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , pkg-config 5 | , perl 6 | , libidn2 7 | , libtool 8 | , openssl 9 | , libuv 10 | }: 11 | 12 | stdenv.mkDerivation rec { 13 | pname = "bind"; 14 | version = "9.18.39"; 15 | 16 | src = fetchurl { 17 | url = "https://downloads.isc.org/isc/bind9/${version}/${pname}-${version}.tar.xz"; 18 | hash = "sha256-cldVIyGG875KB9fkCXijOJQ0vvfAzcJizGQaNkByl20="; 19 | }; 20 | 21 | nativeBuildInputs = [ pkg-config perl ]; 22 | buildInputs = [ libidn2 libtool openssl libuv ]; 23 | 24 | configureFlags = [ 25 | "--localstatedir=/var" 26 | "--disable-chroot" 27 | "--disable-dnsrps" 28 | "--disable-doh" 29 | "--disable-fips-mode" 30 | "--disable-full-report" 31 | "--disable-linux-caps" 32 | "--disable-static" 33 | "--disable-tcp-fastopen" 34 | "--with-libidn2" 35 | "--without-gssapi" 36 | "--without-json-c" 37 | "--without-lmdb" 38 | "--without-libnghttp2" 39 | "--without-readline" 40 | "--without-zlib" 41 | ]; 42 | 43 | makeFlags = [ "-C lib" ]; 44 | 45 | postInstall = '' 46 | make -C bin/dig install 47 | # Headers not needed 48 | rm -r $out/include/ 49 | ''; 50 | 51 | meta = { 52 | homepage = "https://www.isc.org/bind/"; 53 | description = "dig & other utils from BIND"; 54 | platforms = lib.platforms.unix; 55 | license = lib.licenses.mpl20; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /nvi-patched/nvi-07-flush_cache.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 07flush_cache.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/common/db1.c nvi-1.81.6/common/db1.c 8 | --- nvi-1.81.6.orig/common/db1.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/common/db1.c 2008-05-01 18:07:58.000000000 +0200 10 | @@ -262,8 +262,7 @@ 11 | } 12 | 13 | /* Flush the cache, update line count, before screen update. */ 14 | - if (lno <= ep->c_lno) 15 | - ep->c_lno = OOBLNO; 16 | + ep->c_lno = OOBLNO; 17 | if (ep->c_nlines != OOBLNO) 18 | --ep->c_nlines; 19 | 20 | @@ -314,8 +313,7 @@ 21 | } 22 | 23 | /* Flush the cache, update line count, before screen update. */ 24 | - if (lno < ep->c_lno) 25 | - ep->c_lno = OOBLNO; 26 | + ep->c_lno = OOBLNO; 27 | if (ep->c_nlines != OOBLNO) 28 | ++ep->c_nlines; 29 | 30 | @@ -386,8 +384,7 @@ 31 | } 32 | 33 | /* Flush the cache, update line count, before screen update. */ 34 | - if (lno >= ep->c_lno) 35 | - ep->c_lno = OOBLNO; 36 | + ep->c_lno = OOBLNO; 37 | if (ep->c_nlines != OOBLNO) 38 | ++ep->c_nlines; 39 | 40 | @@ -459,8 +456,7 @@ 41 | } 42 | 43 | /* Flush the cache, before logging or screen update. */ 44 | - if (lno == ep->c_lno) 45 | - ep->c_lno = OOBLNO; 46 | + ep->c_lno = OOBLNO; 47 | 48 | /* File now dirty. */ 49 | if (F_ISSET(ep, F_FIRSTMODIFY)) 50 | -------------------------------------------------------------------------------- /nvi-patched/nvi-40-add-more-function-prototypes-to-fix-Wimplicit-functi.patch: -------------------------------------------------------------------------------- 1 | From: OGAWA Hirofumi 2 | Date: Mon, 10 Jun 2024 21:16:51 +0900 3 | Subject: Add more function prototypes to fix -Wimplicit-function-declaration 4 | 5 | Without this, 6 | 7 | $ nvi a b 8 | # ex command 9 | :next 10 | # error 11 | BDB0171 seek: 1024: (1 * 1024) + 0: Bad file descriptor 12 | 13 | Like the above, nvi fails to open the next file ("b"). 14 | 15 | Reviewed-By: Tobias Heider 16 | Bug-Debian: https://bugs.debian.org/1072923 17 | --- 18 | dist/configure | 5 ++++- 19 | 1 file changed, 4 insertions(+), 1 deletion(-) 20 | 21 | diff --git a/dist/configure b/dist/configure 22 | index d7fb54f..d78e87d 100755 23 | --- a/dist/configure 24 | +++ b/dist/configure 25 | @@ -26719,6 +26719,7 @@ _ACEOF 26 | cat confdefs.h >>conftest.$ac_ext 27 | cat >>conftest.$ac_ext <<_ACEOF 28 | /* end confdefs.h. */ 29 | +#include 30 | #include 31 | int 32 | main () 33 | @@ -27507,7 +27508,7 @@ _ACEOF 34 | cat confdefs.h >>conftest.$ac_ext 35 | cat >>conftest.$ac_ext <<_ACEOF 36 | /* end confdefs.h. */ 37 | - 38 | +#include 39 | int 40 | main () 41 | { 42 | @@ -27632,6 +27633,8 @@ _ACEOF 43 | cat confdefs.h >>conftest.$ac_ext 44 | cat >>conftest.$ac_ext <<_ACEOF 45 | /* end confdefs.h. */ 46 | +#include 47 | +#include 48 | main(){char buf[20]; exit(sprintf(buf, "XXX") != 3);} 49 | _ACEOF 50 | rm -f conftest$ac_exeext 51 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Collection of various packages and tools"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | }; 7 | 8 | # nix flake show 9 | # nix hash to-sri sha256:HASH 10 | # nix build .#PKG 11 | # nix log .#PKG 12 | outputs = { self, nixpkgs, ... }: 13 | let 14 | supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; 15 | forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 16 | 17 | mkPackages = system: 18 | let 19 | pkgs = nixpkgs.legacyPackages.${system}; 20 | build = pkg: pkgs.callPackage ./${pkg} {}; 21 | build-static = pkg: pkgs.pkgsStatic.callPackage ./${pkg} {}; 22 | in { 23 | again = build "again"; 24 | apacheds = build "apacheds"; 25 | csvview = build "csvview"; 26 | dig-only = build "dig-only"; 27 | dmarcreport = build "dmarcreport"; 28 | emltombox = build "emltombox"; 29 | go-pushover = build "go-pushover"; 30 | htmlentify = build "htmlentify"; 31 | ipinfo = build "ipinfo"; 32 | ldifview = build "ldifview"; 33 | nvi-patched = build "nvi-patched"; 34 | openbsd-ed = build-static "openbsd-ed"; 35 | printerinfo = build "printerinfo"; 36 | s-nail = build "s-nail"; 37 | sponge = build "sponge"; 38 | tempo = build "tempo"; 39 | thermal = build "thermal"; 40 | utfdumpcode = build "utfdumpcode"; 41 | vipe = build "vipe"; 42 | wakeonlan = build "wakeonlan"; 43 | wg = build-static "wg"; 44 | wifycon = build "wifycon"; 45 | yss = build "yss"; 46 | }; 47 | in { 48 | packages = forAllSystems mkPackages; 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /nvi-patched/nvi-21-exrc_writability_check.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 21exrc_writability_check.dpatch by 3 | ## 4 | ## DP: No description. 5 | 6 | @DPATCH@ 7 | diff -Naur nvi-1.81.6.orig/ex/ex_init.c nvi-1.81.6/ex/ex_init.c 8 | --- nvi-1.81.6.orig/ex/ex_init.c 2007-11-18 17:41:42.000000000 +0100 9 | +++ nvi-1.81.6/ex/ex_init.c 2008-05-01 18:24:45.000000000 +0200 10 | @@ -26,6 +26,9 @@ 11 | #include 12 | #include 13 | 14 | +#include 15 | +#include 16 | + 17 | #include "../common/common.h" 18 | #include "tag.h" 19 | #include "pathnames.h" 20 | @@ -346,6 +349,9 @@ 21 | int nf1, nf2; 22 | char *a, *b, buf[MAXPATHLEN]; 23 | 24 | + struct group *grp_p; 25 | + struct passwd *pwd_p; 26 | + 27 | /* Check for the file's existence. */ 28 | if (stat(path, sbp)) 29 | return (NOEXIST); 30 | @@ -359,10 +365,30 @@ 31 | } 32 | 33 | /* Check writeability. */ 34 | - if (sbp->st_mode & (S_IWGRP | S_IWOTH)) { 35 | + if (sbp->st_mode & S_IWOTH) { 36 | etype = WRITER; 37 | goto denied; 38 | } 39 | + if (sbp->st_mode & S_IWGRP) { 40 | + /* on system error (getgrgid or getpwnam return NULL) set etype to WRITER 41 | + * and continue execution */ 42 | + if( (grp_p = getgrgid(sbp->st_gid)) == NULL) { 43 | + etype = WRITER; 44 | + goto denied; 45 | + } 46 | + 47 | + /* lookup the group members' uids for an uid different from euid */ 48 | + while( ( *(grp_p->gr_mem) ) != NULL) { /* gr_mem is a null-terminated array */ 49 | + if( (pwd_p = getpwnam(*(grp_p->gr_mem)++)) == NULL) { 50 | + etype = WRITER; 51 | + goto denied; 52 | + } 53 | + if(pwd_p->pw_uid != euid) { 54 | + etype = WRITER; 55 | + goto denied; 56 | + } 57 | + } 58 | + } 59 | return (RCOK); 60 | 61 | denied: a = msg_print(sp, path, &nf1); 62 | -------------------------------------------------------------------------------- /nvi-patched/nvi-50-nvi-o_path.patch: -------------------------------------------------------------------------------- 1 | --- a/common/exf.c 2 | +++ b/common/exf.c 3 | @@ -542,7 +542,7 @@ file_spath(SCR *sp, FREF *frp, struct st 4 | 5 | /* 6 | * If the name is NULL or an explicit reference (i.e., the first 7 | - * component is . or ..) ignore the O_PATH option. 8 | + * component is . or ..) ignore the NVI_O_PATH option. 9 | */ 10 | name = frp->name; 11 | if (name == NULL) { 12 | @@ -561,8 +561,8 @@ file_spath(SCR *sp, FREF *frp, struct st 13 | return (0); 14 | } 15 | 16 | - /* Try the O_PATH option values. */ 17 | - for (found = 0, p = t = O_STR(sp, O_PATH);; ++p) 18 | + /* Try the NVI_O_PATH option values. */ 19 | + for (found = 0, p = t = O_STR(sp, NVI_O_PATH);; ++p) 20 | if (*p == ':' || *p == '\0') { 21 | if (t < p - 1) { 22 | savech = *p; 23 | --- a/common/options.c 24 | +++ b/common/options.c 25 | @@ -147,7 +147,7 @@ OPTLIST const optlist[] = { 26 | {L("optimize"), NULL, OPT_1BOOL, 0}, 27 | /* O_PARAGRAPHS 4BSD */ 28 | {L("paragraphs"), f_paragraph, OPT_STR, 0}, 29 | -/* O_PATH 4.4BSD */ 30 | +/* NVI_O_PATH 4.4BSD */ 31 | {L("path"), NULL, OPT_STR, 0}, 32 | /* O_PRINT 4.4BSD */ 33 | {L("print"), f_print, OPT_STR, 0}, 34 | @@ -364,7 +364,7 @@ opts_init(SCR *sp, int *oargs) 35 | OI(O_REPORT, L("report=5")); 36 | OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); 37 | (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); 38 | - OI(O_PATH, b2); 39 | + OI(NVI_O_PATH, b2); 40 | (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); 41 | OI(O_RECDIR, b2); 42 | OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); 43 | --- a/common/options_def.h 44 | +++ b/common/options_def.h 45 | @@ -40,7 +40,7 @@ 46 | #define O_OPEN 38 47 | #define O_OPTIMIZE 39 48 | #define O_PARAGRAPHS 40 49 | -#define O_PATH 41 50 | +#define NVI_O_PATH 41 51 | #define O_PRINT 42 52 | #define O_PROMPT 43 53 | #define O_READONLY 44 54 | -------------------------------------------------------------------------------- /nvi-patched/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchurl 4 | , ncurses 5 | , db 6 | }: 7 | 8 | stdenv.mkDerivation rec { 9 | pname = "nvi"; 10 | version = "1.81.6"; 11 | 12 | src = fetchurl { 13 | url = "https://deb.debian.org/debian/pool/main/n/nvi/nvi_${version}.orig.tar.gz"; 14 | hash = "sha256-i8NIiJFZo0zyaPgHILJvRZ29cjtWFhB9NnOdAH5Ml40="; 15 | }; 16 | 17 | patches = [ 18 | ./nvi-03-db4.patch 19 | ./nvi-04-confdefs.patch 20 | ./nvi-06-default_value_escapetime.patch 21 | ./nvi-07-flush_cache.patch 22 | ./nvi-08-lfs.patch 23 | ./nvi-08-safe_printf.patch 24 | ./nvi-08-tempfile_umask.patch 25 | ./nvi-09-casting.patch 26 | ./nvi-10-no_one_line_visual.patch 27 | ./nvi-11-backward_sentence_moving.patch 28 | ./nvi-12-horiz_scroll_count.patch 29 | ./nvi-13-widechar_horrors.patch 30 | ./nvi-14-private_regex_fixes.patch 31 | ./nvi-15-search_word.patch 32 | ./nvi-18-dbpagesize_binpower.patch 33 | ./nvi-19-include_term_h.patch 34 | ./nvi-20-glibc_has_grantpt.patch 35 | ./nvi-21-exrc_writability_check.patch 36 | ./nvi-23-debian_alternatives.patch 37 | ./nvi-24-fallback_to_dumb_term.patch 38 | ./nvi-26-trailing_tab_segv.patch 39 | ./nvi-27-support_C_locale.patch 40 | ./nvi-29-file_backup.patch 41 | ./nvi-30-regex-character-class.patch 42 | ./nvi-31-64bit-int-crash.patch 43 | ./nvi-39-add-function-prototypes-to-fix-implicit-function-dec.patch 44 | ./nvi-40-add-more-function-prototypes-to-fix-Wimplicit-functi.patch 45 | ./nvi-50-nvi-o_path.patch 46 | ]; 47 | 48 | buildInputs = [ ncurses db ]; 49 | 50 | preConfigure = '' 51 | cd dist 52 | ''; 53 | configureFlags = [ 54 | "--enable-widechar" 55 | "--disable-shared" 56 | "vi_cv_path_preserve=/tmp" 57 | ]; 58 | 59 | installPhase = '' 60 | install -Dm 0755 vi $out/bin/vi 61 | ''; 62 | 63 | meta = with lib; { 64 | description = "The Berkeley Vi Editor"; 65 | license = licenses.free; 66 | platforms = platforms.unix; 67 | }; 68 | } 69 | -------------------------------------------------------------------------------- /nvi-patched/nvi-13-widechar_horrors.patch: -------------------------------------------------------------------------------- 1 | #! /bin/sh /usr/share/dpatch/dpatch-run 2 | ## 13widechar_horrors.dpatch by 3 | ## 4 | ## DP: This patch tries to cope with the fact that widechar support 5 | ## DP: in nvi is at best rudimentary. 6 | ## DP: Hunk 1) 7 | ## DP: * Due to "ch = *t", this code is not wide-char aware, so 8 | ## DP: cast the value to a proper type so the KEY_ macros make 9 | ## DP: the right choice. 10 | ## DP: Hunk 2) 11 | ## DP: * Printing of the in-/decreased number back into the screen 12 | ## DP: buffer is not widechar-aware, either. Add a dirty fix. 13 | ## DP: Cf. #497349. 14 | 15 | @DPATCH@ 16 | --- nvi-1.81.6.orig/vi/vs_msg.c 2007-11-18 17:41:42.000000000 +0100 17 | +++ nvi-1.81.6/vi/vs_msg.c 2009-03-01 14:51:08.211414132 +0100 18 | @@ -472,10 +472,10 @@ 19 | */ 20 | if (ch == '\t') 21 | ch = ' '; 22 | - chlen = KEY_LEN(sp, ch); 23 | + chlen = KEY_LEN(sp, (unsigned char)ch); 24 | if (cbp + chlen >= ecbp) 25 | FLUSH; 26 | - for (kp = KEY_NAME(sp, ch); chlen--;) 27 | + for (kp = KEY_NAME(sp, (unsigned char)ch); chlen--;) 28 | *cbp++ = *kp++; 29 | } 30 | if (cbp > cbuf) 31 | --- nvi-1.81.6.orig/vi/v_increment.c 2007-11-18 17:41:42.000000000 +0100 32 | +++ nvi-1.81.6/vi/v_increment.c 2009-03-01 15:12:50.950415874 +0100 33 | @@ -57,7 +57,7 @@ 34 | long change, ltmp, lval; 35 | size_t beg, blen, end, len, nlen, wlen; 36 | int base, isempty, rval; 37 | - char *ntype, nbuf[100]; 38 | + char *ntype, nbuf[100 * sizeof(CHAR_T)]; 39 | CHAR_T *bp, *p, *t; 40 | 41 | /* Validate the operator. */ 42 | @@ -202,7 +202,7 @@ 43 | /* If we cross 0, signed numbers lose their sign. */ 44 | if (lval == 0 && ntype == fmt[SDEC]) 45 | ntype = fmt[DEC]; 46 | - nlen = snprintf(nbuf, sizeof(nbuf), ntype, lval); 47 | + nlen = snprintf(nbuf, sizeof(nbuf)/sizeof(CHAR_T), ntype, lval); 48 | } else { 49 | if ((nret = nget_uslong(sp, &ulval, t, NULL, base)) != NUM_OK) 50 | goto err; 51 | @@ -224,7 +224,15 @@ 52 | if (base == 16) 53 | wlen -= 2; 54 | 55 | - nlen = snprintf(nbuf, sizeof(nbuf), ntype, wlen, ulval); 56 | + nlen = snprintf(nbuf, sizeof(nbuf)/sizeof(CHAR_T), ntype, wlen, ulval); 57 | + } 58 | + 59 | + /* Inflate the printed char buffer to CHAR_T elements if necessary */ 60 | + if (sizeof(CHAR_T) > sizeof(char)) { 61 | + int nlen_inflate; 62 | + for (nlen_inflate = nlen; nlen_inflate >= 0; nlen_inflate--) { 63 | + ((CHAR_T *)nbuf)[nlen_inflate] = nbuf[nlen_inflate]; 64 | + } 65 | } 66 | 67 | /* Build the new line. */ 68 | -------------------------------------------------------------------------------- /nvi-patched/nvi-39-add-function-prototypes-to-fix-implicit-function-dec.patch: -------------------------------------------------------------------------------- 1 | From: Michael Hudson-Doyle 2 | Date: Thu, 11 Apr 2024 11:18:39 +0200 3 | Subject: Add function prototypes to fix implicit function declaration errors 4 | 5 | Reviewed-By: Tobias Heider 6 | Bug-Debian: https://bugs.debian.org/1066285 7 | --- 8 | cl/cl.h | 5 +++++ 9 | cl/cl_funcs.c | 6 ++++++ 10 | common/conv.h | 3 +++ 11 | common/multibyte.h | 6 ++++++ 12 | dist/configure | 1 + 13 | 5 files changed, 21 insertions(+) 14 | 15 | diff --git a/cl/cl.h b/cl/cl.h 16 | index 3d71410..4ff232d 100644 17 | --- a/cl/cl.h 18 | +++ b/cl/cl.h 19 | @@ -26,6 +26,11 @@ 20 | #endif 21 | #endif 22 | 23 | +/* 24 | + * for setupterm() 25 | + */ 26 | +#include 27 | + 28 | typedef struct _cl_private { 29 | char ibuf[256]; /* Input keys. */ 30 | 31 | diff --git a/cl/cl_funcs.c b/cl/cl_funcs.c 32 | index c5fc597..b6174ef 100644 33 | --- a/cl/cl_funcs.c 34 | +++ b/cl/cl_funcs.c 35 | @@ -31,6 +31,12 @@ static const char sccsid[] = "$Id: cl_funcs.c,v 10.72 2002/03/02 23:18:33 skimo 36 | #include "../vi/vi.h" 37 | #include "cl.h" 38 | 39 | +/* 40 | + * This is declared by ncurses.h, but only if _XOPEN_SOURCE is set and lots of 41 | + * other things break if we define that. 42 | + */ 43 | +extern int waddnwstr (WINDOW *,const wchar_t *,int); 44 | + 45 | static void cl_rdiv __P((SCR *)); 46 | 47 | static int 48 | diff --git a/common/conv.h b/common/conv.h 49 | index 76b06c1..a7675c4 100644 50 | --- a/common/conv.h 51 | +++ b/common/conv.h 52 | @@ -21,3 +21,6 @@ struct _conv { 53 | char2wchar_t input2int; 54 | wchar2char_t int2disp; 55 | }; 56 | + 57 | +extern int conv_enc (SCR *sp, int option, char *enc); 58 | +extern void conv_init (SCR *orig, SCR *sp); 59 | diff --git a/common/multibyte.h b/common/multibyte.h 60 | index 820f4ec..2484521 100644 61 | --- a/common/multibyte.h 62 | +++ b/common/multibyte.h 63 | @@ -5,6 +5,12 @@ 64 | #include 65 | #include 66 | 67 | +/* 68 | + * This is declared by wchar.h, but only if _XOPEN_SOURCE is set and lots of 69 | + * other things break if we define that. 70 | + */ 71 | +extern int wcwidth (wchar_t c); 72 | + 73 | typedef wchar_t RCHAR_T; 74 | #define RCHAR_T_MAX ((1 << 24)-1) 75 | typedef wchar_t CHAR_T; 76 | diff --git a/dist/configure b/dist/configure 77 | index b23e167..d7fb54f 100755 78 | --- a/dist/configure 79 | +++ b/dist/configure 80 | @@ -27385,6 +27385,7 @@ cat confdefs.h >>conftest.$ac_ext 81 | cat >>conftest.$ac_ext <<_ACEOF 82 | /* end confdefs.h. */ 83 | #include <$CURSHEADER> 84 | +#include 85 | int 86 | main () 87 | { 88 | --------------------------------------------------------------------------------