|
1 | | -# Maintainer: YOUR NAME <you@example.com> |
2 | | - |
3 | 1 | pkgname=open-orpheus |
4 | | -pkgver=0.16.1 |
5 | | -pkgrel=2 |
| 2 | +pkgver=0.16.2 |
| 3 | +pkgrel=1 |
6 | 4 | pkgdesc="An open-source implementation of Netease Cloud Music's Orpheus browser host" |
7 | 5 | arch=('x86_64') |
8 | 6 | url="https://github.com/YUCLing/open-orpheus" |
9 | 7 | license=('MIT') |
10 | 8 | _electronver=43 |
11 | | -_npmver=43.1.0 |
12 | 9 | 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' |
22 | 19 | ) |
23 | 20 | optdepends=( |
24 | | - 'kde-cli-tools: KDE integration' |
| 21 | + 'kde-cli-tools: KDE integration' |
25 | 22 | ) |
26 | 23 | 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' |
34 | 31 | ) |
35 | 32 | 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" |
39 | 36 | ) |
40 | | -sha256sums=('aaad6804c864ca6691be37a8119ece57baf5a8a65661d2c4d67ea5e87b18524a' |
| 37 | +sha256sums=('b79d1d98f8bac00cc4a23d43e120d1e46711194db53fc8a00159e9e1f3a51ebb' |
41 | 38 | '1af66959f8bd34896684c154d9169cdbad94b5ec08e107c4652ba5473e8d6ded' |
42 | 39 | 'de9b00ee7e7025cbcadda8cd16b63aa4092fb905803d0e6f4f570ab8461a5f5c') |
43 | 40 |
|
44 | 41 | prepare() { |
45 | | - cd "$pkgname-$pkgver" |
| 42 | + cd "$pkgname-$pkgver" |
46 | 43 |
|
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 |
49 | 53 |
|
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 |
53 | 57 |
|
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 |
57 | 61 |
|
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 | + ) |
67 | 71 |
|
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 |
71 | 75 |
|
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 |
77 | 81 | } |
78 | 82 |
|
79 | 83 | 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" |
83 | 87 |
|
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 |
91 | 95 |
|
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 |
94 | 98 |
|
95 | | - RUSTFLAGS="$ORIGINAL_RUSTFLAGS" |
96 | | - export RUSTFLAGS |
97 | | - pnpm run package |
| 99 | + RUSTFLAGS="$ORIGINAL_RUSTFLAGS" |
| 100 | + export RUSTFLAGS |
| 101 | + pnpm run package |
98 | 102 | } |
99 | 103 |
|
100 | 104 | 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/" |
105 | 109 |
|
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" |
110 | 114 | } |
0 commit comments