Patchwork [02/16] openssl: add override for darwin

login
register
mail settings
Submitter Yann Diorcet
Date Oct. 21, 2012, 3:37 p.m.
Message ID <1350833876-9499-2-git-send-email-diorcet.yann@gmail.com>
Download mbox | patch
Permalink /patch/193026/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Yann Diorcet - Oct. 21, 2012, 3:37 p.m.
From: Yann Diorcet <yann.diorcet@belledonne-communications.com>

Make it works on darwin
---
 recipes/openssl/openssl.inc |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
Esben Haabendal - Feb. 28, 2013, 1:12 p.m.
Yann Diorcet <diorcet.yann@gmail.com> writes:

> From: Yann Diorcet <yann.diorcet@belledonne-communications.com>
>
> Make it works on darwin
> ---
>  recipes/openssl/openssl.inc |   16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/recipes/openssl/openssl.inc b/recipes/openssl/openssl.inc
> index 66c243d..7bfcf5b 100644
> --- a/recipes/openssl/openssl.inc
> +++ b/recipes/openssl/openssl.inc
> @@ -10,9 +10,9 @@ inherit c make pkgconfig
>  
>  SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz"
>  
> -DEPENDS = "${DEPENDS_HOST_OS}"
> -DEPENDS_HOST_OS = "libdl"
> -DEPENDS_HOST_OS:HOST_OS_mingw32 = ""
> +DEPENDS = "${DEPENDS_TARGET_OS}"
> +DEPENDS_TARGET_OS = "libdl"
> +DEPENDS_TARGET_OS:TARGET_OS_mingw32 = ""
>  
>  CFLAG = "${@['-DL_ENDIAN', '-DB_ENDIAN']['${TARGET_ENDIAN}'=='b']} ${TARGET_CFLAGS}"
>  CFLAG:>TARGET_OS_linux-gnu = " -DTERMIO"
> @@ -69,6 +69,9 @@ do_configure () {
>  	darwin-i386)
>  		target=darwin-i386-cc
>  		;;
> +	darwin-x86_64)
> +                target=darwin64-x86_64-cc
> +                ;;
>  	mingw32-*)
>  		target=mingw
>  		;;
> @@ -98,7 +101,7 @@ do_install () {
>  	fi
>  
>  	install -d ${D}${includedir}
> -	cp --dereference -R include/openssl ${D}${includedir}
> +	cp -L -R include/openssl ${D}${includedir}
>  }
>  
>  RDEPENDS_${PN} += " ${PN}-libcrypto ${PN}-libssl ${PN}-engines ${PN}-misc"
> @@ -107,6 +110,7 @@ PACKAGES =+ "${PN}-misc ${PN}-engines"
>  FILES_${PN}-misc = "${libdir}/ssl/misc ${libdir}/ssl/openssl.cnf"
>  FILES_${PN}-engines = "${libdir}/ssl/engines/*.so"
>  FILES_${PN}-engines:TARGET_OS_mingw32 = "${libdir}/ssl/engines/*.dll"
> +FILES_${PN}-engines:TARGET_OS_darwin = "${libdir}/ssl/engines/*.dylib"
>  FILES_${PN}-dbg =+ "${libdir}/ssl/engines/.debug"
>  FILES_${PN}-doc =+ "${libdir}/ssl/man"
>  
> @@ -122,5 +126,5 @@ LIBSSL_FILES = ""
>  LIBSSL_FILES:TARGET_OS_mingw32 = "${sharedlibdir}/ssleay32.dll"
>  DEPENDS_${PN}-libcrypto += " ${DEPENDS}"
>  DEPENDS_${PN}-libssl += " ${DEPENDS}"
> -RDEPENDS_${PN}-libcrypto += "libc libgcc libdl"
> -RDEPENDS_${PN}-libssl += "libc libdl libcrypto"
> +RDEPENDS_${PN}-libcrypto += "libc libgcc ${DEPENDS_TARGET_OS}" 
> +RDEPENDS_${PN}-libssl += "libc ${DEPENDS_TARGET_OS} libcrypto"

The recipe has changed since then, but I have tried to make a commit
based on current master which should make it work on darwin.  Let me
know how it fares.

/Esben

Patch

diff --git a/recipes/openssl/openssl.inc b/recipes/openssl/openssl.inc
index 66c243d..7bfcf5b 100644
--- a/recipes/openssl/openssl.inc
+++ b/recipes/openssl/openssl.inc
@@ -10,9 +10,9 @@  inherit c make pkgconfig
 
 SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz"
 
-DEPENDS = "${DEPENDS_HOST_OS}"
-DEPENDS_HOST_OS = "libdl"
-DEPENDS_HOST_OS:HOST_OS_mingw32 = ""
+DEPENDS = "${DEPENDS_TARGET_OS}"
+DEPENDS_TARGET_OS = "libdl"
+DEPENDS_TARGET_OS:TARGET_OS_mingw32 = ""
 
 CFLAG = "${@['-DL_ENDIAN', '-DB_ENDIAN']['${TARGET_ENDIAN}'=='b']} ${TARGET_CFLAGS}"
 CFLAG:>TARGET_OS_linux-gnu = " -DTERMIO"
@@ -69,6 +69,9 @@  do_configure () {
 	darwin-i386)
 		target=darwin-i386-cc
 		;;
+	darwin-x86_64)
+                target=darwin64-x86_64-cc
+                ;;
 	mingw32-*)
 		target=mingw
 		;;
@@ -98,7 +101,7 @@  do_install () {
 	fi
 
 	install -d ${D}${includedir}
-	cp --dereference -R include/openssl ${D}${includedir}
+	cp -L -R include/openssl ${D}${includedir}
 }
 
 RDEPENDS_${PN} += " ${PN}-libcrypto ${PN}-libssl ${PN}-engines ${PN}-misc"
@@ -107,6 +110,7 @@  PACKAGES =+ "${PN}-misc ${PN}-engines"
 FILES_${PN}-misc = "${libdir}/ssl/misc ${libdir}/ssl/openssl.cnf"
 FILES_${PN}-engines = "${libdir}/ssl/engines/*.so"
 FILES_${PN}-engines:TARGET_OS_mingw32 = "${libdir}/ssl/engines/*.dll"
+FILES_${PN}-engines:TARGET_OS_darwin = "${libdir}/ssl/engines/*.dylib"
 FILES_${PN}-dbg =+ "${libdir}/ssl/engines/.debug"
 FILES_${PN}-doc =+ "${libdir}/ssl/man"
 
@@ -122,5 +126,5 @@  LIBSSL_FILES = ""
 LIBSSL_FILES:TARGET_OS_mingw32 = "${sharedlibdir}/ssleay32.dll"
 DEPENDS_${PN}-libcrypto += " ${DEPENDS}"
 DEPENDS_${PN}-libssl += " ${DEPENDS}"
-RDEPENDS_${PN}-libcrypto += "libc libgcc libdl"
-RDEPENDS_${PN}-libssl += "libc libdl libcrypto"
+RDEPENDS_${PN}-libcrypto += "libc libgcc ${DEPENDS_TARGET_OS}" 
+RDEPENDS_${PN}-libssl += "libc ${DEPENDS_TARGET_OS} libcrypto"