这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/lua-lgi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Dynamic Lua binding to GObject libraries using GObject-I
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.9.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/lgi-devs/lgi/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=cfc4105482b4730b3a40097c9d9e7e35c46df2fb255370bdeb2f45a886548c4f
TERMUX_PKG_AUTO_UPDATE=true
Expand Down
30 changes: 30 additions & 0 deletions packages/lua-lgi/glib-2.86.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Mon, 22 Sep 2025 00:32:48 +0200
Subject: [PATCH] Use TypeClass.get instead of .ref

`ref` became unintrospectable in GLib 2.86.
---
lgi/ffi.lua | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lgi/ffi.lua b/lgi/ffi.lua
index 10426325b265..617db8e815fc 100644
--- a/lgi/ffi.lua
+++ b/lgi/ffi.lua
@@ -80,14 +80,13 @@ function ffi.load_enum(gtype, name)
local is_flags = GObject.Type.is_a(gtype, GObject.Type.FLAGS)
local enum_component = component.create(
gtype, is_flags and enum.bitflags_mt or enum.enum_mt, name)
- local type_class = GObject.TypeClass.ref(gtype)
+ local type_class = GObject.TypeClass.get(gtype)
local enum_class = core.record.cast(
type_class, is_flags and GObject.FlagsClass or GObject.EnumClass)
for i = 0, enum_class.n_values - 1 do
local val = core.record.fromarray(enum_class.values, i)
enum_component[core.upcase(val.value_nick):gsub('%-', '_')] = val.value
end
- type_class:unref()
return enum_component
end

11 changes: 0 additions & 11 deletions x11-packages/awesome/awesomeConfig.cmake.patch

This file was deleted.

173 changes: 146 additions & 27 deletions x11-packages/awesome/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ TERMUX_PKG_DESCRIPTION="A highly configurable, next generation framework window
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
# Latest release version 4.3 does not support Lua 5.4.
_COMMIT=b54e50ad6cfdcd864a21970b31378f7c64adf3f4
TERMUX_PKG_VERSION=2023.01.16
TERMUX_PKG_REVISION=2
_COMMIT=f009815cb75139acf4d8ba3c1090bf2844d13f4c
TERMUX_PKG_VERSION=2025.05.17
TERMUX_PKG_SRCURL=git+https://github.com/awesomeWM/awesome
TERMUX_PKG_SHA256=ce0f4ef9105adf1ca04536d60b31dc3aa04cb45e3b1459a63043c34484842ace
TERMUX_PKG_SHA256=d56f6ab4e9d820504509599279904b17e4bd2b4a37edab1adb43b3ecabd70893
TERMUX_PKG_GIT_BRANCH=master
TERMUX_PKG_DEPENDS="dbus, gdk-pixbuf, glib, libcairo, liblua54, libx11, libxcb, libxdg-basedir, libxkbcommon, lua-lgi, pango, startup-notification, xcb-util, xcb-util-cursor, xcb-util-keysyms, xcb-util-wm, xcb-util-xrm"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
Expand All @@ -33,31 +32,151 @@ termux_step_post_get_source() {
fi
}

# Function to obtain the .deb URL
obtain_deb_url() {
local url attempt retries wait PAGE deb_url
url="https://packages.ubuntu.com/noble/amd64/$1/download"
retries=50
wait=50
>&2 echo "url: $url"
for ((attempt=1; attempt<=retries; attempt++)); do
PAGE="$(curl -s "$url")"
deb_url="$(grep -oE 'https?://.*\.deb' <<< "$PAGE" | head -n1)"
if [[ -n "$deb_url" ]]; then
echo "$deb_url"
return 0
else
>&2 echo "Attempt $attempt: Failed to obtain deb URL. Retrying in $wait seconds..."
fi
sleep "$wait"
done
termux_error_exit "Failed to obtain URL after $retries attempts."
}

