[vlc-devel] [PATCH] contrib/gpg-error: simplify darwin triplet handling

Marvin Scholz epirat07 at gmail.com
Thu Mar 26 09:23:15 CET 2020


I am not sure how upstream development process works, so
no idea where to submit this for upstream.

(Or even where to find a Git repo for upstream…)

On 21 Mar 2020, at 18:44, Alexandre Janniaux wrote:

> Hi,
>
> LGTM, it's much nicer indeed. Can this be upstreamed?
>
> Regards,
> --
> Alexandre Janniaux
> Videolabs
>
> On Wed, Mar 18, 2020 at 04:52:29PM +0100, Marvin Scholz wrote:
>> Instead of copying the header files around, change the triplet
>> canonicalization function to correctly remove version numbers for
>> darwin triplets.
>> ---
>>  contrib/src/gpg-error/darwin-triplet.patch | 25 
>> ++++++++++++++++++++++
>>  contrib/src/gpg-error/rules.mak            | 24 
>> +--------------------
>>  2 files changed, 26 insertions(+), 23 deletions(-)
>>  create mode 100644 contrib/src/gpg-error/darwin-triplet.patch
>>
>> diff --git a/contrib/src/gpg-error/darwin-triplet.patch 
>> b/contrib/src/gpg-error/darwin-triplet.patch
>> new file mode 100644
>> index 0000000000..dd0fef95de
>> --- /dev/null
>> +++ b/contrib/src/gpg-error/darwin-triplet.patch
>> @@ -0,0 +1,25 @@
>> +--- libgpg-error-1.27_orig/src/mkheader.c	2017-02-28 
>> 13:32:33.000000000 +0100
>> ++++ libgpg-error-1.27/src/mkheader.c	2020-01-23 11:36:50.000000000 
>> +0100
>> +@@ -107,7 +107,21 @@
>> +           return xstrdup (lastalias);
>> +         }
>> +     }
>> +-  return xstrdup (triplet);
>> ++  /* Darwin triplet de-versioning */
>> ++  char *res_triplet = xstrdup (triplet);
>> ++
>> ++  char *triplet_last = strrchr(res_triplet, '-');
>> ++  if (triplet_last == NULL) {
>> ++    fprintf (stderr, PGM ": unexpected host triplet missing any 
>> separator: '%s'",
>> ++               res_triplet);
>> ++    exit (1);
>> ++  }
>> ++  triplet_last++; /* Advance past the dash */
>> ++  if (strncmp("darwin", triplet_last, 6) == 0) {
>> ++    triplet_last[6] = '\0';
>> ++  }
>> ++
>> ++  return res_triplet;
>> + }
>> +
>> +
>> diff --git a/contrib/src/gpg-error/rules.mak 
>> b/contrib/src/gpg-error/rules.mak
>> index e045c8ea48..a22c778632 100644
>> --- a/contrib/src/gpg-error/rules.mak
>> +++ b/contrib/src/gpg-error/rules.mak
>> @@ -24,6 +24,7 @@ endif
>>  	$(APPLY) $(SRC)/gpg-error/win32-unicode.patch
>>  	$(APPLY) $(SRC)/gpg-error/version-bump-gawk-5.patch
>>  	$(APPLY) $(SRC)/gpg-error/win32-extern-struct.patch
>> +	$(APPLY) $(SRC)/gpg-error/darwin-triplet.patch
>>  	$(MOVE)
>>  ifdef HAVE_ANDROID
>>  ifeq ($(ARCH),aarch64)
>> @@ -33,29 +34,6 @@ else
>>  	cp $@/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h 
>> $@/src/syscfg/lock-obj-pub.linux-android.h
>>  endif
>>  endif
>> -ifdef HAVE_DARWIN_OS
>> -ifdef HAVE_ARMV7A
>> -ifneq ($(HOST),arm-apple-darwin)
>> -	cp $@/src/syscfg/lock-obj-pub.arm-apple-darwin.h 
>> $@/src/syscfg/lock-obj-pub.$(HOST).h
>> -endif
>> -else
>> -ifeq ($(ARCH),aarch64)
>> -ifneq ($(HOST),aarch64-apple-darwin)
>> -	cp $@/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h 
>> $@/src/syscfg/lock-obj-pub.$(HOST).h
>> -endif
>> -else
>> -ifeq ($(ARCH),x86_64)
>> -ifneq ($(HOST),x86_64-apple-darwin)
>> -	cp $@/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h 
>> $@/src/syscfg/lock-obj-pub.$(HOST).h
>> -endif
>> -else
>> -ifneq ($(HOST),i386-apple-darwin)
>> -	cp $@/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h 
>> $@/src/syscfg/lock-obj-pub.$(HOST).h
>> -endif
>> -endif
>> -endif
>> -endif
>> -endif
>>  ifdef HAVE_NACL
>>  ifeq ($(ARCH),i386) # 32bits intel
>>  	cp $@/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h 
>> $@/src/syscfg/lock-obj-pub.nacl.h
>> --
>> 2.21.1 (Apple Git-122.3)
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list