Plant sapling

This commit is contained in:
Oneric 2024-10-02 16:50:51 +02:00
commit f422c8b976
8 changed files with 168 additions and 0 deletions

15
.gitignore vendored Normal file
View file

@ -0,0 +1,15 @@
/patches/000_plant-a-forest.patch
# build artefacts
/*.stamp
# editor stuff
*.swp
*.bak
*.old
*.orig
~*
# temporary files
tmp_*
*.tmp

4
.gitmodules vendored Normal file
View file

@ -0,0 +1,4 @@
[submodule "akkoma"]
path = akkoma
url = https://akkoma.dev/AkkomagAng/akkoma.git
branch = develop

80
Makefile Normal file
View file

@ -0,0 +1,80 @@
# Requires GNU Make
export LC_ALL = C.UTF-8
export PLEROMA_BUILD_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
QUILT ::= quilt --quiltrc ../quiltrc
.PHONY: patch
patch: patch.stamp
GIT_HASH ::= $(shell git rev-parse --short=8 HEAD)
GIT_HASH_OLD ::= $(shell cat git.stamp 2>/dev/null || :)
ifneq ($(GIT_HASH), $(GIT_HASH_OLD))
.PHONY: git.stamp
endif
git.stamp:
@echo "Collecting buld info"
@echo $(GIT_HASH) > $@
patches/000_plant-a-forest.patch: patches/000_plant-a-forest.patch.in git.stamp
@echo "Encoding build info"
@number="$$(git rev-list --count HEAD)" && \
hash="$$(git rev-parse --short=8 HEAD)" && \
sed -e 's/%COMMIT_NUMBER%/'"$$number"'/g' \
-e 's/%COMMIT_HASH%/'"$$hash"'/g' \
$< > $@
submodule.stamp:
@echo "Ensure submodule is up-to-date"
@if [ ! -f akkoma/.git ] || \
[ ! -f $@ ] || \
git submodule status akkoma | grep -qE '^\+' ; then \
git submodule sync && \
git submodule update --init && \
touch $@ ; \
fi
patch.stamp: submodule.stamp patches/series patches/000_plant-a-forest.patch $(wildcard patches/*.patch)
@echo "Applying patches"
@# `pop -a` return 2 if currently no patches applied, thus ignore exit code
@cd akkoma && \
$(QUILT) pop -qfa; \
$(QUILT) push -a
@touch $@
# cleaning
.PHONY: clean
clean:
rm -f *.stamp
rm -f patches/000_plant-a-forest.patch
.PHONY: reset
reset: clean
rm -fr akkoma/
# mix command proxies
.PHONY: build
build: patch
cd akkoma && \
mix deps.get && \
mix deps.compile && \
mix compile
.PHONY: compile
compile: patch
cd akkoma && \
mix compile
.PHONY: migrate
migrate: patch
cd akkoma && \
mix ecto.migrate
.PHONY: server
server: patch
cd akkoma && \
mix phx.server

34
README.md Normal file
View file

@ -0,0 +1,34 @@
# Akkoma: Whimsical Forest Edition
This is [upstream Akkoma `develop`](https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop)
with some additional patches for testing.
All patches (sans the initial wf-ifying one) are intended to reach upstream
eventually and either already have an upstream PR or are intended to be turned
into one once theyve passed initial testing and became more stable.
See `patches/series` for a list of applied changes.
Patch names beginning with `pr111_` indicate its copied from upstream PR `#111`;
`wip_` is used for patches not yet ready for an upstream PR.
## Usage
Youre free to use this for your own instance but keep in mind some of those
patches are experimental and might not yet have been merged for a good reason.
Thus you should only do this if youre comfortable with doing beta testing and
capable of debugging upcoming issues on your own far enought to figure out
which patch introduces the problem and create a useful, detailed report for
the corresponding upstream PR.
If a patch changes its database scheme prior to being merged upstream,
some manual DB fixups might be needed.
If you still want to, just clone this repo and run:
```sh
MIX_ENV=prod make build
```
to build patched Akkoma WF Edition inside the `akkoma/` subdir.
You can then continue to use Akkoma from within this subdir as usual.
To upgrade to a new version, just repeat the above command.

1
akkoma Submodule

@ -0,0 +1 @@
Subproject commit 3c72b48a05921b00e201965ad22b751c5d46bcdf

View file

@ -0,0 +1,26 @@
From: Oneric <oneric@oneric.stub>
Subject: [PATCH] Prepare for Whimsical Forest patches
---
mix.exs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mix.exs b/mix.exs
index 7ffc450e2..1aaf7764a 100644
--- a/mix.exs
+++ b/mix.exs
@@ -256,6 +256,12 @@ defp version(version) do
# Pre-release version, denoted from patch version with a hyphen
cond do
+ commit_hash_err == 0 ->
+ "wf-%COMMIT_NUMBER%-g%COMMIT_HASH%-u" <> commit_hash
+
+ true ->
+ "wf-%COMMIT_NUMBER%-g%COMMIT_HASH%"
+
tag_err == 0 and describe_err == 0 ->
describe
|> String.trim()
--
2.39.5

1
patches/series Normal file
View file

@ -0,0 +1 @@
000_plant-a-forest.patch

7
quiltrc Normal file
View file

@ -0,0 +1,7 @@
QUILT_PATCHES=../patches
QUILT_NO_DIFF_INDEX=1
QUILT_NO_DIFF_TIMESTAMPS=1
QUILT_REFRESH_ARGS="-p ab"
QUILT_DIFF_ARGS="--color=auto"
QUILT_PATCH_OPTS="--reject-format=unified"
QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"