Github messages for voidlinux
 help / color / mirror / Atom feed
From: ndgnuh <ndgnuh@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] awesome: add build option jit
Date: Fri, 03 Apr 2020 06:58:12 +0200	[thread overview]
Message-ID: <20200403045812.U3bghQf7JJhJ5yWj8gwyN6q0pXQ6AJeH_bUcVinS7mk@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20443@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

There is an updated pull request by ndgnuh against master on the void-packages repository

https://github.com/ndgnuh/void-packages awesome-opt-jit
https://github.com/void-linux/void-packages/pull/20443

awesome: add build option jit
Enables users to build `awesome` with `LuaJIT`.

Change log:
- `lgi`: rename to `lua-lgi`, create alternative group `lgi`
- New package: `lua51-lgi` (dependencies for `awesome` running with `LuaJIT`)
- `./xbps-src pkg awesome -o jit`, this option is disabled by default.

Related/based on this PR: #16137 

A patch file from https://github.com/void-linux/void-packages/pull/20443.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-awesome-opt-jit-20443.patch --]
[-- Type: text/x-diff, Size: 6955 bytes --]

From 35083c01013ac96c76f576b0674f3141eee4d23a Mon Sep 17 00:00:00 2001
From: hung <ndgnuh@protonmail.com>
Date: Fri, 3 Apr 2020 11:56:40 +0700
Subject: [PATCH 1/2] lgi: rename to lua-lgi, add support for lua5.1 and lua5.2

---
 srcpkgs/lgi              |  1 +
 srcpkgs/lgi/template     | 21 -----------
 srcpkgs/lua-lgi/template | 79 ++++++++++++++++++++++++++++++++++++++++
 srcpkgs/lua51-lgi        |  1 +
 srcpkgs/lua52-lgi        |  1 +
 5 files changed, 82 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/lgi
 delete mode 100644 srcpkgs/lgi/template
 create mode 100644 srcpkgs/lua-lgi/template
 create mode 120000 srcpkgs/lua51-lgi
 create mode 120000 srcpkgs/lua52-lgi

