Browse Source

Dirty patch for gnupg to run on Android 6+, without link()

JNI-44
Edouard Tisserant 7 years ago
parent
commit
786a11c9dd
2 changed files with 40 additions and 1 deletions
  1. +2
    -1
      android/external/Makefile
  2. +38
    -0
      android/external/gnupg_use_rename_for_dotlock.patch

+ 2
- 1
android/external/Makefile View File

@ -12,7 +12,7 @@ NDK_ABI ?= arm
NDK_TOOLCHAIN_VERSION ?= 4.8
APP_ABI ?= armeabi-v7a
APP_PLATFORM ?= android-15
PEP_PACKAGE_NAME ?= com.pep.pepjniaaractivity
PEP_PACKAGE_NAME ?= com.pep.k9
all: build assets
@ -327,6 +327,7 @@ gnupg/configure: gnupg.src.stamp gnupg/configure.ac
gnupg/Makefile: gnupg/configure
-patch -N -p1 --reject-file=- gnupg/gl/stdint_.h gnupg_fix_gmulib_stdint_with_bionic.patch
-patch -N -p1 --reject-file=- gnupg/jnlib/dotlock.c gnupg_use_rename_for_dotlock.patch
cd gnupg && \
CC="$(CC)" AR="$(AR)" RANLIB=$(RANLIB) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
./configure \


+ 38
- 0
android/external/gnupg_use_rename_for_dotlock.patch View File

@ -0,0 +1,38 @@
--- dotlock.c.orig 2015-12-01 01:07:02.212643687 +0100
+++ dotlock.c 2015-12-01 01:07:46.746899721 +0100
@@ -412,7 +412,7 @@
for (;;)
{
#ifndef HAVE_DOSISH_SYSTEM
-# ifndef __riscos__
+# if 0 /*ndef __riscos__
if ( !link(h->tname, h->lockname) )
{
/* fixme: better use stat to check the link count */
@@ -425,7 +425,7 @@
return -1;
}
# else /* __riscos__ */
- if ( !renamefile(h->tname, h->lockname) )
+ if ( !rename(h->tname, h->lockname) )
{
h->locked = 1;
return 0; /* okay */
@@ -562,7 +562,7 @@
return -1;
}
-#ifndef __riscos__
+# if 0 /*ndef __riscos__
if ( unlink( h->lockname ) )
{
log_error ("release_dotlock: error removing lockfile `%s'\n",
@@ -572,7 +572,7 @@
/* Fixme: As an extra check we could check whether the link count is
now really at 1. */
#else /* __riscos__ */
- if ( renamefile (h->lockname, h->tname) )
+ if ( rename (h->lockname, h->tname) )
{
log_error ("release_dotlock: error renaming lockfile `%s' to `%s'\n",
h->lockname, h->tname);

Loading…
Cancel
Save