Skip to content

Commit 379682f

Browse files
committed
open-orpheus:update
1 parent 4cdb40d commit 379682f

1 file changed

Lines changed: 79 additions & 75 deletions

File tree

archlinuxcn/open-orpheus/PKGBUILD

Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,114 @@
1-
# Maintainer: YOUR NAME <you@example.com>
2-
31
pkgname=open-orpheus
4-
pkgver=0.16.1
5-
pkgrel=2
2+
pkgver=0.16.2
3+
pkgrel=1
64
pkgdesc="An open-source implementation of Netease Cloud Music's Orpheus browser host"
75
arch=('x86_64')
86
url="https://github.com/YUCLing/open-orpheus"
97
license=('MIT')
108
_electronver=43
11-
_npmver=43.1.0
129
depends=(
13-
'electron43'
14-
'gtk3'
15-
'libnotify'
16-
'nss'
17-
'xdg-utils'
18-
'at-spi2-core'
19-
'libdrm'
20-
'mesa'
21-
'libxcb'
10+
'electron43'
11+
'gtk3'
12+
'libnotify'
13+
'nss'
14+
'xdg-utils'
15+
'at-spi2-core'
16+
'libdrm'
17+
'mesa'
18+
'libxcb'
2219
)
2320
optdepends=(
24-
'kde-cli-tools: KDE integration'
21+
'kde-cli-tools: KDE integration'
2522
)
2623
makedepends=(
27-
'nodejs>=24'
28-
'pnpm'
29-
'rust'
30-
'rust-wasm'
31-
'wasm-bindgen'
32-
'libarchive'
33-
'git'
24+
'nodejs>=24'
25+
'pnpm'
26+
'rust'
27+
'rust-wasm'
28+
'wasm-bindgen'
29+
'libarchive'
30+
'git'
3431
)
3532
source=(
36-
"$pkgname-$pkgver.tar.gz::https://github.com/YUCLing/open-orpheus/archive/refs/tags/v$pkgver.tar.gz"
37-
"open-orpheus.sh"
38-
"open-orpheus.desktop"
33+
"$pkgname-$pkgver.tar.gz::https://github.com/YUCLing/open-orpheus/archive/refs/tags/v$pkgver.tar.gz"
34+
"open-orpheus.sh"
35+
"open-orpheus.desktop"
3936
)
40-
sha256sums=('aaad6804c864ca6691be37a8119ece57baf5a8a65661d2c4d67ea5e87b18524a'
37+
sha256sums=('b79d1d98f8bac00cc4a23d43e120d1e46711194db53fc8a00159e9e1f3a51ebb'
4138
'1af66959f8bd34896684c154d9169cdbad94b5ec08e107c4652ba5473e8d6ded'
4239
'de9b00ee7e7025cbcadda8cd16b63aa4092fb905803d0e6f4f570ab8461a5f5c')
4340

4441
prepare() {
45-
cd "$pkgname-$pkgver"
42+
cd "$pkgname-$pkgver"
4643

47-
grep -q "\"electron\": \"$_npmver\"" package.json \
48-
|| ( echo "Electron version mismatch in package.json"; exit 1 )
44+
# Read the exact Electron version the project pins. Only check that its
45+
# major version matches the system Electron we build against, so a minor
46+
# or patch bump in package.json does not fail the build.
47+
electron_npmver=$(node -p "require('./package.json').devDependencies.electron")
48+
electron_npmver="${electron_npmver#\^}"
49+
if [ "${electron_npmver%%.*}" != "$_electronver" ]; then
50+
echo "Electron major version mismatch in package.json (expected $_electronver.x, got $electron_npmver)" >&2
51+
exit 1
52+
fi
4953

50-
# Skip Electron's postinstall, which would download Electron from GitHub;
51-
# we build and run against the system Electron instead.
52-
sed -i 's/electron: true/electron: false/' pnpm-workspace.yaml
54+
# Skip Electron's postinstall, which would download Electron from GitHub;
55+
# we build and run against the system Electron instead.
56+
sed -i 's/electron: true/electron: false/' pnpm-workspace.yaml
5357

54-
# Make electron-forge package from a local zip of the system Electron
55-
# instead of downloading it. ELECTRON_ZIP_DIR is read from the environment.
56-
sed -i 's|^ packagerConfig: {$| packagerConfig: {\n electronZipDir: process.env.ELECTRON_ZIP_DIR,|' forge.config.ts
58+
# Make electron-forge package from a local zip of the system Electron
59+
# instead of downloading it. ELECTRON_ZIP_DIR is read from the environment.
60+
sed -i 's|^ packagerConfig: {$| packagerConfig: {\n electronZipDir: process.env.ELECTRON_ZIP_DIR,|' forge.config.ts
5761

58-
# Create the Electron zip that electron-packager will extract. Entry names
59-
# must not be prefixed with "./" (extract-zip rejects those).
60-
zipdir="$srcdir/electron-zip"
61-
mkdir -p "$zipdir"
62-
(
63-
cd "/usr/lib/electron$_electronver"
64-
find . -mindepth 1 -print | sed 's|^\./||' \
65-
| bsdtar --format=zip -cf "$zipdir/electron-v$_npmver-linux-x64.zip" -T -
66-
)
62+
# Create the Electron zip that electron-packager will extract. Entry names
63+
# must not be prefixed with "./" (extract-zip rejects those).
64+
zipdir="$srcdir/electron-zip"
65+
mkdir -p "$zipdir"
66+
(
67+
cd "/usr/lib/electron$_electronver"
68+
find . -mindepth 1 -print | sed 's|^\./||' |
69+
bsdtar --format=zip -cf "$zipdir/electron-v$electron_npmver-linux-x64.zip" -T -
70+
)
6771

68-
export ELECTRON_ZIP_DIR="$zipdir"
69-
export ELECTRON_OVERRIDE_DIST_PATH="/usr/lib/electron$_electronver"
70-
pnpm install --frozen-lockfile
72+
export ELECTRON_ZIP_DIR="$zipdir"
73+
export ELECTRON_OVERRIDE_DIST_PATH="/usr/lib/electron$_electronver"
74+
pnpm install --frozen-lockfile
7175

72-
# Pre-seed the electron npm package so `require('electron')` resolves to
73-
# the system binary instead of trying to download it.
74-
mkdir -p node_modules/electron/dist
75-
printf '%s' "$_npmver" > node_modules/electron/dist/version
76-
printf 'electron' > node_modules/electron/path.txt
76+
# Pre-seed the electron npm package so `require('electron')` resolves to
77+
# the system binary instead of trying to download it.
78+
mkdir -p node_modules/electron/dist
79+
printf '%s' "$electron_npmver" >node_modules/electron/dist/version
80+
printf 'electron' >node_modules/electron/path.txt
7781
}
7882

7983
build() {
80-
cd "$pkgname-$pkgver"
81-
export ELECTRON_ZIP_DIR="$srcdir/electron-zip"
82-
export ELECTRON_OVERRIDE_DIST_PATH="/usr/lib/electron$_electronver"
84+
cd "$pkgname-$pkgver"
85+
export ELECTRON_ZIP_DIR="$srcdir/electron-zip"
86+
export ELECTRON_OVERRIDE_DIST_PATH="/usr/lib/electron$_electronver"
8387

84-
# The wasm32 rust-lld used by the audio-effect module rejects
85-
# `-Wl,--icf=safe`, which distro makepkg.conf files (e.g. CachyOS) inject
86-
# via RUSTFLAGS. Drop it for the native-module build.
87-
ORIGINAL_RUSTFLAGS="$RUSTFLAGS"
88-
RUSTFLAGS="${RUSTFLAGS//-C link-arg=-Wl,--icf=safe/}"
89-
RUSTFLAGS="${RUSTFLAGS//-Clink-arg=-Wl,--icf=safe/}"
90-
export RUSTFLAGS
88+
# The wasm32 rust-lld used by the audio-effect module rejects
89+
# `-Wl,--icf=safe`, which distro makepkg.conf files (e.g. CachyOS) inject
90+
# via RUSTFLAGS. Drop it for the native-module build.
91+
ORIGINAL_RUSTFLAGS="$RUSTFLAGS"
92+
RUSTFLAGS="${RUSTFLAGS//-C link-arg=-Wl,--icf=safe/}"
93+
RUSTFLAGS="${RUSTFLAGS//-Clink-arg=-Wl,--icf=safe/}"
94+
export RUSTFLAGS
9195

92-
# Native modules (Rust napi + wasm) then the Forge package.
93-
pnpm run build:modules
96+
# Native modules (Rust napi + wasm) then the Forge package.
97+
pnpm run build:modules
9498

95-
RUSTFLAGS="$ORIGINAL_RUSTFLAGS"
96-
export RUSTFLAGS
97-
pnpm run package
99+
RUSTFLAGS="$ORIGINAL_RUSTFLAGS"
100+
export RUSTFLAGS
101+
pnpm run package
98102
}
99103

100104
package() {
101-
cd "$pkgname-$pkgver"
102-
install -dm755 "$pkgdir/usr/lib/$pkgname/resources"
103-
cp -r out/"$pkgname"-linux-*/resources/app.asar "$pkgdir/usr/lib/$pkgname/resources/"
104-
cp -r out/"$pkgname"-linux-*/resources/app.asar.unpacked "$pkgdir/usr/lib/$pkgname/resources/"
105+
cd "$pkgname-$pkgver"
106+
install -dm755 "$pkgdir/usr/lib/$pkgname/resources"
107+
cp -r out/"$pkgname"-linux-*/resources/app.asar "$pkgdir/usr/lib/$pkgname/resources/"
108+
cp -r out/"$pkgname"-linux-*/resources/app.asar.unpacked "$pkgdir/usr/lib/$pkgname/resources/"
105109

106-
install -Dm755 "$srcdir/open-orpheus.sh" "$pkgdir/usr/bin/$pkgname"
107-
install -Dm644 "$srcdir/open-orpheus.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
108-
install -Dm644 assets/icon_256.png "$pkgdir/usr/share/icons/hicolor/256x256/apps/$pkgname.png"
109-
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
110+
install -Dm755 "$srcdir/open-orpheus.sh" "$pkgdir/usr/bin/$pkgname"
111+
install -Dm644 "$srcdir/open-orpheus.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
112+
install -Dm644 assets/icon_256.png "$pkgdir/usr/share/icons/hicolor/256x256/apps/$pkgname.png"
113+
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
110114
}

0 commit comments

Comments
 (0)