diff --git a/srcpkgs/lgi b/srcpkgs/lgi
new file mode 120000
index 00000000000..db68c0a96c3
--- /dev/null
+++ b/srcpkgs/lgi
@@ -0,0 +1 @@
+lua-lgi
\ No newline at end of file
diff --git a/srcpkgs/lgi/template b/srcpkgs/lgi/template
deleted file mode 100644
index 5941e26ea66..00000000000
--- a/srcpkgs/lgi/template
+++ /dev/null
@@ -1,21 +0,0 @@
-# Template file for 'lgi'
-pkgname=lgi
-version=0.9.2
-revision=3
-build_style=gnu-makefile
-make_install_args="LUA_VERSION=5.3"
-hostmakedepends="pkg-config"
-makedepends="libglib-devel libffi-devel lua-devel
- gobject-introspection gir-freedesktop"
-depends="lua gir-freedesktop"
-short_desc="Lua binadings for gnome/gobject using gobject-introspection library"
-maintainer="Orphaned <orphan@voidlinux.org>"
-license="MIT"
-homepage="https://github.com/pavouk/lgi"
-distfiles="https://github.com/pavouk/lgi/archive/$version.tar.gz"
-checksum=cfc4105482b4730b3a40097c9d9e7e35c46df2fb255370bdeb2f45a886548c4f
-
-post_install() {
-	vbin tools/dump-typelib.lua dump-typelib
-	vlicense LICENSE
-}
diff --git a/srcpkgs/lua-lgi/template b/srcpkgs/lua-lgi/template
new file mode 100644
index 00000000000..07ee36c6916
--- /dev/null
+++ b/srcpkgs/lua-lgi/template
@@ -0,0 +1,79 @@
+# Template file for 'lua-lgi'
+pkgname=lua-lgi
+version=0.9.2
+revision=4
+wrksrc="lgi-${version}"
+hostmakedepends="pkg-config"
+makedepends="LuaJIT-devel lua51-devel lua52-devel lua-devel
+ libglib-devel libffi-devel gobject-introspection gir-freedesktop"
+_depends="gir-freedesktop"
+depends="${_depends} lua"
+short_desc="Lua bindings for gnome/gobject using gobject-introspection library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="MIT"
+homepage="https://github.com/pavouk/lgi"
+distfiles="https://github.com/pavouk/lgi/archive/$version.tar.gz"
+checksum=cfc4105482b4730b3a40097c9d9e7e35c46df2fb255370bdeb2f45a886548c4f
+
+_alternatives="
+ lgi:dump-typelib:/usr/bin/dump-typelib__luaver__
+"
+alternatives=${_alternatives/__luaver__/5.3}
+
+post_extract() {
+	mkdir -p lua5.1
+	mv * lua5.1 || true
+	cp -a lua5.1 lua5.2
+	cp -a lua5.1 lua5.3
+}
+
+do_build() {
+	for lv in 5.1 5.2 5.3; do
+		cd ${wrksrc}/lua${lv}
+		make LUA_VERSION="${lv}" \
+			CFLAGS="$CFLAGS -I$XBPS_CROSS_BASE/usr/include/lua${lv}" \
+			LDFLAGS="$LDFLAGS" \
+			${makejobs}
+	done
+}
+
+do_install() {
+	vmkdir usr/bin
+	for luaver in 5.1 5.2 5.3; do
+		cd ${wrksrc}/lua${luaver}
+
+		# fix lua version in shebang
+		vsed -e "s|env lua|env lua${luaver}|" -i tools/dump-typelib.lua
+
+		# dump-typelib must be renamed for the alternative group
+		vcopy tools/dump-typelib.lua usr/bin/dump-typelib$luaver
+		make PREFIX=/usr DESTDIR=$DESTDIR LUA_VERSION=$luaver install
+	done
+	vlicense ${wrksrc}/lua5.3/LICENSE
+}
+
+lgi_package() {
+	build_style="meta"
+	depends="lua-lgi>=${version}_${revision}"
+	short_desc+=" (transitional dummy package)"
+}
+
+_subpackage() {
+	_luaver=$1
+	depends="${_depends} lua${_luaver/\./}"
+	short_desc+=" (Lua ${_luaver})"
+	alternatives="${_alternatives/__luaver__/${_luaver}}"
+	pkg_install() {
+		vmove usr/lib/lua/${_luaver}/lgi/corelgilua51.so
+		vmove usr/bin/dump-typelib${_luaver}
+		vmove usr/share/lua/${_luaver}/lgi
+	}
+}
+
+lua51-lgi_package() {
+	_subpackage 5.1
+}
+
+lua52-lgi_package() {
+	_subpackage 5.2
+}
diff --git a/srcpkgs/lua51-lgi b/srcpkgs/lua51-lgi
new file mode 120000
index 00000000000..d00035eb25d
--- /dev/null
+++ b/srcpkgs/lua51-lgi
@@ -0,0 +1 @@
+lua-lgi/
\ No newline at end of file
diff --git a/srcpkgs/lua52-lgi b/srcpkgs/lua52-lgi
new file mode 120000
index 00000000000..db68c0a96c3
--- /dev/null
+++ b/srcpkgs/lua52-lgi
@@ -0,0 +1 @@
+lua-lgi
\ No newline at end of file

From 10de253ae37fcbc04ff6f98215531c517d3e6f10 Mon Sep 17 00:00:00 2001
From: hung <ndgnuh@protonmail.com>
Date: Fri, 3 Apr 2020 11:57:29 +0700
Subject: [PATCH 2/2] awesome: add build option for building with luajit

---
 srcpkgs/awesome/template | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/awesome/template b/srcpkgs/awesome/template
index 3f559ea1f87..e46e8f3b462 100644
--- a/srcpkgs/awesome/template
+++ b/srcpkgs/awesome/template
@@ -1,17 +1,17 @@
 # Template file for 'awesome'
 pkgname=awesome
 version=4.3
-revision=4
+revision=5
 build_style=cmake
 build_helper="qemu"
 configure_args="-DSYSCONFDIR=/etc"
 conf_files="/etc/xdg/awesome/rc.lua"
-hostmakedepends="ruby-asciidoctor ImageMagick lgi lua pkg-config xmlto"
+hostmakedepends="ruby-asciidoctor ImageMagick pkg-config xmlto"
 makedepends="libxcb-devel pango-devel xcb-util-devel xcb-util-image-devel
  xcb-util-keysyms-devel xcb-util-wm-devel xcb-util-cursor-devel