_install_ubuntu_packages() {
# install Ubuntu packages, like in the aosp-libs build.sh
export HOSTBUILD_ROOTFS="${TERMUX_PKG_HOSTBUILD_DIR}/ubuntu_packages"
mkdir -p "${HOSTBUILD_ROOTFS}"
local URL DEB_NAME DEB_LIST
DEB_LIST="$@"
for i in $DEB_LIST; do
echo "deb: $i"
URL="$(obtain_deb_url "$i")"
DEB_NAME="${URL##*/}"
termux_download "$URL" "${TERMUX_PKG_CACHEDIR}/${DEB_NAME}" SKIP_CHECKSUM
mkdir -p "${TERMUX_PKG_TMPDIR}/${DEB_NAME}"
ar x "${TERMUX_PKG_CACHEDIR}/${DEB_NAME}" --output="${TERMUX_PKG_TMPDIR}/${DEB_NAME}"
tar xf "${TERMUX_PKG_TMPDIR}/${DEB_NAME}"/data.tar.* \
-C "${HOSTBUILD_ROOTFS}"
done
find "${HOSTBUILD_ROOTFS}" -type f -name '*.pc' | \
xargs -n 1 sed -i -e "s|/usr|${HOSTBUILD_ROOTFS}/usr|g"
find "${HOSTBUILD_ROOTFS}/usr/lib/x86_64-linux-gnu" -xtype l \
-exec sh -c "ln -snvf /usr/lib/x86_64-linux-gnu/\$(readlink \$1) \$1" sh {} \;
ln -sf convert-im6.q16 "${HOSTBUILD_ROOTFS}/usr/bin/convert"
}

_load_ubuntu_packages() {
local hostbuild_lua_version="$(echo 'print(_VERSION)' | lua - | cut -d' ' -f2)"
export HOSTBUILD_ROOTFS="${TERMUX_PKG_HOSTBUILD_DIR}/ubuntu_packages"
export LD_LIBRARY_PATH="${HOSTBUILD_ROOTFS}/usr/lib/x86_64-linux-gnu"
LD_LIBRARY_PATH+=":${HOSTBUILD_ROOTFS}/usr/lib"
export LUA_PATH="${HOSTBUILD_ROOTFS}/usr/share/lua/$hostbuild_lua_version/?.lua;${TERMUX_PKG_SRCDIR}/?.lua"
export LUA_CPATH="${HOSTBUILD_ROOTFS}/usr/lib/x86_64-linux-gnu/lua/$hostbuild_lua_version/?.so"
export PATH="${HOSTBUILD_ROOTFS}/usr/bin:$PATH"
local hostbuild_imagemagick_version="$(convert --version | head -n1 | cut -d' ' -f3 | cut -d'-' -f1)"
export MAGICK_CODER_MODULE_PATH="${HOSTBUILD_ROOTFS}/usr/lib/x86_64-linux-gnu/ImageMagick-$hostbuild_imagemagick_version/modules-Q16/coders"
}

termux_step_host_build() {
local prefix="$TERMUX_PKG_HOSTBUILD_DIR/_prefix"

local IMAGEMAGICK_BUILD_SH=$TERMUX_SCRIPTDIR/packages/imagemagick/build.sh
local IMAGEMAGICK_SRCURL=$(bash -c ". $IMAGEMAGICK_BUILD_SH; echo \$TERMUX_PKG_SRCURL")
local IMAGEMAGICK_SHA256=$(bash -c ". $IMAGEMAGICK_BUILD_SH; echo \$TERMUX_PKG_SHA256")
local IMAGEMAGICK_TARFILE=$TERMUX_PKG_CACHEDIR/$(basename $IMAGEMAGICK_SRCURL)
termux_download $IMAGEMAGICK_SRCURL $IMAGEMAGICK_TARFILE $IMAGEMAGICK_SHA256
mkdir -p imagemagick
cd imagemagick
tar xf $IMAGEMAGICK_TARFILE --strip-components=1
./configure --prefix="$prefix" --with-png
make -j $TERMUX_PKG_MAKE_PROCESSES
make install
if [[ "$TERMUX_ON_DEVICE_BUILD" == "true" ]]; then
return
fi

local hostbuild_lua_version="$(echo 'print(_VERSION)' | lua - | cut -d' ' -f2)"
_install_ubuntu_packages lua-lgi \
lua-any \
lua-expat \
lua-filesystem \
lua-ldoc \
lua-penlight \
imagemagick \
imagemagick-6-common \
imagemagick-6.q16 \
libaom3 libde265-0 \
libdjvulibre-text \
libdjvulibre21 \
libfftw3-double3 \
libheif-plugin-aomdec \
libheif-plugin-aomenc \
libheif-plugin-libde265 \
libheif1 \
libjxr-tools \
libjxr0t64 \
liblqr-1-0 \
libmagickcore-6.q16-7-extra \
libmagickcore-6.q16-7t64 \
libmagickwand-6.q16-7t64 \
libwmflite-0.2-7 \
liblua"$hostbuild_lua_version"-0 \
liblua"$hostbuild_lua_version"-dev \
libstartup-notification0 \
libstartup-notification0-dev \
libx11-xcb-dev \
libxcb-cursor-dev \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-icccm4-dev \
libxcb-image0 \
libxcb-image0-dev \
libxcb-keysyms1 \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0 \
libxcb-render-util0-dev \
libxcb-shape0 \
libxcb-shape0-dev \
libxcb-util-dev \
libxcb-util0-dev \
libxcb-util1 \
libxcb-xinerama0 \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxcb-xkb1 \
libxcb-xrm-dev \
libxcb-xrm0 \
libxcb-xtest0 \
libxcb-xtest0-dev \
libxdg-basedir-dev \
libxdg-basedir1 \
libxkbcommon-x11-0 \
libxkbcommon-x11-dev \
libxcb-shape0 \
libxcb-shape0-dev \
libxcb-xfixes0-dev
_load_ubuntu_packages

termux_setup_cmake
termux_setup_ninja

export PKG_CONFIG_PATH="${HOSTBUILD_ROOTFS}/usr/lib/x86_64-linux-gnu/pkgconfig"
export CFLAGS="-I${HOSTBUILD_ROOTFS}/usr/include/x86_64-linux-gnu"
CFLAGS+=" -I/usr/include/xcb"
cmake \
-G Ninja \
-S ${TERMUX_PKG_SRCDIR} \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_PREFIX_PATH="${HOSTBUILD_ROOTFS}/usr" \
-DCMAKE_INSTALL_PREFIX="${HOSTBUILD_ROOTFS}/usr"
ninja \
-j ${TERMUX_PKG_MAKE_PROCESSES} \
install
unset PKG_CONFIG_PATH CFLAGS
}

