Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpaper: remove _NL_PAPER_{WIDTH,HEIGHT} #21510

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions packages/libpaper/0001-disable-NL_PAPER.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/libpaper.c.in.in b/lib/libpaper.c.in.in
index 9294f3f..d6e9f77 100644
--- a/lib/libpaper.c.in.in
+++ b/lib/libpaper.c.in.in
@@ -316,7 +316,7 @@ _GL_ATTRIBUTE_PURE const struct paper *paperwithsize(double pswidth, double pshe

/* Get locale default paper size. */
static const char *localepapername(void) {
-#if defined LC_PAPER && defined _GNU_SOURCE
+#if defined LC_PAPER && defined _GNU_SOURCE && !defined(__ANDROID__)
if (setlocale(LC_PAPER, "") != NULL) {
#define NL_PAPER_GET(x) \
((union { char *string; unsigned word; })nl_langinfo(x)).word
6 changes: 1 addition & 5 deletions packages/libpaper/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Library for handling paper characteristics (by @rrthomas
TERMUX_PKG_LICENSE="LGPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.2.5"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="https://github.com/rrthomas/libpaper/releases/download/v${TERMUX_PKG_VERSION}/libpaper-${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=7be50974ce0df0c74e7587f10b04272cd53fd675cb6a1273ae1cc5c9cc9cab09
TERMUX_PKG_AUTO_UPDATE=true
Expand All @@ -24,11 +25,6 @@ termux_step_post_get_source() {

}

termux_step_pre_configure() {
# 210x297 (in mm) is A4 size. Use as default to be provided by locale.
CFLAGS+=" -D_NL_PAPER_WIDTH=210 -D_NL_PAPER_HEIGHT=297"
}

termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
Expand Down