summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2017-05-10 16:58:57 +1000
committerJan Schmidt <jan@centricular.com>2017-05-10 17:01:26 +1000
commit422ac1e159a2d757ff82fa4b7ea06a457605224f (patch)
tree0704b96048390f603ae492cf5c3a497875b7be93 /recipes
parent7b843c4f796f29609c5a92a0bee75a739d9a65c3 (diff)
openjpeg: Add patch to set the INSTALL_NAME_DIR
Fixes a problem on OSX where the installed libopenjp2 dylib id doesn't contain the full path, and leads to incorrect linking and a non-loadable plugin https://bugzilla.gnome.org/show_bug.cgi?id=782352
Diffstat (limited to 'recipes')
-rw-r--r--recipes/openjpeg.recipe3
-rw-r--r--recipes/openjpeg/0002-Set-INSTALL_NAME_DIR.patch41
2 files changed, 43 insertions, 1 deletions
diff --git a/recipes/openjpeg.recipe b/recipes/openjpeg.recipe
index fb9964c5..adf53a02 100644
--- a/recipes/openjpeg.recipe
+++ b/recipes/openjpeg.recipe
@@ -10,7 +10,8 @@ class Recipe(recipe.Recipe):
btype = BuildType.CMAKE
url = 'http://downloads.sourceforge.net/project/openjpeg.mirror/2.1.0/openjpeg-2.1.0.tar.gz'
configure_options = ' -DBUILD_CODEC:bool=off -DBUILD_PKGCONFIG_FILES:bool=on '
- patches = ['openjpeg/0001-Build-shared-and-static-library.patch']
+ patches = ['openjpeg/0001-Build-shared-and-static-library.patch',
+ 'openjpeg/0002-Set-INSTALL_NAME_DIR.patch']
files_libs = ['libopenjp2']
files_devel = ['include/openjpeg-2.1/openjpeg.h',
diff --git a/recipes/openjpeg/0002-Set-INSTALL_NAME_DIR.patch b/recipes/openjpeg/0002-Set-INSTALL_NAME_DIR.patch
new file mode 100644
index 00000000..ce2f8ab1
--- /dev/null
+++ b/recipes/openjpeg/0002-Set-INSTALL_NAME_DIR.patch
@@ -0,0 +1,41 @@
+From 74bb30b6a23b0ddf51c8c84458823cab1c6b4735 Mon Sep 17 00:00:00 2001
+From: Jan Schmidt <jan@centricular.com>
+Date: Wed, 10 May 2017 16:45:08 +1000
+Subject: [PATCH] Set INSTALL_NAME_DIR
+
+Make sure that the id on the installed lib contains the full path,
+so that the plugin links to it correctly. Otherwise, we end up
+with a plugin that can't find the dylib at runtime
+---
+ CMakeLists.txt | 2 +-
+ src/lib/openjp2/CMakeLists.txt | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 229da1e..1822b23 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -106,7 +106,7 @@ if(NOT OPENJPEG_INSTALL_BIN_DIR)
+ endif()
+
+ if(NOT OPENJPEG_INSTALL_LIB_DIR)
+- set(OPENJPEG_INSTALL_LIB_DIR "lib")
++ set(OPENJPEG_INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ endif()
+
+ if(NOT OPENJPEG_INSTALL_SHARE_DIR)
+diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt
+index bf82a6f..3765aab 100644
+--- a/src/lib/openjp2/CMakeLists.txt
++++ b/src/lib/openjp2/CMakeLists.txt
+@@ -55,6 +55,7 @@ if(UNIX)
+ endif()
+ set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
+ set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS OPJ_EXPORTS)
++set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES INSTALL_NAME_DIR ${OPENJPEG_INSTALL_LIB_DIR})
+
+ add_library(${OPENJPEG_LIBRARY_NAME}_static STATIC ${OPENJPEG_SRCS})
+ if(UNIX)
+--
+2.9.3
+