Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ meson compile -C builddir
sudo meson install -C builddir
```

### Build Deb package from source

```bash
./build-deb.sh
```

## Usage

```bash
Expand All @@ -99,6 +105,14 @@ stenmark ~/Notes/todo.md # opens a file directly (sidebar hidden)

Settings are stored in `~/.config/stenmark/settings.json` and can be changed from the Preferences dialog. All changes take effect immediately, except the interface language, which applies on restart.

## Troubleshooting

If you encounter issues or crashes, debug output can be enabled by running the following command in your terminal:

```
G_MESSAGES_DEBUG=all PYTHONUNBUFFERED=1 stenmark
```

## License

GPL-3.0-**only** — version 3 of the GNU General Public License, and not "or any later version".
Expand Down
62 changes: 62 additions & 0 deletions build-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -euo pipefail

PROJECT_NAME="stenmark"
VERSION=$(grep -oP "^version:\s*'\K[^']+" meson.build || echo "0.8.0")
DEB_STAGING="$(pwd)/deb-staging"
CONFIG_FILE="/tmp/nfpm-stenmark.yaml"

cleanup() {
rm -rf "$DEB_STAGING" "$CONFIG_FILE" builddir
}
trap cleanup EXIT

echo "==> Building .deb package for $PROJECT_NAME v$VERSION"

# 1. Ensure required build tools exist
for cmd in meson ninja nfpm; do
if ! command -v "$cmd" &>/dev/null; then
echo "ERROR: Missing required command '$cmd'. Install meson, ninja-build, and nfpm first."
exit 1
fi
done

# 2. Stage the application installation tree
rm -rf "$DEB_STAGING" builddir
meson setup builddir --prefix=/usr
meson compile -C builddir
DESTDIR="$DEB_STAGING" meson install -C builddir --no-rebuild

# 3. Generate contents list for nFPM
CONTENTS=""
while IFS= read -r file; do
dst="${file#"$DEB_STAGING"}"
CONTENTS+=" - src: $file
dst: $dst
"
done < <(find "$DEB_STAGING" -type f)

# 4. Write nFPM configuration
cat > "$CONFIG_FILE" <<NFPM
name: $PROJECT_NAME
arch: amd64
version: $VERSION
maintainer: local
description: GTK4 Markdown note editor
license: GPL-3.0-only
depends:
- python3
- gir1.2-gtk-4.0
- gir1.2-adw-1
- gir1.2-webkit-6.0
- python3-gi
- python3-markdown
contents:
$CONTENTS
NFPM

# 5. Build .deb package
nfpm package -p deb -f "$CONFIG_FILE"

echo "==> Successfully built package:"
ls -l "${PROJECT_NAME}"_*.deb