termux_step_pre_configure() {
export PATH="$TERMUX_PKG_HOSTBUILD_DIR/_prefix/bin:$PATH"

local bin="$TERMUX_PKG_BUILDDIR/_bin"
mkdir -p "$bin"
sed -e "s|@PREGEN_DIR@|$TERMUX_PKG_BUILDER_DIR/pregen|g" \
"$TERMUX_PKG_BUILDER_DIR/lua-wrapper.in" > "$bin/lua"
chmod 0700 "$bin/lua"
touch "$bin/lgi-check"
chmod 0700 "$bin/lgi-check"
export PATH="$bin:$PATH"
if [[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]]; then
_load_ubuntu_packages
export PATH="$TERMUX_PKG_HOSTBUILD_DIR:$PATH"
fi
}
150 changes: 150 additions & 0 deletions x11-packages/awesome/glib-2.86.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
From 5ae48086fbc87cc7086e9da43bfc1e3407214e5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Sat, 17 May 2025 20:32:58 +0200
Subject: [PATCH 1/2] lib, tests: use GioUnix to use platform-specific Gio
classes

In newest glib GioUnix symbols are not anymore exposed in GioUnix,
while lua-lgi should handle the change transparently, it's better to
adapt awesome to just use the right namespace.
---
lib/awful/spawn.lua | 5 +++--
tests/_client.lua | 11 ++++++-----
tests/test-spawn.lua | 8 ++++----
3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/lib/awful/spawn.lua b/lib/awful/spawn.lua
index 7d3e945087..8eb7847627 100644
--- a/lib/awful/spawn.lua
+++ b/lib/awful/spawn.lua
@@ -225,6 +225,7 @@ local capi =
}
local lgi = require("lgi")
local Gio = lgi.Gio
+local GioUnix = lgi.GioUnix
local GLib = lgi.GLib
local util = require("awful.util")
local gtable = require("gears.table")
@@ -418,11 +419,11 @@ function spawn.with_line_callback(cmd, callbacks)
end
end
if have_stdout then
- spawn.read_lines(Gio.UnixInputStream.new(stdout, true),
+ spawn.read_lines(GioUnix.InputStream.new(stdout, true),
stdout_callback, step_done, true)
end
if have_stderr then
- spawn.read_lines(Gio.UnixInputStream.new(stderr, true),
+ spawn.read_lines(GioUnix.InputStream.new(stderr, true),
stderr_callback, step_done, true)
end
assert(stdin == nil)
diff --git a/tests/_client.lua b/tests/_client.lua
index 3eb015f312..d45786bb28 100644
--- a/tests/_client.lua
+++ b/tests/_client.lua
@@ -16,6 +16,7 @@ local GLib = lgi.require('GLib')
local Gdk = lgi.require('Gdk')
local Gtk = lgi.require('Gtk', '3.0')
local Gio = lgi.require('Gio')
+local GioUnix = lgi.require('GioUnix')
Gtk.init()

local function open_window(class, title, options)
@@ -88,7 +89,7 @@ end)
coro()

-- Read lines from stdin and feed them to the coroutine
-local stdin = Gio.UnixInputStream.new(0, false)
+local stdin = GioUnix.InputStream.new(0, false)
stdin = Gio.DataInputStream.new(stdin)

local read_start, read_finish
@@ -116,7 +117,7 @@ Gtk:main{...}
]]

