summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoréclairevoyant2023-05-27 15:14:05 -0400
committeréclairevoyant2023-05-27 15:14:17 -0400
commitb7fc83286c098cee7f8d66d8d16ddc1569b97c57 (patch)
treebaa769dea032ac6526132a64baaf7564d5351571
parentdc3a126cc2ba0670b1d822c578481191fc137830 (diff)
downloadaur-hed-git.tar.gz
fix url, deps, source, quoting; remove garbage files from AUR repo
-rw-r--r--.SRCINFO28
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD68
-rw-r--r--config.h38
-rw-r--r--echo.install13
-rw-r--r--libhed_config.h30
-rw-r--r--term.c283
7 files changed, 29 insertions, 435 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b33b02c1323e..95eb10cfee58 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,15 @@
pkgbase = hed-git
pkgdesc = Fast hexadecimal editor
- pkgver = 0.5.r486.g44165a6
+ pkgver = 0.5.r512.g8a4eb03
pkgrel = 1
- url = http://repo.or.cz/w/hed.git
- install = echo.install
+ url = https://repo.or.cz/w/hed.git
arch = i686
arch = x86_64
- license = GPL
+ license = GPL2
makedepends = git
- source = hed-git::git://repo.or.cz/hed.git
- source = config.h
- source = libhed_config.h
- source = term.c
- md5sums = SKIP
- md5sums = 4ffceab7d450a05725620726d2221764
- md5sums = 6d028b0e51a8db5e4559336e65819729
- md5sums = 9b9a96aaf02d2105017fd6346e293ff8
- sha1sums = SKIP
- sha1sums = e5a1eea38f3bc86fa97d76cf0d844d5a22cef0cb
- sha1sums = b56277f1e2234933738c7ff753bdb01e13b879ab
- sha1sums = 961239d4f14a932fd00bc0f923d5ce2daf396ec6
- sha256sums = SKIP
- sha256sums = bc228fce426d79a69d5a6e7ae937e0e9d0d934afaf4ea712bf6a19d00a5deac4
- sha256sums = 59125dbeb12e94a2c527eb77c2eebaca684c80c4d9e1ffae8f90aff7b4622386
- sha256sums = 8e1d29f12e8582c55c43e28c85b585e4076a88f78aab37d8f6713b9d64e1206b
+ depends = glibc
+ depends = ncurses
+ source = git://repo.or.cz/hed.git
+ b2sums = SKIP
pkgname = hed-git
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..713f6f80aff8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/*
+!/.gitignore
+!/.SRCINFO
+!/PKGBUILD
diff --git a/PKGBUILD b/PKGBUILD
index 4bf42a07ff8e..ecb192cb629c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,63 +1,31 @@
-# Maintainer: aksr <aksr at t-com dot me>
-pkgname=hed-git
-pkgver=0.5.r486.g44165a6
+# Maintainer: éclairevoyant
+# Contributor: aksr <aksr at t-com dot me>
+
+_pkgname=hed
+pkgname="$_pkgname-git"
+pkgver=0.5.r512.g8a4eb03
pkgrel=1
epoch=
pkgdesc="Fast hexadecimal editor"
arch=('i686' 'x86_64')
-url="http://repo.or.cz/w/hed.git"
-license=('GPL')
-groups=()
-depends=('')
-makedepends=('git')
-optdepends=()
-checkdepends=()
-provides=()
-conflicts=()
-replaces=()
-backup=()
-options=()
-changelog=
-install=echo.install
-source=("$pkgname::git://repo.or.cz/hed.git"
- 'config.h'
- 'libhed_config.h'
- 'term.c')
-noextract=()
-md5sums=('SKIP'
- '4ffceab7d450a05725620726d2221764'
- '6d028b0e51a8db5e4559336e65819729'
- '9b9a96aaf02d2105017fd6346e293ff8')
-sha1sums=('SKIP'
- 'e5a1eea38f3bc86fa97d76cf0d844d5a22cef0cb'
- 'b56277f1e2234933738c7ff753bdb01e13b879ab'
- '961239d4f14a932fd00bc0f923d5ce2daf396ec6')
-sha256sums=('SKIP'
- 'bc228fce426d79a69d5a6e7ae937e0e9d0d934afaf4ea712bf6a19d00a5deac4'
- '59125dbeb12e94a2c527eb77c2eebaca684c80c4d9e1ffae8f90aff7b4622386'
- '8e1d29f12e8582c55c43e28c85b585e4076a88f78aab37d8f6713b9d64e1206b')
+url="https://repo.or.cz/w/$_pkgname.git"
+license=(GPL2)
+depends=(glibc ncurses)
+makedepends=(git)
+source=("git://repo.or.cz/$_pkgname.git")
+b2sums=('SKIP')
pkgver() {
- cd "$srcdir/$pkgname"
- git describe --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/hed.//'
-}
-
-prepare() {
- cd "$srcdir/$pkgname"
- cp ../config.h config.h
- cp ../term.c src/term/term.c
- cp ../libhed_config.h libhed/config.h
+ git -C $_pkgname describe --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/hed.//'
}
build() {
- cd "$srcdir/$pkgname"
- make
+ make -C $_pkgname
}
package() {
- cd "$srcdir/$pkgname"
- make DESTDIR="$pkgdir/" PREFIX="/usr" install
- install -Dm644 doc/README.dev $pkgdir/usr/share/doc/$pkgname/README
- install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
+ cd $_pkgname
+ make DESTDIR="$pkgdir" PREFIX="/usr" install
+ install -Dm644 doc/README.dev "$pkgdir/usr/share/doc/$pkgname/README"
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
-
diff --git a/config.h b/config.h
deleted file mode 100644
index 5cb8ae533088..000000000000
--- a/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* The configuration header file */
-/* $Id$ */
-
-#ifndef HED__CONFIG_H
-#define HED__CONFIG_H
-
-/*
- * 'Mercy!' cried Gandalf. 'If the giving of information is to be the cure of
- * your inquisitiveness, I shall spend all the rest of my days in answering
- * you. What more do you want to know?'
- *
- * 'The names of all the stars, and of all living things, and the whole history
- * of Middle-earth and Over-heaven and of the Sundering Seas,' laughed Pippin.
- */
-
-#include <libhed/config.h>
-
-/* Comment this out to remove color configuration */
-#define CONFIG_CUSTOM_COLORS 1
-
-/* Below, several macros are defined. Modify them according to your system. */
-
-/* Comment out if your system does not have getopt_long(). */
-#define HAVE_GETOPT_LONG
-
-/* Comment out if your system does not have memrchr(). */
-#define HAVE_MEMRCHR
-
-/* The biggest integer type available on the system. */
-#define BINT_TYPE long long
-
-#ifdef HED_CONFIG_LFS
-# define _FILE_OFFSET_BITS 64
-#else
-# define _FILE_OFFSET_BITS 32
-#endif
-
-#endif
diff --git a/echo.install b/echo.install
deleted file mode 100644
index 249b4f4d7a0a..000000000000
--- a/echo.install
+++ /dev/null
@@ -1,13 +0,0 @@
-post_install() {
- echo ">>> Compile-time configuration"
- echo " You may want to tune the compile-time configuration:"
- echo " * config.h: system-specific configuration"
- echo " * libhed/config.h: low-level tweaks if you want to enable experimantal"
- echo " features, or disable standard features to reduce code size."
- echo " * src/term/term.c: default colors (see the definition of colordefs[])."
-}
-
-post_upgrade() {
- post_install
-}
-
diff --git a/libhed_config.h b/libhed_config.h
deleted file mode 100644
index 3885d1edb353..000000000000
--- a/libhed_config.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* libhed configuration header file */
-
-/* This is a libhed PUBLIC file.
- * This header file will be installed on the target system.
- * When you add new things here, make sure they start with hed_.
- */
-
-#ifndef LIBHED__CONFIG_H
-#define LIBHED__CONFIG_H
-
-/* Define which features should be enabled in the library.
- * Comment/uncomment the defines as needed.
- */
-
-/* Comment this out to compile without LFS (Large File Support) */
-#define HED_CONFIG_LFS 1
-
-/* Uncomment this if you want the EXPERIMENTAL mmap file backend */
-/* #define HED_CONFIG_MMAP 1 */
-
-/* Comment this out if you don't want to include readahead support */
-#define HED_CONFIG_READAHEAD 1
-
-/* Comment this out to remove swap file support */
-#define HED_CONFIG_SWAP 1
-
-/* Comment this out to use traditional read/write for swap files */
-#define HED_CONFIG_SWAP_MMAP 1
-
-#endif /* LIBHED__CONFIG_H */
diff --git a/term.c b/term.c
deleted file mode 100644
index 8a23eac55ab2..000000000000
--- a/term.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* $Id$ */
-
-/*
- * hed - Hexadecimal editor
- * Copyright (C) 2004 Petr Baudis <pasky@ucw.cz>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * `There's only stars, as I thought,' he said. Then he gave a low gasp, for
- * the stars went out. As if a dark veil had been withdrawn, the Mirror grew
- * grey, and then clear. There was sun shining, and the branches of trees were
- * waving and tossing in the wind.
- */
-
-/* Feature macros needed for:
- * - stpcpy
- * - vasprintf
- */
-#define _GNU_SOURCE
-
-#include <config.h>
-
-#include <curses.h>
-#include <stdlib.h>
-
-#include <hed.h>
-
-#include <term/term.h>
-
-
-static WINDOW *scr;
-int color2attr[64];
-
-#define DEFCOLOR(PN, FG, BG, ATTRS) \
- [ ( COLOR_ ## PN ) - 1 ] = { \
- .fg = ( COLOR_ ## FG ), \
- .bg = ( COLOR_ ## BG ), \
- .attrs = COLOR_PAIR( COLOR_ ## PN ) | (ATTRS ) }
-
-static struct {
- short fg, bg;
- int attrs;
-} colordefs[] = {
- // pair number fg bg attrs
- DEFCOLOR(NEUTRAL, WHITE, BLACK, 0),
- DEFCOLOR(OFFSET, YELLOW, BLACK, A_BOLD),
- DEFCOLOR(STATUS, WHITE, BLACK, 0),
- DEFCOLOR(MODE, WHITE, BLACK, A_BOLD),
- DEFCOLOR(MARK, YELLOW, BLACK, A_BOLD),
- DEFCOLOR(ERROR, RED, BLACK, A_BOLD),
- DEFCOLOR(DIRTY, RED, BLACK, A_BOLD),
-
- DEFCOLOR(HEX, WHITE, BLACK, 0),
- DEFCOLOR(UNHEX, WHITE, BLUE, 0),
- DEFCOLOR(ASC, GREEN, BLACK, A_BOLD),
- DEFCOLOR(UNASC, GREEN, BLUE, A_BOLD),
- DEFCOLOR(CURHEX, WHITE, BLACK, A_BOLD),
- DEFCOLOR(CURUNHEX, WHITE, BLUE, A_BOLD),
- DEFCOLOR(CURASC, YELLOW, BLACK, A_BOLD),
- DEFCOLOR(CURUNASC, YELLOW, BLUE, A_BOLD),
-};
-
-#undef DEFCOLOR
-
-#ifdef CONFIG_CUSTOM_COLORS
-
-#include <string.h>
-#include <ctype.h>
-#include <config/config.h>
-
-struct valdesc {
- const char *const name;
- const size_t len;
- const int val;
-};
-
-static int
-parseval(char **pstr, const struct valdesc *vals, int nvals, bool mult)
-{
- char *p, *q;
- size_t len;
- int i, ret = 0;
-
- while (**pstr) {
- for (p = *pstr; isspace(*p); ++p);
- for (q = p; *q && !isspace(*q); ++q);
- len = q - p;
- *pstr = q;
-
- for (i = 0; i < nvals; ++i) {
- if (vals[i].len != len)
- continue;
- if (strncasecmp(p, vals[i].name, len))
- continue;
- ret |= vals[i].val;
- }
- if (!mult)
- break;
- }
- return ret;
-}
-
-static inline int
-parsecolor(char **pstr)
-{
-#define COLDESC(COL) { \
- .name = #COL, \
- .len = (sizeof(#COL)) - 1, \
- .val = COLOR_ ## COL }
- static const struct valdesc colors[] = {
- COLDESC(BLACK),
- COLDESC(RED),
- COLDESC(GREEN),
- COLDESC(YELLOW),
- COLDESC(BLUE),
- COLDESC(MAGENTA),
- COLDESC(CYAN),
- COLDESC(WHITE),
- };
-#undef COLDESC
-
- return parseval(pstr,
- colors, sizeof(colors) / sizeof(colors[0]),
- false);
-}
-
-static inline int
-parseattrs(char **pstr)
-{
-#define ATTRDESC(ATTR) { \
- .name = #ATTR, \
- .len = (sizeof(#ATTR)) - 1, \
- .val = A_ ## ATTR }
- static const struct valdesc attrs[] = {
- ATTRDESC(NORMAL),
- ATTRDESC(STANDOUT),
- ATTRDESC(UNDERLINE),
- ATTRDESC(REVERSE),
- ATTRDESC(BLINK),
- ATTRDESC(DIM),
- ATTRDESC(BOLD),
- ATTRDESC(PROTECT),
- ATTRDESC(INVIS),
- ATTRDESC(ALTCHARSET),
- };
-#undef ATTRDESC
-
- return parseval(pstr,
- attrs, sizeof(attrs) / sizeof(attrs[0]),
- true);
-}
-
-static void
-config_colors(void)
-{
- static const char * const names[] = {
- "neutral", "offset", "status", "mode",
- "mark", "error", "dirty",
- "hex", "unhex", "asc", "unasc",
- "curhex", "curunhex", "curasc", "curunasc" };
- int i;
-
- for (i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
- char *spec, name[16];
-
- strcpy(stpcpy(name, "color_"), names[i]);
- if (! (spec = get_opt_str(name, NULL)) )
- continue;
-
- colordefs[i].fg = parsecolor(&spec);
- colordefs[i].bg = parsecolor(&spec);
- colordefs[i].attrs = parseattrs(&spec) | COLOR_PAIR(i + 1);
- }
-}
-
-#else
-
-#define config_colors() do { } while(0)
-
-#endif /* CONFIG_CUSTOM_COLORS */
-
-/* Initialize the terminal. */
-void
-term_init(void)
-{
- int i;
-
- scr = initscr();
- cbreak(); noecho(); nonl();
- intrflush(scr, FALSE);
- keypad(scr, TRUE);
-
- config_colors();
- start_color();
- for (i = 0; i < sizeof(colordefs) / sizeof(colordefs[0]); ++i) {
- init_pair(i + 1, colordefs[i].fg, colordefs[i].bg);
- color2attr[i+1] = colordefs[i].attrs;
- }
-
- refresh();
-}
-
-/* Deinitialize the terminal. */
-void
-term_done(void)
-{
- endwin();
-}
-
-/* Redraw the terminal. */
-void term_redraw(void)
-{
- refresh();
-}
-
-
-/* Move the cursor around to the given position. */
-void
-term_goto_cursor(int x, int y)
-{
- move(y, x);
-}
-
-/* Get window dimensions. */
-int
-term_get_max_x(void)
-{
- int x, y;
- getmaxyx(stdscr, y, x);
- return x;
-}
-
-int
-term_get_max_y(void)
-{
- int x, y;
- getmaxyx(stdscr, y, x);
- return y;
-}
-
-/* Clear the given line. Can move cursor around. */
-void
-term_clear_line(int y)
-{
- move(y, 0);
- clrtoeol();
-}
-
-/* Print formatted output to the terminal. */
-int
-term_printf(int x, int y, term_color color, const char *fmt, ...)
-{
- va_list va;
- char *str;
- int len;
-
- va_start(va, fmt);
- len = vasprintf(&str, fmt, va);
- va_end(va);
- term_print_string(x, y, color, str);
- free(str);
- return len;
-}
-
-/* Get a character from the terminal. */
-int
-term_get_char(void)
-{
- return getch();
-}