Closed AS400JPLPC closed 3 years ago
Thanks @AS400JPLPC, can you please explain the reason for change? how it differs from existing one? or how existing one wasn't suitable enough for your use case?
Thanks @AS400JPLPC, can you please explain the reason for change? how it differs from existing one? or how existing one wasn't suitable enough for your use case?
mahefile
it is necessary to say where it finds the source and the lib to make the links
ifeq ($(UNAME), Linux)
CFLAGS = -DWEBVIEW_GTK=1 pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0
endif
if you want to make a link -L you have to give it a lib ifeq ($(UNAME), Linux) ar rcs ext/libwebview.a ext/webview.o endif
libs.cr
on linux we don't know -lc ++ on linux an object is not a lib -lwebview.o
{% elsif flag?(:linux) %} @[Link(ldflags: "#{DIR}/../ext/libwebview.a -lstdc++")] @[Link(ldflags: "`command -v pkg-config > /d
@bientôt
it is necessary to say where it finds the source and the lib to make the links
And existing version isn't doing that? Aren't you able to use this shard on your linux box? I've developed this shard on Mac and tested on Linux and Windows.
Also the linking libraries is done in lib.cr
via @[Link]
annotation instead of make file. Makefile is solely used to compile the c source to object file and that object file is in turn linked to crystal compiled binary.
It should be better if you can provide the problem you were experiencing, which made you to this solution. Then we can discuss the solution pros and cons.
[soleil@HPZ800 ~]$ cd /home/soleil/cryweb/
[soleil@HPZ800 cryweb]$ shards install
Resolving dependencies
Fetching https://github.com/naqvis/webview.git
Installing webview (0.1.1)
Postinstall of webview: make
Failed postinstall of webview on make:
g++ -c -o ext/webview.o -DWEBVIEW_GTK=1 -std=c++11 ext/webview.cc
Dans le fichier inclus depuis ext/webview.cc:2:
ext/webview.h:418:10: erreur fatale: JavaScriptCore/JavaScript.h : Aucun fichier ou dossier de ce type
418 | #include <JavaScriptCore/JavaScript.h>
| ^~~~~~~~~
compilation terminée.
make: *** [Makefile:19 : ext/webview.o] Erreur 1
[soleil@HPZ800 cryweb]$
/usr/include/webkitgtk-4.0/JavaScriptCore /usr/lib/libjavascriptcoregtk-4.0.so /usr/lib/libjavascriptcoregtk-4.0.so.18 /usr/lib/libjavascriptcoregtk-4.0.so.18.17.11 /usr/lib/girepository-1.0/JavaScriptCore-4.0.typelib /usr/lib/pkgconfig/javascriptcoregtk-4.0.pc /usr/share/gir-1.0/JavaScriptCore-4.0.gir
/usr/include/webkitgtk-4.0/JavaScriptCore/JavaScript.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSBase.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSContextRef.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSObjectRef.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSStringRef.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSTypedArray.h /usr/include/webkitgtk-4.0/JavaScriptCore/JSValueRef.h /usr/include/webkitgtk-4.0/JavaScriptCore/WebKitAvailability.h
Thank you @AS400JPLPC . I've make your proposed changes and tested it on Linux.
I made changes to the file to fork AS400JPLPC
src / lib.cr
Makfile and src/lib.cr I requested modifications to the original for me it's OK what is not tested is for mac