local lgi = require("lgi")
-local Gio = lgi.require("Gio")
+local GioUnix = lgi.require("GioUnix")

local initialized = false
local pipe, pid
@@ -126,10 +127,10 @@ local function init()
initialized = true
local cmd = { lua_executable, "-e", test_client_source }
local _pid, _, stdin, stdout, stderr = awesome.spawn(cmd, false, true, true, true)
- pipe = Gio.UnixOutputStream.new(stdin, true)
+ pipe = GioUnix.OutputStream.new(stdin, true)
pid = _pid
- stdout = Gio.UnixInputStream.new(stdout, true)
- stderr = Gio.UnixInputStream.new(stderr, true)
+ stdout = GioUnix.InputStream.new(stdout, true)
+ stderr = GioUnix.InputStream.new(stderr, true)
spawn.read_lines(stdout, function(...) print("_client", ...) end)
spawn.read_lines(stderr, function(...) print("_client", ...) end)
end
diff --git a/tests/test-spawn.lua b/tests/test-spawn.lua
index dfc3cc5f8d..a24a94238a 100644
--- a/tests/test-spawn.lua
+++ b/tests/test-spawn.lua
@@ -109,7 +109,7 @@ local steps = {
local pid, _, _, stdout = awesome.spawn({ "sh", "-c", "echo $AWESOME_SPAWN_TEST_VAR $HOME $USER" },
false, false, true, false, nil, { "AWESOME_SPAWN_TEST_VAR=42" })
assert(type(pid) ~= "string", pid)
- spawn.read_lines(require("lgi").Gio.UnixInputStream.new(stdout, true),
+ spawn.read_lines(require("lgi").GioUnix.InputStream.new(stdout, true),
function(line)
assert(not read_line)
read_line = true
@@ -171,7 +171,7 @@ local steps = {
false, false, true, "DEV_NULL")
assert(type(pid) ~= "string", pid)
assert(stderr == nil)
- spawn.read_lines(require("lgi").Gio.UnixInputStream.new(stdout, true),
+ spawn.read_lines(require("lgi").GioUnix.InputStream.new(stdout, true),
function(line)
assert(not read_line)
read_line = true
@@ -189,7 +189,7 @@ local steps = {
false, "INHERIT", true, false)
assert(type(pid) ~= "string", pid)
assert(stdin == nil)
- spawn.read_lines(require("lgi").Gio.UnixInputStream.new(stdout, true),
+ spawn.read_lines(require("lgi").GioUnix.InputStream.new(stdout, true),
function(line)
assert(not read_line)
read_line = true
@@ -215,7 +215,7 @@ local steps = {
assert(stdin ~= nil)
assert(stdout ~= nil)
assert(stderr ~= nil)
- spawn.read_lines(require("lgi").Gio.UnixInputStream.new(stdout, true),
+ spawn.read_lines(require("lgi").GioUnix.InputStream.new(stdout, true),
function(line)
assert(not read_line)
read_line = true

From 80b7fa8262495e331da3c98a48adf94a5a806fef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Sat, 13 Sep 2025 02:13:01 +0200
Subject: [PATCH 2/2] awesomeConfig: Bump dependency on GLib 2.79.2

This is the version that provided GioUnix symbols, so we need to depend
on that
---
awesomeConfig.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake
index 592c2b2526..b27baa456c 100644
--- a/awesomeConfig.cmake
+++ b/awesomeConfig.cmake
@@ -132,7 +132,7 @@ pkg_check_modules(AWESOME_COMMON_REQUIRED REQUIRED

set(AWESOME_DEPENDENCIES
glib-2.0
- glib-2.0>=2.40
+ glib-2.0>=2.79.2
gdk-pixbuf-2.0
cairo
x11
Loading