MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

gjs pakage

Open lillolollo opened this issue 5 years ago • 21 comments

Please can you add gjs pakage https://github.com/GNOME/gjs needed by gimp I tried to build it for mingw with no success

lillolollo avatar Aug 09 '19 18:08 lillolollo

@lillolollo show your PKGBUILD and build log

Alexpux avatar Aug 10 '19 10:08 Alexpux

seems to be an problem with a macro

configure.ac:134: error: possibly undefined macro: AC_MSG_WARN If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. I'm building with no flags

lillolollo avatar Aug 10 '19 10:08 lillolollo

@lillolollo at least you try to run autoreconf or autoconf

Alexpux avatar Aug 10 '19 11:08 Alexpux

the problem to build directly gjs on mingw is

xtracting gjs-1.57.4.zip with bsdtar
gjs-1.57.4/README: Can't create 'gjs-1.57.4/README'
bsdtar: Error exit delayed from previous errors.

lillolollo avatar Aug 10 '19 11:08 lillolollo

We have many packages with this error because symlink not supported on windows. So this is not your issue with building

Alexpux avatar Aug 10 '19 11:08 Alexpux

but MINGW_INSTALLS=mingw64 makepkg-mingw -sCLf don't work because this error

lillolollo avatar Aug 10 '19 11:08 lillolollo

Don't we need spidermonkey first?

lazka avatar Aug 10 '19 13:08 lazka

@lillolollo look for example here: https://github.com/msys2/MINGW-packages/blob/2cfdf054df2c826d7c61237ee5ac2453b0f3964d/mingw-w64-lmdbxx/PKGBUILD#L16 https://github.com/msys2/MINGW-packages/blob/2cfdf054df2c826d7c61237ee5ac2453b0f3964d/mingw-w64-lmdbxx/PKGBUILD#L19

how to solve error

Alexpux avatar Aug 10 '19 14:08 Alexpux

@lazka yes he need spidermonkey too

lillolollo avatar Aug 10 '19 21:08 lillolollo

tar -xf ${_realname}-${pkgver}.tar.gz || tar -xf ${_realname}-${pkgver}.tar.gz tar can't find the link file when decompressing for the first time, the second time tar can find it.

smalltalkman avatar Aug 11 '19 11:08 smalltalkman

@smalltalkman @Alexpux Thanks I have resolved the README error

_realname=gjs
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.57.4
pkgrel=1
pkgdesc="GNOME Javascript bindings"
arch=('any')
url="https://gitlab.gnome.org/GNOME/gjs"
license=('MIT and LGPLv2+')
source=("${_realname}-${pkgver}.tar.gz::https://gitlab.gnome.org/GNOME/${_realname}/-/archive/${pkgver}/${_realname}-${pkgver}.tar.gz")
md5sums=('SKIP')
noextract=("${_realname}-${pkgver}.tar.gz")

prepare() {
  tar xf "${_realname}-${pkgver}.tar.gz" --exclude=README
  cd "${srcdir}/${_realname}-${pkgver}"
  ./autogen.sh 
  
}

build() {
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
  mkdir "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}

  ../${_realname}-ng-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \

  make
}

package() {
  cd "${srcdir}"/build-${CARCH}

  make DESTDIR="${pkgdir}"/ install
  install -Dm644 ${srcdir}/${_realname}-ng-${pkgver}/COPYING \
    ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
}

But the AC_MSG_WARN is still here

lillolollo avatar Aug 11 '19 15:08 lillolollo

@lillolollo Before building gjs, you have to build Js60 (part of firefox's javascript runtime)

Salamandar avatar Sep 23 '19 18:09 Salamandar

Also, it has been reported in some places as a syntax error.

This patch fixes it :

diff --git a/configure.ac b/configure.ac
index 1e58000c..518e3aa5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,7 +134,7 @@ AM_CONDITIONAL(ENABLE_CAIRO, test x$have_cairo = xyes)
 AS_IF([test x$have_cairo = xyes], [
   AC_DEFINE([ENABLE_CAIRO],[1],[Define if you want to build with cairo support])
   AX_PKG_CHECK_MODULES([GJS_CAIRO_XLIB], [], [cairo-xlib], [],
-    [AC_MSG_WARN([Cairo-xlib support not found])])
+    AC_MSG_WARN([Cairo-xlib support not found]))
 ], [AS_IF([test "x$with_cairo" = "xyes"],
   [AC_MSG_ERROR([Cairo requested but not found])])])
 
@@ -372,16 +372,16 @@ AC_CONFIG_LINKS([
 AC_OUTPUT
 
 # Warn about conditions that affect runtime
-PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.61.2], [], [
+PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.61.2], [],
     AC_MSG_WARN([You do not have a new enough version of
 gobject-introspection to run the tests. You can still build GJS, but some
-tests will fail.])])
+tests will fail.]))
 
-AS_IF([test "$TESTS_LOCALE" = "C"], [
+AS_IF([test "$TESTS_LOCALE" = "C"],
   AC_MSG_WARN([Your libc does not have the C.UTF-8 locale and no other
 suitable UTF-8 fallback locale could be found. You can still build GJS, but
 some tests will fail.])
-])
+)
 
 TEST_MSG=
 AM_COND_IF([DBUS_TESTS], [TEST_MSG="dbus-run-session"])

Salamandar avatar Sep 23 '19 19:09 Salamandar

Just for information: is spidermonkey and/or gjs like extra-hard to build for Windows?

I just want to know if this is about nobody really trying to make the package (but it might happen) or if this is like a notoriously hell package to make or something like this (the later is what I think I understood from our Windows packager).

So that I know if we should just not expect having support for JS scripts on Windows anytime soon. Thanks! :-)

Jehan avatar Jan 30 '22 16:01 Jehan

Firefox developers are doing something about that https://github.com/msys2/MINGW-packages/discussions/10526

Biswa96 avatar Jan 30 '22 16:01 Biswa96

Nice. Thanks @Biswa96. Hopefully we'll see this happen at some point in the near future. :-)

Jehan avatar Jan 30 '22 16:01 Jehan

@Biswa96 @Jehan In this case the good news would be that mozilla ship a separate package for spidermonkey. It is worth to install firefox (~100M) to use gjs to use (maybe) gimp js scripts?

lillolollo avatar Feb 09 '22 08:02 lillolollo

This is the archlinux PKGBUILD https://github.com/archlinux/svntogit-packages/blob/packages/js78/trunk/PKGBUILD for the js engine

lillolollo avatar Feb 09 '22 08:02 lillolollo

@lillolollo I don't see a MSYS2 package for firefox. Unless you mean the official Firefox installer?

In any case, no, we are not going to make Firefox a dependency of GIMP. 🤣

Jehan avatar Feb 09 '22 12:02 Jehan

@Jehan seems now firefox can be build with MSYS2 https://bugzilla.mozilla.org/show_bug.cgi?id=1725895 https://wiki.mozilla.org/MozillaBuild this is the new SpiderMonkey pakage https://github.com/archlinux/svntogit-packages/blob/master/js91/trunk/PKGBUILD but I haven't the required skills to do it maybe @lazka @Biswa96 or @mitchhentges can help

lillolollo avatar Jun 27 '22 13:06 lillolollo

We'd be thrilled to have gjs under Windows for Javascript plug-ins support. I won't be doing it, this is for sure. But I'd welcome the package coming in. 👍

Jehan avatar Jun 27 '22 19:06 Jehan