Giter Site home page Giter Site logo

building about foliate HOT 16 CLOSED

rulet avatar rulet commented on September 15, 2024
building

from foliate.

Comments (16)

johnfactotum avatar johnfactotum commented on September 15, 2024

I see you're using Meson 0.37.1. Can you try with a newer version?

The minimum version specified in the build file is 0.40.0. Although it warns about using a 0.50.0 feature and I never got around to see if I need to fix that.

from foliate.

rulet avatar rulet commented on September 15, 2024

With meson 0.49 builds, but something wrong at the end:

r@prime:/foliate-master$ meson build --prefix=$PWD/fakeprefix
The Meson build system
Version: 0.49.0
Source dir: /home/r/foliate-master
Build dir: /home/r/foliate-master/build
Build type: native build
Project name: com.github.johnfactotum.Foliate
Project version: 1.0.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: NO
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Found pkg-config: /usr/bin/pkg-config (0.29)
WARNING: GLib compiled dependencies do not work reliably with
the current version of GLib. See the following upstream issue: https://bugzilla.gnome.org/show_bug.cgi?id=774368
Program gjs found: YES (/usr/bin/gjs)
Configuring com.github.johnfactotum.Foliate using configuration
Program build-aux/meson/postinstall.py found: YES (/home/r/foliate-master/build-aux/meson/postinstall.py)
Build targets in project: 7
Found ninja-1.7.2 at /usr/bin/ninja
r@prime:
/foliate-master$ ninja -C build
ninja: Entering directory build' [3/3] Generating com.github.johnfactotum....ata.xml_data_merge with a custom command. r@prime:~/foliate-master$ ninja -C build install ninja: Entering directory build'
[0/1] Installing files.
Installing subdir /home/r/foliate-master/src/assets to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate/assets
Installing /home/r/foliate-master/src/assets/cheerio.js to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate/assets
Installing /home/r/foliate-master/src/assets/viewer.html to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate/assets
Installing /home/r/foliate-master/src/assets/epub.js to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate/assets
Installing /home/r/foliate-master/src/assets/jszip.min.js to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate/assets
Installing data/com.github.johnfactotum.Foliate.desktop to /home/r/foliate-master/fakeprefix/share/applications
Installing data/com.github.johnfactotum.Foliate.appdata.xml to /home/r/foliate-master/fakeprefix/share/metainfo
Installing src/com.github.johnfactotum.Foliate.src.gresource to /home/r/foliate-master/fakeprefix/share/com.github.johnfactotum.Foliate
Installing /home/r/foliate-master/data/com.github.johnfactotum.Foliate.gschema.xml to /home/r/foliate-master/fakeprefix/share/glib-2.0/schemas
Installing /home/r/foliate-master/data/com.github.johnfactotum.Foliate.svg to /home/r/foliate-master/fakeprefix/share/icons/hicolor/scalable/apps
Installing /home/r/foliate-master/data/com.github.johnfactotum.Foliate-symbolic.svg to /home/r/foliate-master/fakeprefix/share/icons/hicolor/symbolic/apps
Installing /home/r/foliate-master/build/src/com.github.johnfactotum.Foliate to /home/r/foliate-master/fakeprefix/bin
Running custom install script '/usr/bin/meson --internal gettext install --subdir=po --localedir=share/locale --pkgname=com.github.johnfactotum.Foliate'
Installing /home/r/foliate-master/build/po/nl_NL.gmo to /home/r/foliate-master/fakeprefix/share/locale/nl_NL/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
Installing /home/r/foliate-master/build/po/it.gmo to /home/r/foliate-master/fakeprefix/share/locale/it/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
Installing /home/r/foliate-master/build/po/zh_TW.gmo to /home/r/foliate-master/fakeprefix/share/locale/zh_TW/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
Installing /home/r/foliate-master/build/po/ru_RU.gmo to /home/r/foliate-master/fakeprefix/share/locale/ru_RU/LC_MESSAGES/com.github.johnfactotum.Foliate.mo
Running custom install script '/home/r/foliate-master/build-aux/meson/postinstall.py'
Updating icon cache...
Updating desktop database...
Compiling GSettings schemas...
r@prime:~/foliate-master$ GSETTINGS_SCHEMA_DIR=$PWD/fakeprefix/share/glib-2.0/schemas ./fakeprefix/bin/com.github.johnfactotum.Foliate

