Skip to content

Commit

Permalink
breaking-change: Build config is de-structured according to platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Jul 21, 2024
1 parent bef16e4 commit 04eb3aa
Show file tree
Hide file tree
Showing 11 changed files with 935 additions and 403 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- The 'bitmaps' directory has been removed from the git repository. You can now generate the PNG files using `yarn render` or download them from the release assets.

- The `build.toml` file has been removed. Instead, the cursor build configurations are now distributed according to platforms within the `configs` directory:
- `configs/x.build.toml`: Used to build XCursor.
- `configs/win_rg.build.toml`: Used to build regular size Windows cursors.
- `configs/win_lg.build.toml`: Used to build large size Windows cursors.
- `configs/win_xxl.build.toml`: Used to build extra large size Windows cursors.

### What's New?

- Banana cursor is now customizable
- Support `256px` cursors
- Official Distributing `16` and `20` XCursors
- Multi Resolution Windows Cursors
- Attach version meta-data inside cursor packages
- Using [cbmp v1.1.1](https://github.com/ful1e5/cbmp/tree/v1.1.1) for rendering cursor bitmaps.

### Changes

Expand Down
88 changes: 88 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash
# A script for preparing binaries of Banana Cursors, created by Abdulkaiz Khatri.

version="v2.0.1"

error() (
set -o pipefail
"$@" 2> >(sed $'s,.*,\e[31m&\e[m,' >&2)
)

get_config_file() {
local key="${1}"
local cfg_file="build.toml"

if [[ $key == *"Right"* ]]; then
cfg_file="build.right.toml"
fi

echo $cfg_file
}

with_version() {
local comment="${1}"
echo "$comment ($version)"
}

if ! type -p ctgen >/dev/null; then
error ctgen
exit 127 # exit program with "command not found" error code
fi

declare -A names
names["Banana"]=$(with_version "The Banana")
names["Banana-Green"]=$(with_version "The Green Banana")

# Cleanup old builds
rm -rf themes bin

# Building Banana XCursor binaries
for key in "${!names[@]}"; do
comment="${names[$key]}"
cfg=$(get_config_file key)

ctgen "configs/x.$cfg" -p x11 -d "bitmaps/$key" -n "$key" -c "$comment XCursors" &
PID=$!
wait $PID
done

# Building Banana Windows binaries
for key in "${!names[@]}"; do
comment="${names[$key]}"
cfg=$(get_config_file key)

ctgen "configs/win_rg.$cfg" -d "bitmaps/$key" -n "$key-Regular" -c "$comment Regular Windows Cursors" &
ctgen "configs/win_lg.$cfg" -d "bitmaps/$key" -n "$key-Large" -c "$comment Large Windows Cursors" &
ctgen "configs/win_xl.$cfg" -d "bitmaps/$key" -n "$key-Extra-Large" -c "$comment Extra Large Windows Cursors" &
PID=$!
wait $PID
done

# Compressing Binaries
mkdir -p bin
cd themes || exit

for key in "${!names[@]}"; do
tar -cJvf "../bin/${key}.tar.xz" "${key}" &
PID=$!
wait $PID
done

# Compressing banana-all.tar.xz
cp ../LICENSE .
tar -cJvf "../bin/banana-all.tar.xz" --exclude="*-Windows" . &
PID=$!
wait $PID

# Compressing Banana-*-Windows
for key in "${!names[@]}"; do
zip -rv "../bin/${key}-Windows.zip" "${key}-Regular-Windows" "${key}-Large-Windows" "${key}-Extra-Large-Windows" &
PID=$!
wait $PID
done

cd ..

# Copying License File for 'bitmaps'
cp LICENSE bitmaps/
zip -rv bin/bitmaps.zip bitmaps
Loading

0 comments on commit 04eb3aa

Please sign in to comment.