From fb9686c6505475f342ad94fa5ed1351f554f97fe Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 9 Aug 2022 16:21:52 +0200 Subject: [PATCH] Move uncritical files into `etc/` (#350) This is mainly just to reduce the amount of files in the project root. The criteria of what gets into `etc/` are the following: * The file should not be necessary for building nsxiv. This excludes the `icon/*` stuff since that's needed by `window.c`. * The file shouldn't have any valid reason to stay in the project root. This excludes things like `README.md`, `.gitignore` etc. Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/350 Reviewed-by: explosion-mental --- .github/workflows/build.yml | 2 +- Makefile | 8 ++++---- README.md | 8 ++++---- CHANGELOG.md => etc/CHANGELOG.md | 0 CONTRIBUTING.md => etc/CONTRIBUTING.md | 4 ++-- {examples => etc/examples}/image-info | 0 {examples => etc/examples}/key-handler | 0 {examples => etc/examples}/thumb-info | 0 {examples => etc/examples}/win-title | 0 nsxiv.1 => etc/nsxiv.1 | 0 nsxiv.desktop => etc/nsxiv.desktop | 0 {.woodpecker => etc/woodpecker}/CFLAGS | 0 {.woodpecker => etc/woodpecker}/analysis.yml | 2 +- {.woodpecker => etc/woodpecker}/build.yml | 2 +- {.woodpecker => etc/woodpecker}/clang-tidy-checks | 0 {.woodpecker => etc/woodpecker}/spell.yml | 0 16 files changed, 13 insertions(+), 13 deletions(-) rename CHANGELOG.md => etc/CHANGELOG.md (100%) rename CONTRIBUTING.md => etc/CONTRIBUTING.md (97%) rename {examples => etc/examples}/image-info (100%) rename {examples => etc/examples}/key-handler (100%) rename {examples => etc/examples}/thumb-info (100%) rename {examples => etc/examples}/win-title (100%) rename nsxiv.1 => etc/nsxiv.1 (100%) rename nsxiv.desktop => etc/nsxiv.desktop (100%) rename {.woodpecker => etc/woodpecker}/CFLAGS (100%) rename {.woodpecker => etc/woodpecker}/analysis.yml (91%) rename {.woodpecker => etc/woodpecker}/build.yml (94%) rename {.woodpecker => etc/woodpecker}/clang-tidy-checks (100%) rename {.woodpecker => etc/woodpecker}/spell.yml (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9269de..cfa9e1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: ( cd "tinycc-$TCC_SHA" && ./configure && make && sudo make install; ) - name: build run: | - CFLAGS="$(sed '/^#/d' .woodpecker/CFLAGS | paste -d ' ' -s)" + CFLAGS="$(sed '/^#/d' etc/woodpecker/CFLAGS | paste -d ' ' -s)" build () { for cc in "gcc" "clang" "tcc"; do echo "### $cc - $2 build ###" diff --git a/Makefile b/Makefile index cc8f3ce..04d2ed7 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ install-all: install install-desktop install-icon install-desktop: @echo "INSTALL nsxiv.desktop" mkdir -p $(DESTDIR)$(PREFIX)/share/applications - cp nsxiv.desktop $(DESTDIR)$(PREFIX)/share/applications + cp etc/nsxiv.desktop $(DESTDIR)$(PREFIX)/share/applications install-icon: @echo "INSTALL icon" @@ -91,12 +91,12 @@ install: all chmod 755 $(DESTDIR)$(PREFIX)/bin/nsxiv @echo "INSTALL nsxiv.1" mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - sed "s!EGPREFIX!$(EGPREFIX)!g; s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" nsxiv.1 \ - >$(DESTDIR)$(MANPREFIX)/man1/nsxiv.1 + sed "s!EGPREFIX!$(EGPREFIX)!g; s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" \ + etc/nsxiv.1 >$(DESTDIR)$(MANPREFIX)/man1/nsxiv.1 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/nsxiv.1 @echo "INSTALL share/nsxiv/" mkdir -p $(DESTDIR)$(EGPREFIX) - cp examples/* $(DESTDIR)$(EGPREFIX) + cp etc/examples/* $(DESTDIR)$(EGPREFIX) chmod 755 $(DESTDIR)$(EGPREFIX)/* uninstall: uninstall-icon diff --git a/README.md b/README.md index 9a047f2..bcefea8 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ under GPLv2 and aims to be easy to modify and customize. Please file a bug report if something does not work as documented or expected on [Codeberg] after making sure you are using the latest release. Contributions -are welcome, see [CONTRIBUTING.md] to get started. +are welcome, see [CONTRIBUTING] to get started. [Codeberg]: https://codeberg.org/nsxiv/nsxiv/issues/new -[CONTRIBUTING.md]: CONTRIBUTING.md#contribution-guideline +[CONTRIBUTING]: etc/CONTRIBUTING.md#contribution-guideline Features @@ -185,7 +185,7 @@ or by using Xresources as explained in the manual. If these options are not suff you may implement your own features by following [this guide](https://codeberg.org/nsxiv/nsxiv-extra/src/branch/master/CUSTOMIZATION.md). -Due to our limited [project scope](CONTRIBUTING.md#project-scope), certain features or +Due to our limited [project scope](etc/CONTRIBUTING.md#project-scope), certain features or customization cannot be merged into nsxiv mainline. Following the spirit of suckless software, we host the [nsxiv-extra](https://codeberg.org/nsxiv/nsxiv-extra) repo where users are free to submit whatever patches or scripts they wish. @@ -206,7 +206,7 @@ on CodeBerg or get a copy using git with the following command: $ git clone https://codeberg.org/nsxiv/nsxiv.git -You can view the changelog [here](CHANGELOG.md) +You can view the changelog [here](etc/CHANGELOG.md) Similar projects diff --git a/CHANGELOG.md b/etc/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to etc/CHANGELOG.md diff --git a/CONTRIBUTING.md b/etc/CONTRIBUTING.md similarity index 97% rename from CONTRIBUTING.md rename to etc/CONTRIBUTING.md index 93e0552..8d9680f 100644 --- a/CONTRIBUTING.md +++ b/etc/CONTRIBUTING.md @@ -23,7 +23,7 @@ Contribution Guideline When contributing, make sure: * Your contribution falls under nsxiv's scope and aim - * You follow the existing code style (see [.editorconfig](.editorconfig)) + * You follow the existing code style (see [.editorconfig](../.editorconfig)) * You open the pull request from a new branch, not from master * To avoid using force pushes, especially for bigger patches. Only use them when there's merge conflicts. @@ -68,7 +68,7 @@ For releases, the process is the following: the commit message and tag description for the release commit to "Release version N". Make sure to use an annotated tag. * Update `VERSION` macro in `config.mk`. - * Update the changelog (`CHANGELOG.md`): + * Update the changelog (`etc/CHANGELOG.md`): * Include link to the release tarball and add the release date. * Document only the changes or fixes between releases. Don't document changes which never made it into a release. diff --git a/examples/image-info b/etc/examples/image-info similarity index 100% rename from examples/image-info rename to etc/examples/image-info diff --git a/examples/key-handler b/etc/examples/key-handler similarity index 100% rename from examples/key-handler rename to etc/examples/key-handler diff --git a/examples/thumb-info b/etc/examples/thumb-info similarity index 100% rename from examples/thumb-info rename to etc/examples/thumb-info diff --git a/examples/win-title b/etc/examples/win-title similarity index 100% rename from examples/win-title rename to etc/examples/win-title diff --git a/nsxiv.1 b/etc/nsxiv.1 similarity index 100% rename from nsxiv.1 rename to etc/nsxiv.1 diff --git a/nsxiv.desktop b/etc/nsxiv.desktop similarity index 100% rename from nsxiv.desktop rename to etc/nsxiv.desktop diff --git a/.woodpecker/CFLAGS b/etc/woodpecker/CFLAGS similarity index 100% rename from .woodpecker/CFLAGS rename to etc/woodpecker/CFLAGS diff --git a/.woodpecker/analysis.yml b/etc/woodpecker/analysis.yml similarity index 91% rename from .woodpecker/analysis.yml rename to etc/woodpecker/analysis.yml index c6fa796..35cef7f 100644 --- a/.woodpecker/analysis.yml +++ b/etc/woodpecker/analysis.yml @@ -18,7 +18,7 @@ pipeline: *.c } run_tidy() { - checks="$(sed '/^#/d' .woodpecker/clang-tidy-checks | paste -d ',' -s)" + checks="$(sed '/^#/d' etc/woodpecker/clang-tidy-checks | paste -d ',' -s)" clang-tidy --warnings-as-errors="*" --checks="$checks" --quiet *.c \ -- -std="$std" $(make OPT_DEP_DEFAULT="$1" dump_cppflags) } diff --git a/.woodpecker/build.yml b/etc/woodpecker/build.yml similarity index 94% rename from .woodpecker/build.yml rename to etc/woodpecker/build.yml index fdcf68c..603fa0e 100644 --- a/.woodpecker/build.yml +++ b/etc/woodpecker/build.yml @@ -14,7 +14,7 @@ pipeline: wget "https://github.com/TinyCC/tinycc/archive/$TCC_SHA.tar.gz" >/dev/null tar xzf "$TCC_SHA.tar.gz" >/dev/null ( cd "tinycc-$TCC_SHA" && ./configure --config-musl && make -s -j"$(nproc)" && make install; ) >/dev/null - CFLAGS="$(sed '/^#/d' .woodpecker/CFLAGS | paste -d ' ' -s)" + CFLAGS="$(sed '/^#/d' etc/woodpecker/CFLAGS | paste -d ' ' -s)" build () { for cc in "gcc" "clang" "tcc"; do echo "### $cc - $2 build ###" diff --git a/.woodpecker/clang-tidy-checks b/etc/woodpecker/clang-tidy-checks similarity index 100% rename from .woodpecker/clang-tidy-checks rename to etc/woodpecker/clang-tidy-checks diff --git a/.woodpecker/spell.yml b/etc/woodpecker/spell.yml similarity index 100% rename from .woodpecker/spell.yml rename to etc/woodpecker/spell.yml