From 23b3b9aead9f8bd5064521621693bfcd6b378d2c Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 21 Jan 2026 20:10:02 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 9 ++++++ pkg.info | 17 ++++++++++ source-files/increase-tube.patch | 13 ++++++++ source-files/navkeys.patch | 53 ++++++++++++++++++++++++++++++++ source.sh | 26 ++++++++++++++++ 6 files changed, 120 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source-files/increase-tube.patch create mode 100644 source-files/navkeys.patch create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..ad74519 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Sourceforge project +REPO="ex-vi" + +# Get version using best_release.json +VERSION=$(curl -s -L https://sourceforge.net/projects/"$REPO"/best_release.json | jq '.platform_releases.linux.filename' | cut -d'/' -f3) + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..80404c2 --- /dev/null +++ b/pkg.info @@ -0,0 +1,17 @@ +name: vi +description: The traditional vi text editor +version: "050325" +revision: 1 +url: https://ex-vi.sourceforge.net/ +license: BSD-4-Clause-UC +architecture: any +type: source +depends: + - ncurses +make_depends: + - bzip2 +downloads: + - url: https://downloads.sourceforge.net/project/ex-vi/ex-vi/${BPM_PKG_VERSION}/ex-${BPM_PKG_VERSION}.tar.bz2 + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: da4be7cf67e94572463b19e56850aa36dc4e39eb0d933d3688fe8574bb632409 diff --git a/source-files/increase-tube.patch b/source-files/increase-tube.patch new file mode 100644 index 0000000..7642c14 --- /dev/null +++ b/source-files/increase-tube.patch @@ -0,0 +1,13 @@ +--- a/config.h 2005-02-19 05:25:39.000000000 -0500 ++++ b/config.h.fixed 2010-01-04 22:02:01.000000000 -0500 +@@ -95,8 +95,8 @@ + #define TUBESIZE 6000 /* Maximum screen size for visual */ + #else /* VMUNIX */ + #define TUBELINES 100 +-#define TUBECOLS 160 +-#define TUBESIZE 16000 ++#define TUBECOLS 320 ++#define TUBESIZE 32000 + #endif /* VMUNIX */ + + /* diff --git a/source-files/navkeys.patch b/source-files/navkeys.patch new file mode 100644 index 0000000..439cc0f --- /dev/null +++ b/source-files/navkeys.patch @@ -0,0 +1,53 @@ +--- a/ex_tty.c 2005-03-04 13:42:58.000000000 +0100 ++++ b/ex_tty.c 2009-06-25 20:06:57.000000000 +0200 +@@ -132,7 +132,8 @@ + &ED, &EI, &F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9, + &HO, &IC, &IM, &IP, &KD, &KE, &KH, &KL, &KR, &KS, &KU, &LL, &ND, &xNL, + &xPC, &RC, &SC, &SE, &SF, &SO, &SR, &TA, &TE, &TI, &UP, &VB, &VS, &VE, +- &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM ++ &AL_PARM, &DL_PARM, &UP_PARM, &DOWN_PARM, &LEFT_PARM, &RIGHT_PARM, ++ &kI, &kD, &kh, &at7, &kP, &kN + }; + bool *sflags[] = { + &AM, &BS, &DA, &DB, &EO, &HC, +@@ -170,7 +171,12 @@ + addmac1(KD, "j", "down", arrows, 1); + addmac1(KL, "h", "left", arrows, 1); + addmac1(KR, "l", "right", arrows, 1); +- addmac1(KH, "H", "home", arrows, 1); ++ addmac1(kI, "i", "insert", arrows, 1); ++ addmac1(kD, "x", "delete", arrows, 1); ++ addmac1(kh, "^", "home", arrows, 1); ++ addmac1(at7, "$", "end", arrows, 1); ++ addmac1(kP, "", "pgup", arrows, 1); ++ addmac1(kN, "", "pgdn", arrows, 1); + + /* + * Handle funny termcap capabilities +@@ -341,7 +347,7 @@ + *(*fp++) = flag; + namp += 2; + } while (*namp); +- namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERI"; ++ namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERIkIkDkh@7kPkN"; + sp = sstrs; + do { + string = tgetstr(namp, &aoftspace); +--- a/ex_tty.h 2004-12-01 19:21:06.000000000 +0100 ++++ b/ex_tty.h 2009-06-25 20:06:05.000000000 +0200 +@@ -183,6 +183,15 @@ + var bool XX; /* Tektronix 4025 insert line */ + /* X? is reserved for severely nauseous glitches */ + /* If there are enough of these we may need bit masks! */ ++/* ++ * Insert, Delete, Home, End, PgUp an PgDown keys ++ */ ++var char *kI; ++var char *kD; ++var char *kh; ++var char *at7; ++var char *kP; ++var char *kN; + + /* + * From the tty modes... diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..e076562 --- /dev/null +++ b/source.sh @@ -0,0 +1,26 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/increase-tube.patch + patch -Np1 -i "$BPM_WORKDIR"/navkeys.patch +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + make PREFIX=/usr PRESERVEDIR=/var/lib/ex TERMLIB=ncurses LARGEF=-DLARGEF CFLAGS="${CLFAGS} -I. -std=gnu90" +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" PREFIX=/usr PRESERVEDIR=/var/lib/ex INSTALL=/usr/bin/install install + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/vi/LICENSE +}