Skip to content

Commit

Permalink
addpkg(x11/meld): 3.22.2
Browse files Browse the repository at this point in the history
Closes termux#18900

(that bug was described as "with the general intention of running meld", and this is a newer way and a newer version of meld than that)
  • Loading branch information
robertkirkman committed Jan 4, 2025
1 parent f5adac3 commit 5755557
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
65 changes: 65 additions & 0 deletions x11-packages/meld/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
TERMUX_PKG_HOMEPAGE=https://meldmerge.org/
TERMUX_PKG_DESCRIPTION="A visual diff and merge tool targeted at developers"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3.22.2"
TERMUX_PKG_SRCURL=https://download.gnome.org/sources/meld/${TERMUX_PKG_VERSION%.*}/meld-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=46a0a713fbcd1b153b377a1e0757c8ce255c9822467658eacfbd89b1e92316ef
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="gsettings-desktop-schemas, glib, gtk3, gtksourceview4, libcairo, pango, pycairo, pygobject, python"
TERMUX_PKG_BUILD_DEPENDS="gettext"
# build dependency only
TERMUX_PKG_PYTHON_TARGET_DEPS="itstool"
TERMUX_PKG_SETUP_PYTHON=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
# The "byte-compile" build setting will go away in the next release
# It does not actually turn off byte compiling because Termux has recent Meson
# (https://gitlab.gnome.org/GNOME/meld/-/commit/361ac82ce94dd46d0eed0e9239c34a8e3d13cd2e)
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-Dbyte-compile=false
"
termux_step_pre_configure() {
termux_setup_glib_cross_pkg_config_wrapper

if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
local _bin="$TERMUX_PKG_BUILDDIR/_bin"
export ITSTOOL="${_bin}/itstool"
rm -rf "${_bin}"
mkdir -p "${_bin}"
cat > "$ITSTOOL" <<-EOF
#!$(command -v sh)
unset PYTHONPATH
exec $(command -v itstool) "\$@"
EOF
chmod 0700 "$ITSTOOL"
fi
}

termux_step_configure_meson() {
termux_setup_meson
# this is an addition that will probably also have to be made to the orca package
# the next time that the orca package is bumped,
# because of orca's migration from autotools to meson, like meld
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
sed -i 's|^\(\[binaries\]\)$|\1\nitstool = '\'$ITSTOOL\''|g' \
$TERMUX_MESON_CROSSFILE
fi

local _meson_buildtype="minsize"
local _meson_stripflag="--strip"
if [ "$TERMUX_DEBUG_BUILD" = "true" ]; then
_meson_buildtype="debug"
_meson_stripflag=
fi


CC=gcc CXX=g++ CFLAGS= CXXFLAGS= CPPFLAGS= LDFLAGS= $TERMUX_MESON \
$TERMUX_PKG_SRCDIR \
$TERMUX_PKG_BUILDDIR \
--cross-file $TERMUX_MESON_CROSSFILE \
--prefix $TERMUX_PREFIX \
--libdir lib \
--buildtype ${_meson_buildtype} \
${_meson_stripflag} \
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
}
11 changes: 11 additions & 0 deletions x11-packages/meld/handle-bindtextdomain-oserror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/bin/meld
+++ b/bin/meld
@@ -141,7 +141,7 @@ try:
locale.bindtextdomain(locale_domain, str(locale_dir))
locale.bind_textdomain_codeset(locale_domain, 'UTF-8')
locale.textdomain(locale_domain)
-except AttributeError as e:
+except (AttributeError,OSError) as e:
# Python builds linked without libintl (i.e., OSX) don't have
# bindtextdomain(), which causes Gtk.Builder translations to fail.
print(

0 comments on commit 5755557

Please sign in to comment.