(com.github.johnfactotum.Foliate:3488): Gjs-CRITICAL **: JS ERROR: SyntaxError: invalid property id @ resource:///com/github/johnfactotum/Foliate/js/main.js:37
JS_EvaluateScript() failed
r@prime:~/foliate-master$

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

This looks like a JS error, though. What version of GJS do you have?

from foliate.

rulet avatar rulet commented on September 15, 2024

That one which is in Debian stretch(stable) 1.46.0-1:
https://packages.debian.org/stretch/gjs

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

I think you'd need at least 1.50.x, although I haven't really tested, as I've been developing against 1.56.

from foliate.

rulet avatar rulet commented on September 15, 2024

I see, so there is no way to test it, in next Debian stable will be gjs 1.54.3-1, and I don't want to broke the system by installing unsupported version.

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

In general, this is developed against the GNOME 3.32 environment. I think stretch is still on 3.22?

Maybe you could try the flatpak version?

from foliate.

rulet avatar rulet commented on September 15, 2024

flatpak package works with some issues(error when opening epub by default application for it), but I don't want to use flatpak.

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

Well, in that case, there's really nothing I can do. The code relies heavily on ES6 features available only in later versions of GJS.

from foliate.

rulet avatar rulet commented on September 15, 2024

Why not to use different language?

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

I suppose I could have, but I didn't. And I'm not going to rewrite the whole thing now.

from foliate.

LoafingBunny avatar LoafingBunny commented on September 15, 2024

Instead of opening a new issue, because the problem is the same:
on ubuntu 18.04 compilation is fine but wont start.

./fakeprefix/bin/com.github.johnfactotum.Foliate 

(com.github.johnfactotum.Foliate:6139): Gjs-CRITICAL **: 13:44:05.136: JS ERROR: SyntaxError: invalid property id @ resource:///com/github/johnfactotum/Foliate/js/main.js:1884
Script ./fakeprefix/bin/com.github.johnfactotum.Foliate threw an exception

Gjs version is 1.52.5-0ubuntu18.04.1

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

Yes, that specific line uses spread in object literals, which is only available in Firefox 55+, which means it's probably only available in GJS 1.53.9+.

The solution would be to either install a newer version of GJS, or possibly transpiling the code with something like Babel. See #45. Of course one could also manually rewrite the code, but I don't think anyone's got time for that.

Why is all this necessary? Well, it's just like newer versions of Meson require newer versions of Python in order to run. It just so happens that GJS isn't as popular as Python, so there's no convenient PPAs one could just use.

I'll add the version info in the readme.

from foliate.

LoafingBunny avatar LoafingBunny commented on September 15, 2024

ok I was able to manually compile the main.js with babel targeting to firefox 52. Now I can open books and foliate works fine.
I don't know how to integrate babel with your code, but for what might worth I write the steps I did:

> cd src
> npm install --save-dev @babel/core @babel/cli @babel/preset-env
# create a file .babelrc with inside:
{
  "presets": [
      ["@babel/preset-env", {
        "targets": {
          "firefox": "52"
        }
      }]
    ]
}

# copy the main
> mv main.js main.src.js
# compile
> npx babel main.src.js --out-file main.js

that's all.

from foliate.

johnfactotum avatar johnfactotum commented on September 15, 2024

Thanks for testing this! This is a good step towards supporting older platforms.

from foliate.

rulet avatar rulet commented on September 15, 2024

Well, I successfully build your program(deb-package) on Debian 10(Gnome). It installs and works. Foliate 1.5.0

from foliate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.