Initial commit

This commit is contained in:
askiiart 2025-04-15 00:08:04 -05:00
parent 1ef0aabd42
commit 55f8604c47
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
3 changed files with 18 additions and 37 deletions

View file

@ -3,8 +3,8 @@ type: docker
name: default
steps:
- name: Build wluma
image: node
- name: Build <PLACEHOLDER>
image: debian
commands:
- '/drone/src/compilation.sh'
volumes:

View file

@ -1,27 +1,17 @@
# [Wluma](https://github.com/maximbaz/wluma) (build)
# [Placeholder](https://github.com/PLACEHOLDER_AUTHOR/PLACEHOLDER_REPO) (build)
```
.
├── 90-wluma-backlight.rules (/etc/udev/rules.d/)
├── config.toml (/usr/share/wluma/examples/)
├── README.md (/usr/share/doc/wluma/)
├── wluma (/usr/bin/)
├── wluma.7.gz (/usr/share/man/man7/)
└── wluma.service (/usr/lib/systemd/user/)
├── 99-filename (/etc/udev/rules.d/)
└── filename.service (/usr/lib/systemd/user/)
```
---
Install deps:
- v4l-utils
- dbus (recommended)
- libc
Build deps:
- gcc
- libclang-dev
- libv4l-dev
- libudev-dev
- libvulkan-dev
- libdbus-1-dev

View file

@ -1,53 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail
program_name="wluma"
program_name="<PLACEHOLDER>"
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
# prep
### prep
workdir=$(mktemp -d)
built_dir=${COMPILED_DIR:-/compiled}/$program_name
mkdir -p $built_dir
apt update && apt install curl jq -y
# check whether it's up-to-date
### check whether it's up-to-date
version_file=$built_dir/version
touch $version_file
# also available via gitlab.com/librewolf-community/browser/source/-/raw/main/{version,release}
version=$(curl 'https://api.github.com/repos/maximbaz/wluma/releases/latest' | jq '.tag_name' -r)
version=$(curl 'https://api.github.com/repos/<PLACEHOLDER_AUTHOR>/<PLACEHOLDER_REPO>/releases/latest' | jq '.tag_name' -r)
if grep -q $version $version_file; then
echo "already up to date, exiting"
exit
fi
## get source and build
### get source and build
# get build deps
# note: npm/npx is also required, but this just assumes it's already installed since i'll be running it in docker with the node image - and doing that's faster than installing it manually
apt install gcc libclang-dev v4l-utils libv4l-dev libudev-dev libvulkan-dev libdbus-1-dev zstd -y # zstd is for archive creation
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
apt install <PLACEHOLDER >-y # zstd is for archive creation
cd $workdir
curl -L $(curl 'https://api.github.com/repos/maximbaz/wluma/releases/latest' | jq '.tarball_url' -r) -o $program_name-$version.tar.gz
curl -L $(curl 'https://api.github.com/repos/<PLACEHOLDER_AUTHOR>/<PLACEHOLDER_REPO>/releases/latest' | jq '.tarball_url' -r) -o $program_name-$version.tar.gz
tar -xzf $program_name-$version.tar.gz
src_dir=$(find $(pwd) -name "maximbaz-wluma*")
cd $src_dir
cargo install --path .
## create .tar.zst archive
### create .tar.zst archive
# prep
cd $src_dir
wluma_archive=$(mktemp -d)
cp $(which wluma) $wluma_archive
sed -i 's/\/usr\/bin\/wluma/\/usr\/bin\/env wluma/g' ./wluma.service
npx -y marked-man README.md | gzip > $wluma_archive/wluma.7.gz
cp README.md $wluma_archive
cp config.toml $wluma_archive
cp wluma.service $wluma_archive
cp 90-wluma-backlight.rules $wluma_archive
$archive_dir=$(mktemp -d)
cp $(which wluma) $archive_dir
cp <PLACEHOLDER >$archive_dir
# actually create it and finish up
cd $wluma_archive
cd $archive_dir
tar --zstd -cf $built_dir/$program_name.tar.zst .
echo $version >$version_file