Bug 226853

Summary: archivers/libarchive: fix build with libressl-devel
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Greg Lewis <glewis>
Status: Closed FIXED    
Severity: Affects Only Me CC: brnrd, pkubaj, vishwin
Priority: --- Flags: bugzilla: maintainer-feedback? (glewis)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/libarchive/libarchive/pull/1005
Bug Depends on:    
Bug Blocks: 226843    
Attachments:
Description Flags
patch
none
patch none

Description Piotr Kubaj freebsd_committer freebsd_triage 2018-03-22 19:54:25 UTC
Created attachment 191742 [details]
patch

LibreSSL 2.7 changes API, which breaks build.

This patch fixes it. Verified against LibreSSL 2.6, 2.7 and base OpenSSL.
Comment 1 Charlie Li freebsd_committer freebsd_triage 2018-03-25 06:04:16 UTC
The attached patch-libarchive-archive_openssl_evp_private.h (the first patch) does not apply, because it looks like you ran make makepatch after applying the old version of this patch:

--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)

This results in patch trying to find the macro looking for either the OpenSSL version less than 1.1 or any LibreSSL version, which does not appear in the original unpatched source.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2018-03-25 06:59:16 UTC
Created attachment 191797 [details]
patch

Sorry, this one should apply.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-03-27 07:07:54 UTC
A commit references this bug:

Author: glewis
Date: Tue Mar 27 07:07:17 UTC 2018
New revision: 465666
URL: https://svnweb.freebsd.org/changeset/ports/465666

Log:
  . Fix the build with libressl-devel

  PR:		226853
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl>

Changes:
  head/archivers/libarchive/files/patch-libarchive-archive_openssl_evp_private.h
  head/archivers/libarchive/files/patch-libarchive_openssl_hmac_private.h
Comment 4 Greg Lewis freebsd_committer freebsd_triage 2018-03-27 07:08:39 UTC
Patch committed.  Thanks!
Comment 5 Bernard Spil freebsd_committer freebsd_triage 2018-04-02 17:51:52 UTC
For reference, add upstream pull-request
https://github.com/libarchive/libarchive/pull/1005