Skip to content

Commit eb9351d

Browse files
authored
Merge pull request #178 from roberthawdon/v1.0.0-b.1
First RC Release of V1.0.0
2 parents 2a5515a + fa729e4 commit eb9351d

38 files changed

+4460
-1565
lines changed

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Create Release with Tarball
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Standard releases: v1.0.0, v2.1.3
7+
- 'v*.*.*-alpha*' # Alpha releases: v1.0.0-alpha, v1.0.0-alpha1
8+
- 'v*.*.*-beta*' # Beta releases: v1.0.0-beta, v1.0.0-beta2
9+
- 'v*.*.*-rc*' # Release candidates: v1.0.0-rc1, v1.0.0-rc10
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Fetch full history for git describe
20+
21+
- name: Install development dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y \
25+
autotools-dev \
26+
autoconf \
27+
automake \
28+
libtool \
29+
build-essential \
30+
pkg-config \
31+
ncurses-dev \
32+
libncursesw5-dev \
33+
libconfig-dev \
34+
libacl1-dev \
35+
gettext \
36+
gettext-base \
37+
autopoint
38+
39+
- name: Create tarball version file
40+
run: |
41+
# Create version file for tarball distributions
42+
git describe --tags --dirty --always > .tarball-version
43+
44+
- name: Run bootstrap script
45+
run: ./bootstrap
46+
47+
- name: Configure the build
48+
run: ./configure
49+
50+
- name: Create distribution tarball
51+
run: make dist
52+
53+
- name: Find generated tarball
54+
id: find-tarball
55+
run: |
56+
TARBALL=$(ls *.tar.gz | head -n1)
57+
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
58+
echo "Found tarball: $TARBALL"
59+
60+
- name: Determine if pre-release
61+
id: prerelease
62+
run: |
63+
if [[ "${{ github.ref_name }}" =~ -alpha|-beta|-rc ]]; then
64+
echo "prerelease=true" >> $GITHUB_OUTPUT
65+
echo "This is a pre-release version"
66+
else
67+
echo "prerelease=false" >> $GITHUB_OUTPUT
68+
echo "This is a stable release"
69+
fi
70+
71+
- name: Create GitHub Release
72+
uses: softprops/action-gh-release@v2
73+
if: github.ref_type == 'tag'
74+
with:
75+
files: ${{ steps.find-tarball.outputs.tarball }}
76+
prerelease: ${{ steps.prerelease.outputs.prerelease }}
77+
generate_release_notes: true
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ po/*.gmo
4040
valgrind*
4141
*.#*
4242
ABOUT-NLS
43+
*.tar.gz

Makefile.am

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ dfshowdatadir = $(datadir)/dfshow
88
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
99
AM_CFLAGS = -DSYSCONFIG=\"$(dfshowconfdir)\" -DDATADIR=\"$(dfshowdatadir)\" -D_XOPEN_SOURCE_EXTENDED -fno-common
1010

11+
EXTRA_CFLAGS = -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=odr -Werror=strict-aliasing
12+
1113
LDADD = -lm -lconfig $(LIBINTL)
1214

1315
ACLOCAL_AMFLAGS = -I m4
@@ -33,17 +35,20 @@ endif
3335
bin_PROGRAMS = bin/show bin/sf
3436
bin_show_SOURCES = src/show.c src/showfunctions.c src/sffunctions.c src/showmenus.c src/sfmenus.c src/colors.c src/common.c src/menu.c src/input.c src/display.c src/settings.c src/i18n.c
3537
bin_show_LDADD = $(LDADD)
36-
bin_show_CFLAGS = $(AM_CFLAGS) -DAPPLICATION_SHOW -DAPPLICATION_SF
38+
bin_show_CFLAGS = $(NCURSES_CFLAGS) $(EXTRA_CFLAGS) $(AM_CFLAGS) -DAPPLICATION_SHOW -DAPPLICATION_SF
39+
bin_show_LDFLAGS = $(NCURSES_LIBS) $(AM_LDFLAGS)
3740
bin_sf_SOURCES = src/sf.c src/sffunctions.c src/sfmenus.c src/colors.c src/common.c src/menu.c src/input.c src/display.c src/settings.c src/i18n.c
41+
bin_sf_LDFLAGS = $(NCURSES_LIBS) $(AM_LDFLAGS)
3842
bin_sf_LDADD = $(LDADD)
39-
bin_sf_CFLAGS = $(AM_CFLAGS) -DAPPLICATION_SF
43+
bin_sf_CFLAGS = $(NCURSES_CFLAGS) $(EXTRA_CFLAGS) $(AM_CFLAGS) -DAPPLICATION_SF
4044
dfshowconf_DATA = conf/dfshow.conf
4145
dfshowdata_DATA = themes/*
46+
dist_data_DATA = conf/dfshow.conf themes/*
4247

4348
man_MANS = man/show.1 man/sf.1
44-
noinst_HEADERS = src/show.h src/sf.h src/showfunctions.h src/showmenus.h src/sfmenus.h src/colors.h src/common.h src/banned.h src/display.h src/input.h src/menu.h src/settings.h src/i18n.h src/gettext.h
49+
noinst_HEADERS = src/banned.h src/colors.h src/common.h src/customtypes.h src/display.h src/gettext.h src/i18n.h src/input.h src/menu.h src/settings.h src/sffunctions.h src/sf.h src/sfmenus.h src/showfunctions.h src/show.h src/showmenus.h
4550

46-
EXTRA_DIST = doc
51+
EXTRA_DIST = LICENSE man
4752

4853
check-gettext:
4954
@if test x$(USE_NLS) != "xyes" ; then echo "Missing gettext. Rerun configure and check for" \

bootstrap

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env sh
22

3-
autoreconf --install
4-
automake --add-missing
3+
if [ -d /usr/share/gettext/m4 ]; then
4+
aclocal -I /usr/share/gettext/m4
5+
else
6+
aclocal
7+
fi
8+
9+
autoconf --force # Force regeneration even if configure exists
10+
automake --add-missing --copy

conf/dfshow.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ common:
66
theme = "default";
77
# Enable SIGINT - quit on Ctrl-C (default: 0)
88
sigint = 0;
9+
# Enable Mouse mode (default: 0)
10+
enable-mouse = 0;
911
};
1012

1113
show:

configure.ac

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
1-
AC_INIT([dfshow],[0.10.3],[https://github.com/roberthawdon/dfshow/issues])
1+
AC_INIT([dfshow],
2+
m4_esyscmd_s([
3+
if test -d .git; then
4+
git describe --tags --dirty --always 2>/dev/null || echo "1.0.0-unknown"
5+
elif test -f .tarball-version; then
6+
cat .tarball-version
7+
else
8+
echo "1.0.0-unknown"
9+
fi
10+
]),
11+
[https://github.com/roberthawdon/dfshow/issues])
212
AM_INIT_AUTOMAKE([subdir-objects])
313
AC_PROG_CC
414
AC_CONFIG_HEADERS([config.h:config.hin])
515
AC_SUBST([AM_LDFLAGS])
616

17+
# Adjust CFLAGS depending on the compiler
18+
case "$CC" in
19+
*gcc*)
20+
CFLAGS="$CFLAGS -flto=auto -Werror=lto-type-mismatch"
21+
LDFLAGS="$LDFLAGS -flto=auto"
22+
;;
23+
*clang*)
24+
CFLAGS="$CFLAGS"
25+
;;
26+
*)
27+
AC_MSG_WARN([Unknown compiler, using default CFLAGS])
28+
;;
29+
esac
30+
731
AM_GNU_GETTEXT([external])
832
AM_GNU_GETTEXT_VERSION(0.17.18)
933
AM_GNU_GETTEXT_REQUIRE_VERSION(0.17.18)
@@ -31,10 +55,10 @@ AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]])
3155
AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]])
3256
AC_CHECK_FUNCS(acl_get facl_get acl_set facl_set)
3357

58+
PKG_CHECK_MODULES([NCURSES], [ncursesw])
3459

3560
AC_CHECK_MEMBERS([struct stat.st_author])
3661
AC_CHECK_HEADERS([stdio.h limits.h signal.h ctype.h wctype.h getopt.h sys/types.h sys/stat.h dirent.h fcntl.h pwd.h string.h stdlib.h unistd.h time.h sys/statvfs.h libgen.h errno.h wchar.h hurd.h math.h sys/sysmacros.h regex.h utime.h sys/xattr.h acl/libacl.h stdint.h])
37-
AC_CHECK_HEADERS(ncurses.h, , AC_MSG_ERROR(ncurses header (ncurses.h) not found. You may need to install an ncurses development package.))
3862
AC_CHECK_HEADERS(libconfig.h, , AC_MSG_ERROR(libconfig header (libconfig.h) not found. You may need to install a libconfig development package.))
3963
AC_CHECK_HEADERS(sys/acl.h, , AC_MSG_ERROR(libacl header (sys/acl.h) not found. You may need to install a libacl development package.))
4064

docs/source/conf.py

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,74 @@
1616
# import sys
1717
# sys.path.insert(0, os.path.abspath('.'))
1818

19+
import subprocess
20+
import os
21+
import re
22+
23+
# -- Functions ---------------------------------------------------------------
24+
25+
def get_version():
26+
"""Get version from git describe or fallback file."""
27+
# Get the repository root (two levels up from docs/source/)
28+
repo_root = os.path.join(os.path.dirname(__file__), '..', '..')
29+
repo_root = os.path.abspath(repo_root)
30+
31+
try:
32+
# Try to get version from git
33+
if os.path.exists(os.path.join(repo_root, '.git')) or os.environ.get('GITHUB_ACTIONS'):
34+
result = subprocess.run(
35+
['git', 'describe', '--tags', '--dirty', '--always'],
36+
cwd=repo_root, # Run git command from repository root
37+
capture_output=True,
38+
text=True,
39+
check=True
40+
)
41+
full_version = result.stdout.strip()
42+
43+
# Remove 'v' prefix if present
44+
if full_version.startswith('v'):
45+
full_version = full_version[1:]
46+
47+
# Extract short version (X.Y) from full version
48+
version_match = re.match(r'(\d+\.\d+)', full_version)
49+
short_version = version_match.group(1) if version_match else '1.0'
50+
51+
return short_version, full_version
52+
53+
except (subprocess.CalledProcessError, FileNotFoundError):
54+
pass
55+
56+
# Fallback: try to read from tarball version file
57+
try:
58+
tarball_version_path = os.path.join(repo_root, '.tarball-version')
59+
if os.path.exists(tarball_version_path):
60+
with open(tarball_version_path, 'r') as f:
61+
full_version = f.read().strip()
62+
if full_version.startswith('v'):
63+
full_version = full_version[1:]
64+
65+
version_match = re.match(r'(\d+\.\d+)', full_version)
66+
short_version = version_match.group(1) if version_match else '1.0'
67+
68+
return short_version, full_version
69+
except (IOError, OSError):
70+
pass
71+
72+
# Final fallback
73+
return '1.0', '1.0.0-unknown'
1974

2075
# -- Project information -----------------------------------------------------
2176

2277
project = 'Directory File Show (DF-SHOW)'
23-
copyright = '2024, Robert Ian Hawdon'
78+
copyright = '2025, Robert Ian Hawdon'
2479
author = 'Robert Ian Hawdon'
2580

2681
# The short X.Y version
27-
version = '0.10'
82+
# version = '1.0'
2883
# The full version, including alpha/beta/rc tags
29-
release = '0.10.3-beta'
84+
# release = '1.0.0-b.1'
3085

86+
version, release = get_version()
3187

3288
# -- General configuration ---------------------------------------------------
3389

docs/source/sf.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,24 @@ the file window after the last line of the file.
3131
Command line arguments
3232
----------------------
3333

34-
``-w``, ``--wrap`` Enables line wrapping.
34+
``-w``, ``--wrap``
35+
Enables line wrapping.
3536

36-
``--theme``\ =[THEME]: Color themes. Passsing this argument
37+
``--theme``\ =[THEME]
38+
Color themes. Passsing this argument
3739
without an option will display available themes.
3840

3941
``--settings-menu``
40-
Launch ``sf`` directly into the settings menu.
42+
Launch ``sf`` directly into the settings menu.
4143

42-
``--help``: Displays help message, then exits.
44+
``--help``
45+
Displays help message, then exits.
4346

44-
``--version``: Displays program version, then exits.
47+
``--version``
48+
Displays program version, then exits.
49+
50+
``--enable-mouse``\ =BOOLEAN
51+
Launches ``sf`` with mouse support.
4552

4653
Commands
4754
--------
@@ -136,7 +143,12 @@ The following screen is displayed.
136143

137144
SF Settings Menu - Quit, Revert, Save
138145

139-
[ ] Enable text wrapping
146+
Global Settings
147+
[ ] Enable mouse (Requires restart)
148+
149+
Behavior Settings
150+
[ ] Enable text wrapping
151+
<-> Mouse scroll interval size: <1> <2> <3> <4> <5> <6> <7> <8> <9>
140152

141153
The menu is made up of toggle switches. When active, the switch will display
142154
``[*]``, when inactive ``[ ]`` is displayed. To toggle a value, press *SPACE*

0 commit comments

Comments
 (0)