From bf40a2f7a3b1293912c5bca9cfb3f461a435a046 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 12:53:47 +0700 Subject: [PATCH 1/8] updated shell extensions --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 0491a7c..986300e 100644 --- a/tte.c +++ b/tte.c @@ -175,7 +175,7 @@ typedef enum ActionType ActionType; char* C_HL_extensions[] = {".c", ".h", ".cpp", ".hpp", ".cc", NULL}; // Array must be terminated with NULL. char* JAVA_HL_extensions[] = {".java", NULL}; char* PYTHON_HL_extensions[] = {".py",".pyw",".py3",".pyc",".pyo", NULL}; -char* BASH_HL_extensions[] = {".sh", NULL}; +char* BASH_HL_extensions[] = {".sh", ".bash", ".zsh", NULL}; char* JS_HL_extensions[] = {".js", ".jsx", NULL}; char* PHP_HL_extensions[] = {".php",".phtml", NULL}; char* JSON_HL_extensions[] = {".json", ".jsonp", NULL}; From da9ce1d0d1d0975ad921f59492c1e66706d344a9 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 13:09:15 +0700 Subject: [PATCH 2/8] updated Makefile and .gitignore and added CMakeLists.txt and meson.build --- .gitignore | 1 + CMakeLists.txt | 10 ++++++++++ Makefile | 7 +++++-- meson.build | 5 +++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 meson.build diff --git a/.gitignore b/.gitignore index f8a3e1a..a190993 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ tte +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..59e9aa1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required (VERSION 2.6) +project(tte) +set(CMAKE_C_FLAGS "-std=c99") + +add_executable( + tte + tte.c +) + +install(TARGETS tte DESTINATION /usr/bin) \ No newline at end of file diff --git a/Makefile b/Makefile index b15dcfb..eb47d81 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,8 @@ debug: tte.c $(CC) tte.c -o tte -Wall -Wextra -pedantic -std=c99 -g install: tte - sudo cp tte /usr/local/bin/ - sudo chmod +x /usr/local/bin/ + sudo cp tte /usr/bin/ + sudo chmod +x /usr/bin/ + +uninstall: + sudo rm -v /usr/bin/tte diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..8e667c9 --- /dev/null +++ b/meson.build @@ -0,0 +1,5 @@ +project('tte', 'c', default_options : ['c_std=c99']) +executable( + 'tte', + 'tte.c' +) From 32afccd66c1ea62caca69136238d4598dd215cde Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 13:11:41 +0700 Subject: [PATCH 3/8] added actions --- .gitea/workflows/actions.yaml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitea/workflows/actions.yaml diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml new file mode 100644 index 0000000..a0e4a98 --- /dev/null +++ b/.gitea/workflows/actions.yaml @@ -0,0 +1,52 @@ +name: Prepare Build and Testing executable binary +run-name: ${{ gitea.actor }} +on: [push] + +jobs: + Prepare-Build-Testing-With-Make: + runs-on: alpine-sdk + steps: + - name: prepare-container + run: | + echo "83.172.39.220 gitea.home.com" >> /etc/hosts + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with make + run: | + make -j$(nproc) + - name: Testing to run binary builded with make + run: ./tte --version + + Prepare-Build-Testing-With-CMake: + runs-on: alpine-sdk + steps: + - name: prepare-container + run: | + echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ + apk add cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with CMake + run: | + mkdir build && \ + cd build && \ + cmake .. && \ + make -j$(nproc) + - name: Testing to run binary builded with CMake + run: ./build/tte --version + + Prepare-Build-Testing-With-Meson: + runs-on: alpine-sdk + steps: + - name: prepare-container + run: | + echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ + apk add meson ninja cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with meson + run: | + meson setup build && \ + ninja -C build + - name: Testing to run binary builded with meson + run: ./build/tte --version \ No newline at end of file From c3ddcf4c5d65234dff367666c8d6e41fdb69d8b8 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 13:13:14 +0700 Subject: [PATCH 4/8] added actions --- .gitea/workflows/actions.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index a0e4a98..e268f83 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -15,7 +15,7 @@ jobs: run: | make -j$(nproc) - name: Testing to run binary builded with make - run: ./tte --version + run: ./tte --help Prepare-Build-Testing-With-CMake: runs-on: alpine-sdk @@ -33,7 +33,7 @@ jobs: cmake .. && \ make -j$(nproc) - name: Testing to run binary builded with CMake - run: ./build/tte --version + run: ./build/tte --help Prepare-Build-Testing-With-Meson: runs-on: alpine-sdk @@ -49,4 +49,4 @@ jobs: meson setup build && \ ninja -C build - name: Testing to run binary builded with meson - run: ./build/tte --version \ No newline at end of file + run: ./build/tte --help \ No newline at end of file From d37be2282dfb830dfc44fca6faeb16c50235fdda Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 13:17:03 +0700 Subject: [PATCH 5/8] updated tte.c --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 986300e..e69716e 100644 --- a/tte.c +++ b/tte.c @@ -2082,7 +2082,6 @@ void initEditor() { ec.syntax = NULL; ec.actions = actionListInit(); - editorUpdateWindowSize(); // The SIGWINCH signal is sent to a process when its controlling // terminal changes its size (a window change). signal(SIGWINCH, editorHandleSigwinch); @@ -2155,6 +2154,7 @@ int main(int argc, char* argv[]) { editorOpen(argv[argc - 1]); else if (arg_response == -1) return 0; + editorUpdateWindowSize(); enableRawMode(); editorSetStatusMessage(" Ctrl-Q to quit | Ctrl-S to save | (tte -h | --help for more info)"); From 832535f52e91b12485f1ea3c162aba5e64892fa2 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 13:18:00 +0700 Subject: [PATCH 6/8] updated actions --- .gitea/workflows/actions.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index e268f83..a0e4a98 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -15,7 +15,7 @@ jobs: run: | make -j$(nproc) - name: Testing to run binary builded with make - run: ./tte --help + run: ./tte --version Prepare-Build-Testing-With-CMake: runs-on: alpine-sdk @@ -33,7 +33,7 @@ jobs: cmake .. && \ make -j$(nproc) - name: Testing to run binary builded with CMake - run: ./build/tte --help + run: ./build/tte --version Prepare-Build-Testing-With-Meson: runs-on: alpine-sdk @@ -49,4 +49,4 @@ jobs: meson setup build && \ ninja -C build - name: Testing to run binary builded with meson - run: ./build/tte --help \ No newline at end of file + run: ./build/tte --version \ No newline at end of file From f001c5aa18145f7cd54724e6315f1d150b68bfe5 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 14:27:18 +0700 Subject: [PATCH 7/8] added PKGBUILD --- .gitea/workflows/actions.yaml | 22 +++++++++++++++++++++- Makefile | 5 +++-- PKGBUILD | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 PKGBUILD diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index a0e4a98..ba72228 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -49,4 +49,24 @@ jobs: meson setup build && \ ninja -C build - name: Testing to run binary builded with meson - run: ./build/tte --version \ No newline at end of file + run: ./build/tte --version + + Archlinux-package: + runs-on: archlinux-aarch64 + steps: + - name: Download PKGBUILD file + run: | + mkdir workspace && \ + cd workspace && \ + curl \ + https://gitea.home.com:3000/TolaMironcenko/tte/raw/branch/main/PKGBUILD \ + -o PKGBUILD && \ + sed "s/arch=('x86_64')/arch=('aarch64')/" -i PKGBUILD + - name: Build package + run: cd workspace && makepkg -f + - name: Push package + run: | + cd workspace && \ + curl --user TolaMironcenko:d57cf51c49b425b42148e5a56882f8330bde011c \ + --upload-file ./tte-git-1.0-1-aarch64.pkg.tar.xz \ + https://gitea.home.com:3000/api/packages/TolaMironcenko/arch/home \ No newline at end of file diff --git a/Makefile b/Makefile index eb47d81..fff26bd 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +DESTDIR=/ + tte: tte.c $(CC) tte.c -o tte -std=c99 @@ -5,8 +7,7 @@ debug: tte.c $(CC) tte.c -o tte -Wall -Wextra -pedantic -std=c99 -g install: tte - sudo cp tte /usr/bin/ - sudo chmod +x /usr/bin/ + sudo cp tte $(DESTDIR)/usr/bin/ uninstall: sudo rm -v /usr/bin/tte diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..48948d2 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,24 @@ +# Maintainer: Tola Mironcenko +pkgname=tte-git +_pkgname="${pkgname%-git}" +_reponame=tte +pkgver=0.1.1 +pkgrel=1 +pkgdesc="Password generator" +arch=('x86_64') +url="https://gitea.home.com:3000/TolaMironcenko/tte" +conflicts=("$_pkgname") +license=('GPL') +source=("git+$url.git") +cksums=('SKIP') + +build() { + cd $_reponame + make +} + +package() { + cd $_reponame + mkdir -p $pkgdir/usr/bin + make DESTDIR="$pkgdir" install +} From 5a74a61d525a4a15310c3e2f5a39f76ce7bb6fc5 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 9 Jan 2025 14:28:28 +0700 Subject: [PATCH 8/8] added PKGBUILD --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index 48948d2..0e8fa4a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,7 +4,7 @@ _pkgname="${pkgname%-git}" _reponame=tte pkgver=0.1.1 pkgrel=1 -pkgdesc="Password generator" +pkgdesc="Tiny Text Editor" arch=('x86_64') url="https://gitea.home.com:3000/TolaMironcenko/tte" conflicts=("$_pkgname")