- startup-notification-devel imlib2-devel lgi libxdg-basedir-devel
- gdk-pixbuf-devel lua-devel dbus-devel libxkbcommon-devel xcb-util-xrm-devel"
-depends="dbus-x11 lgi>=0.7.2 pango"
+ startup-notification-devel imlib2-devel libxdg-basedir-devel
+ gdk-pixbuf-devel dbus-devel libxkbcommon-devel xcb-util-xrm-devel"
+depends="dbus-x11 pango"
 short_desc="Highly configurable, next gen framework window manager for X"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
@@ -19,9 +19,32 @@ homepage="http://awesomewm.org"
 distfiles="https://github.com/awesomeWM/awesome/releases/download/v${version}/awesome-${version}.tar.xz"
 checksum=78264d6f012350b371e339127aca485260bc0aa935eff578ba75ce1a00e11753
 
+build_options="jit"
+desc_option_jit="Use LuaJIT instead of lua"
+
+hostmakedepends+=" $(vopt_if jit 'lua51 LuaJIT lua51-lgi' 'lua lua-lgi')"
+makedepends+=" $(vopt_if jit \
+	'lua51-devel LuaJIT-devel lua51-lgi' \
+	'lua-devel lua-lgi')"
+depends+=" $(vopt_if jit lua51 lua)-lgi>=0.7.2"
+_luaname="$(vopt_if jit luajit lua)"
+
+if [ "$_luaname" = "luajit" ]; then
+	configure_args+="
+		-DLUA_LIBRARY=$XBPS_CROSS_BASE/usr/lib/libluajit-5.1.so
+		-DLUA_INCLUDE_DIR=$XBPS_CROSS_BASE/usr/include/luajit-2.1"
+fi
+
 pre_configure() {
 	# Russian manpages fail to build.
 	vsed -i -e "s|es fr de ru|es fr de|g" CMakeLists.txt
+
+	# Use correct lua name
+	vsed -e "s|COMMAND lua\b|COMMAND ${_luaname}|" \
+		-i awesomeConfig.cmake \
+		-i tests/examples/CMakeLists.txt
+	vsed -e "s|LUA_COV_RUNNER lua\b|LUA_COV_RUNNER ${_luaname}|" \
+		-i tests/examples/CMakeLists.txt
 }
 
 post_install() {

  parent reply	other threads:[~2020-04-03  4:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20443@inbox.vuxu.org>
2020-03-29 20:44 ` q66
2020-03-29 20:51 ` ndgnuh
2020-03-29 22:32 ` q66
2020-03-30  8:55 ` [WIP] " ndgnuh
2020-03-30 14:27 ` q66
2020-03-30 14:28 ` q66
2020-03-30 15:10 ` ndgnuh
2020-03-30 15:14 ` ndgnuh
2020-03-30 15:19 ` ndgnuh
2020-03-30 17:24 ` ndgnuh
2020-04-02 21:25 ` [PR PATCH] [Updated] " pullmoll
2020-04-03  4:58 ` ndgnuh [this message]
2020-04-03  6:35 ` ndgnuh
2020-07-03 14:32 ` [PR PATCH] [Updated] " ndgnuh
2020-07-03 14:34 ` ndgnuh
2020-07-03 15:58 ` [PR PATCH] [Updated] " ndgnuh
2020-07-03 17:03 ` ndgnuh
2020-07-03 17:10 ` q66
2020-07-03 17:13 ` q66
2020-07-03 17:15 ` q66
2020-07-04  1:20 ` ndgnuh
2020-07-04  1:21 ` sgn
2020-07-04  1:25 ` ndgnuh
2020-07-04  2:00 ` q66
2020-07-04  2:34 ` sgn
2020-07-05 15:47 ` ndgnuh
2020-07-05 16:48 ` [PR PATCH] [Updated] " ndgnuh
2020-07-05 16:49 ` ndgnuh
2020-08-17 13:44 ` [PR PATCH] [Closed]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200403045812.U3bghQf7JJhJ5yWj8gwyN6q0pXQ6AJeH_bUcVinS7mk@z \
    --to=ndgnuh@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).