miru-project / miru-app

🎉 A versatile application that is free, open-source, and supports extension sources for videos, comics, and novels, available on Android, Windows, and Web platforms.
https://miru.js.org
GNU Affero General Public License v3.0
3.31k stars 148 forks source link

[Linux] Add Arch PKGBUILD #134

Open Bims-sh opened 7 months ago

Bims-sh commented 7 months ago

Describe your suggested feature

Hi there, hope this is the right place since discussions are disabled on this repo.

I wrote a small PKGBUILD for Arch based systems since I wanted to upload it to the AUR. If anyone could give some feedback or improvements on the PKGBUILD, it would be appreciated. Could also be helpful for other distros as well.

image

Acknowledgements

Bims-sh commented 7 months ago

Here is the PKGBUILD file:

pkgname=miru-app-git
_pkgname=miru-app
pkgver=275.287a924
pkgrel=1
pkgdesc="A versatile application that is free, open-source, and supports extension sources for videos, comics, and novels, available on Android, Windows, and Web platforms."
arch=("x86_64")
url="https://github.com/miru-project/${_pkgname}"
license=("APGL-3.0")
provides=($_pkgname)
conflicts=($_pkgname)
replaces=($_pkgname)
depends=("webkit2gtk-4.1")
makedepends=("git" "flutter" "clang" "ninja" "pkgconf")
source=("git+https://github.com/miru-project/$_pkgname.git")
md5sums=('SKIP')

pkgver() {
  cd $_pkgname
  echo $(git rev-list --count dev).$(git rev-parse --short dev)
}

prepare(){
  cd $_pkgname

  # Prepare Flutter
  flutter --no-version-check config --no-analytics
  flutter --no-version-check config --enable-linux-desktop
  flutter --no-version-check pub get
}

build() {
  cd $_pkgname

  # Build the Flutter application
  flutter --no-version-check build linux --release
}

package() {
  cd "$_pkgname/build/linux/x64/release/bundle/"

  # Create target directories
  install -dm 755 "$pkgdir/opt/$_pkgname" "$pkgdir/usr/bin/"

  # Copy the bundled output to /opt
  cp -rdp --no-preserve=ownership . "$pkgdir/opt/$_pkgname/"

  # Symlink to /usr/bin so the app can be found in PATH
  ln -s "/opt/$_pkgname/miru" "$pkgdir/usr/bin/$_pkgname"
}
Bims-sh commented 7 months ago

Will ofc still have to fix the problems in the mentioned issue

image

peeyush-sharma commented 5 months ago

Okay, partial success!

I was able to get miru-app to "run" on arch partially by:

  1. Installing quickjs pikaur -Sy quickjs-bin
  2. Using the fore-mentioned PKGBUILD

Now the app itself runs fine BUT the extensions won't install. By clicking install they show up as installed, but on navigating away and coming back to the extensions screen they revert to their original state.

Hoping for some success in 2024! Cheers.

Bims-sh commented 5 months ago

I updated my repo with the PKGBUILD to include those dependencies. Can't properly test rn as my arch instance broke (how ironic)

Bims-sh commented 5 months ago

Just tested this,

❯ flutter run --debug
Launching lib/main.dart on Linux in debug mode...
Building Linux application...

(miru:121712): Gdk-CRITICAL **: 08:27:58.620: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
package:media_kit_libs_linux registered.
flutter: ╔══════════════════════════════════════════════════════╗
flutter: ║                 ISAR CONNECT STARTED                                                                                      ║
flutter: ╟──────────────────────────────────────────────────────╢
flutter: ║         Open the link to connect to the Isar                                                                          ║
flutter: ║        Inspector while this build is running.                                                                         ║
flutter: ╟──────────────────────────────────────────────────────╢
flutter: ║ https://inspect.isar.dev/3.1.0+1/#/45405/bMoNFAQow6U                                            ║
flutter: ╚══════════════════════════════════════════════════════╝
flutter: 2
Syncing files to device Linux...
flutter: Miru SEVERE 2024-01-24 08:27:59.137873:  Zone mismatch.
flutter: The Flutter bindings were initialized in a different zone than is now being used. This will likely cause confusion and bugs as any zone-specific configuration will inconsistently use the configuration of the original binding initialization zone or this zone based on hard-to-predict factors such as which zone was active when a particular callback was set.
flutter: It is important to use the same zone when calling `ensureInitialized` on the binding as when calling `runApp` later.
flutter: To make this warning fatal, set BindingBase.debugZoneErrorsAreFatal to true before the bindings are initialized (i.e. as the first statement in `void main() { }`). #0      BindingBase.debugCheckZone.<anonymous closure> (package:flutter/src/foundation/binding.dart:495:29)
flutter: #1      BindingBase.debugCheckZone (package:flutter/src/foundation/binding.dart:500:6)
flutter: #2      runApp (package:flutter/src/widgets/binding.dart:1192:18)
flutter: #3      main.<anonymous closure> (package:miru_app/main.dart:91:25)
flutter: #4      _rootRun (dart:async/zone.dart:1399:13)
flutter: #5      _CustomZone.run (dart:async/zone.dart:1301:19)
flutter: #6      _runZoned (dart:async/zone.dart:1804:10)
flutter: #7      runZonedGuarded (dart:async/zone.dart:1792:12)
flutter: #8      main (package:miru_app/main.dart:91:3)
flutter: <asynchronous suspension>
flutter:
flutter: flutter_i18n INFO 2024-01-24 08:27:59.278480: New locale: en
flutter: flutter_i18n INFO 2024-01-24 08:27:59.279165: The current locale is en
flutter: flutter_i18n INFO 2024-01-24 08:27:59.402717: JSON file loaded for en
flutter: flutter_i18n INFO 2024-01-24 08:27:59.408240: JSON file loaded for en
Syncing files to device Linux...                                   177ms
flutter: flutter_i18n FINE 2024-01-24 08:27:59.410294: Fallback maps have been merged

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on Linux is available at: http://127.0.0.1:45405/bMoNFAQow6U=/
The Flutter DevTools debugger and profiler on Linux is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:45405/bMoNFAQow6U=/
flutter: remoteVersion: 1.8.1
flutter: https://miru-repo.0n0.dev/repo/mangadex.org.js
flutter: extension event: /home/bims/Documents/miru/extensions/mangadex.org.js 1
flutter: extension event: /home/bims/Documents/miru/extensions/mangadex.org.js 2
flutter: extension event: /home/bims/Documents/miru/extensions/mangadex.org.js 2

Additional Notes: I'm running wayland with hyprland (nvidia)

Everything seems to run after instatlling quickjs-bin but like peeyush-sharma already said, you cannot install extensions at all.

Bims-sh commented 2 months ago

Now that https://github.com/miru-project/miru-app/pull/251 has been merged, I will create a package in the following weeks.