initial commit

This commit is contained in:
askiiart 2025-03-24 13:12:26 -05:00
commit 76baa6a68e
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
3 changed files with 78 additions and 0 deletions

17
.drone.yml Normal file
View file

@ -0,0 +1,17 @@
kind: pipeline
type: docker
name: default
steps:
- name: Build wluma
image: debian
commands:
- '/drone/src/compilation.sh'
volumes:
- name: program-archives
path: /compiled
volumes:
- name: program-archives
host:
path: /mnt/user/files/repos/archives

20
README.md Normal file
View file

@ -0,0 +1,20 @@
# [Wluma](https://github.com/maximbaz/wluma) (build)
```
.
├── wluma
└── wluma.service
```
---
Install deps:
- v4l-utils
Build deps:
- libv4l-dev
- libudev-dev
- libvulkan-dev
- libdbus-1-dev

41
compilation.sh Normal file
View file

@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
program_name="librewolf-allow-dark"
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
# 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
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)
if grep -q $version $version_file; then
echo "already up to date, exiting"
exit
fi
## get source and build
# get build deps
sudo apt-get -y install v4l-utils libv4l-dev libudev-dev libvulkan-dev libdbus-1-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
cd $workdir
curl -L $(curl 'https://api.github.com/repos/maximbaz/wluma/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
wluma_archive=$(mktemp -d)
cp $(which wluma) $wluma_archive
sed -i 's/\/usr\/bin\/wluma/\/usr\/bin\/env wluma/g' $src_dir/wluma.service
cp $src_dir/wluma.service $wluma_archive