Skip to content

Commit 78a8f84

Browse files
authored
chore: Prepare For Distribution (#97)
Set application version to `2025.5.0`, the first release in May, 2025. Remove unnecessary bundled icons. Load linkding logo into memory, instead of reading from path. Add a just target which is able to build universal macOS release, and generate a DMG (Resolves #35). Add a just target which is able to build a flatpak.
1 parent 5081ad2 commit 78a8f84

29 files changed

Lines changed: 391 additions & 548 deletions

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cosmicding"
3-
version = "0.1.0"
3+
version = "2025.5.0"
44
edition = "2021"
55

66
[dependencies]

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
# cosmicding
1111

12+
> [!NOTE]
13+
> macOS status <https://github.com/vkhitrin/cosmicding/discussions/96>
14+
1215
cosmicding is a [linkding](https://github.com/sissbruecker/linkding) companion app for COSMIC™ Desktop Environment.
1316
It provides an alternative frontend to linkding based on [libcosmic](https://github.com/pop-os/libcosmic).
1417

@@ -25,14 +28,28 @@ cosmicding has been tested with linkding releases >= `1.31.0`.
2528

2629
## Installation
2730

28-
> [!NOTE]
29-
> Currently cosmicding is hard-codded to build Apple Silicon releases for macOS.
31+
### Remote
32+
33+
cosmicding can be installed from remote sources in several ways:
34+
35+
#### Linux
36+
37+
- Download compiled binaries from GitHub release.
38+
- Flatpak (**not yet published**).
3039

31-
cosmicding is not distributed at the moment, and has to be built manually.
40+
#### macOS
41+
42+
- Download DMG from GitHub release.
43+
- Using brew:
44+
45+
```shell
46+
brew tap vkhitrin/tap
47+
brew install --cask vkhitrin/tap/cosmicding
48+
```
3249

3350
### Local Install (compiled binary)
3451

35-
Dependencies (Linux)
52+
Dependencies (Linux):
3653

3754
- `cargo`
3855
- `just`
@@ -41,12 +58,13 @@ Dependencies (Linux)
4158
- `libsqlite3-dev`
4259
- `cosmic-icons`
4360

44-
Dependencies (macOS)
61+
Dependencies (macOS):
4562

4663
- `cargo`
4764
- `just`
4865
- `libxkbcommon`
4966
- `sqlite3`
67+
- `cosmic-icons` (can be fetched using brew `brew install --HEAD vkhitrin/tap/cosmic-icons-theme`)
5068

5169
Installation:
5270

@@ -76,13 +94,7 @@ flatpak-builder --force-clean \
7694
--mirror-screenshots-url=https://dl.flathub.org/media/ \
7795
--repo=flatpak-repo builddir \
7896
res/flatpak/com.vkhitrin.cosmicding
79-
````
80-
81-
## Roadmap
82-
83-
cosmicding is currently under heavy development, and is not distributed outside of source code.
84-
85-
The initial release is expected to support Linux platforms, and macOS partially.
97+
```
8698

8799
## Thanks
88100

justfile

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name := 'cosmicding'
22
appid := 'com.vkhitrin.cosmicding'
3-
migrations_folder := clean(rootdir / prefix) / 'share' / appid / 'migrations'
43

54
rootdir := ''
65
prefix := '/usr'
@@ -14,6 +13,8 @@ desktop := appid + '.desktop'
1413
desktop-src := 'res' / 'linux' / desktop
1514
desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop
1615

16+
metainfo-dst := clean(rootdir / prefix) / 'share' / 'metainfo' / 'com.vkhitrin.cosmicding.metainfo.xml'
17+
1718
icons-src := 'res' / 'linux' / 'icons' / 'hicolor'
1819
icons-dst := clean(rootdir / prefix) / 'share' / 'icons' / 'hicolor'
1920

@@ -47,19 +48,54 @@ build-release *args:
4748
if [ "$(uname)" = "Linux" ]; then
4849
just build-release-linux
4950
elif [ "$(uname)" = "Darwin" ]; then
50-
just build-release-macos
51+
if [ "$(uname -m)" = "arm64" ]; then
52+
just build-release-macos-aarch64
53+
elif [ "$(uname -m)" = "x86_64" ]; then
54+
just build-release-macos-x86_64
55+
fi
5156
fi
57+
5258
build-release-linux *args: (build-debug '--release' args)
5359

54-
build-release-macos *args:
55-
cargo build --release --target=aarch64-apple-darwin {{args}}
60+
build-release-macos-aarch64 *args:
61+
#!/usr/bin/env sh
62+
if [ ! -z $COSMICDING_UNIVERAL_BUILD ]; then
63+
SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
64+
CFLAGS="-isysroot $SDKROOT"
65+
rustup run stable cargo build --release --target aarch64-apple-darwin {{args}}
66+
else
67+
cargo build --release --target=aarch64-apple-darwin {{args}}
68+
lipo "target/aarch64-apple-darwin/release/{{name}}" -create -output "{{macos-app-binary}}"
69+
just bundle-macos
70+
fi
71+
72+
build-release-macos-x86_64 *args:
73+
#!/usr/bin/env sh
74+
echo $COSMICDING_UNIVERAL_BUILD
75+
if [ ! -z $COSMICDING_UNIVERAL_BUILD ]; then
76+
SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
77+
CFLAGS="-isysroot $SDKROOT"
78+
rustup run stable cargo build --release --target x86_64-apple-darwin {{args}}
79+
else
80+
cargo build --release --target x86_64-apple-darwin {{args}}
81+
lipo "target/x86_64-apple-darwin/release/{{name}}" -create -output "{{macos-app-binary}}"
82+
just bundle-macos
83+
fi
5684
85+
build-release-macos-universal *args:
86+
which rustup || exit 1
87+
rustup toolchain install stable
88+
rustup target add aarch64-apple-darwin
89+
rustup target add x86_64-apple-darwin
90+
env COSMICDING_UNIVERAL_BUILD=true just build-release-macos-aarch64
91+
env COSMICDING_UNIVERAL_BUILD=true just build-release-macos-x86_64
92+
lipo "target/aarch64-apple-darwin/release/{{name}}" "target/x86_64-apple-darwin/release/{{name}}" -create -output "{{macos-app-binary}}"
93+
just bundle-macos
94+
95+
bundle-macos:
5796
# Using native macOS' sed
5897
/usr/bin/sed -i '' -e "s/__VERSION__/$(cargo pkgid | cut -d "#" -f2)/g" {{macos-app-template-plist}}
5998
/usr/bin/sed -i '' -e "s/__BUILD__/$(git describe --always --exclude='*')/g" {{macos-app-template-plist}}
60-
61-
lipo "target/aarch64-apple-darwin/release/{{name}}" -create -output "{{macos-app-binary}}"
62-
6399
mkdir -p "{{macos-app-binary-dir}}"
64100
mkdir -p "{{macos-app-extras-dir}}/icons/"
65101
cp -fRp "{{macos-app-template}}" "{{macos-app-dir}}"
@@ -69,6 +105,31 @@ build-release-macos *args:
69105
echo "Created '{{macos-app-name}}' in '{{macos-app-dir}}'"
70106
git stash -- {{macos-app-template-plist}}
71107

108+
distribute-macos-dmg:
109+
which create-dmg || exit 1
110+
create-dmg \
111+
--volname "cosmicding Installer" \
112+
--window-pos 200 120 \
113+
--window-size 800 400 \
114+
--icon-size 100 \
115+
--hide-extension "cosmicding.app" \
116+
--icon {{macos-app-name}} 200 160 \
117+
--app-drop-link 600 155 \
118+
{{macos-app-dir}}/{{macos-dmg-name}} \
119+
{{macos-app-dir}}/{{macos-app-name}}
120+
121+
build-release-linux-flatpak:
122+
which flatpak-builder || exit 1
123+
flatpak-builder --force-clean \
124+
--sandbox \
125+
--user \
126+
--install \
127+
--install-deps-from=flathub \
128+
--ccache \
129+
--mirror-screenshots-url=https://dl.flathub.org/media/ \
130+
--repo=flatpak-repo builddir \
131+
res/flatpak/com.vkhitrin.cosmicding.yaml
132+
72133
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
73134

74135
check *args:
@@ -94,23 +155,16 @@ run *args:
94155
install:
95156
#!/usr/bin/env sh
96157
if [ "$(uname)" = "Linux" ]; then
97-
just install-migrations
98158
install -Dm0755 {{bin-src}} {{bin-dst}}
99-
install -Dm0644 res/linux/app.desktop {{desktop-dst}}
100159
for size in `ls {{icons-src}}`; do \
101160
install -Dm0644 "{{icons-src}}/$size/apps/{{appid}}.png" "{{icons-dst}}/$size/apps/{{appid}}.png"; \
102161
done
162+
install -Dm0644 res/linux/app.desktop {{desktop-dst}}
163+
install -Dm0644 res/flatpak/com.vkhitrin.cosmicding.metainfo.xml {{metainfo-dst}}
103164
elif [ "$(uname)" = "Darwin" ]; then
104165
cp -r {{macos-app-dir}}/{{name}}.app /Applications/
105166
fi
106167
107-
install-migrations:
108-
#!/usr/bin/env sh
109-
set -ex
110-
for file in ./migrations/*; do
111-
install -Dm0644 $file "{{migrations_folder}}/$(basename "$file")"
112-
done
113-
114168
uninstall:
115169
#!/usr/bin/env sh
116170
if [ "$(uname)" = "Linux" ]; then

0 commit comments

Comments
 (0)