Merge lp:~meberl/inkscape/extension-fixes into lp:~inkscape.dev/inkscape/trunk

Proposed by meberl
Status: Merged
Approved by: Mc
Approved revision: 14864
Merged at revision: 14866
Proposed branch: lp:~meberl/inkscape/extension-fixes
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 143 lines (+25/-13)
5 files modified
CMakeLists.txt (+3/-4)
src/CMakeLists.txt (+10/-0)
src/extension/loader.cpp (+1/-1)
src/extension/loader.h (+3/-3)
src/extension/system.cpp (+8/-5)
To merge this branch: bzr merge lp:~meberl/inkscape/extension-fixes
Reviewer Review Type Date Requested Status
Mc Approve
Review via email: mp+293372@code.launchpad.net

Description of the change

- Restructured CMake a bit, the install targets are now in src/CMakeLists.txt.
- CMake build now links the inkscape and inkview executables against the libinkscape_base library that is installed. This can be verified with ldd.
- Fixed a bug in the extension system. The plugin loader searches for the binary in the directory of the inx file.

To post a comment you must log in.
Revision history for this message
Mc (mc...) wrote :

Just tested, and cannot run after installing :

./inkscape: error while loading shared libraries: libgdl_LIB.so: cannot open shared object file: No such file or directory

$ ldd ./inkscape
 linux-vdso.so.1 (0x00007fff3d133000)
 libinkscape_base.so => /home/mc/[...install path...]/bin/./../lib/libinkscape_base.so (0x00007f6a2e5b6000)
 libgdl_LIB.so => not found
 libnrtype_LIB.so => not found
 libcroco_LIB.so => not found
 libavoid_LIB.so => not found
 libcola_LIB.so => not found
 libvpsc_LIB.so => not found
 liblivarot_LIB.so => not found
 libuemf_LIB.so => not found
 lib2geom_LIB.so => not found
 libdepixelize_LIB.so => not found
 libutil_LIB.so => not found
 libgc_LIB.so => not found
 libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f6a2e368000)
[...]

review: Needs Fixing (test)
Revision history for this message
Mc (mc...) wrote :

Ok, I fixed it. Merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-04-16 17:26:13 +0000
+++ CMakeLists.txt 2016-04-29 09:53:54 +0000
@@ -19,6 +19,8 @@
19set(INKSCAPE_VERSION 0.91+devel)19set(INKSCAPE_VERSION 0.91+devel)
20set(PROJECT_NAME inkscape)20set(PROJECT_NAME inkscape)
21set(CMAKE_INCLUDE_CURRENT_DIR TRUE)21set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
22SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/")
23
2224
23cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths25cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths
24cmake_policy(SET CMP0005 NEW) # proper define quoting26cmake_policy(SET CMP0005 NEW) # proper define quoting
@@ -173,10 +175,7 @@
173# Installation175# Installation
174# -----------------------------------------------------------------------------176# -----------------------------------------------------------------------------
175if(UNIX)177if(UNIX)
176 install(178 #The install directive for the binaries and libraries are found in src/CMakeList.txt
177 PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/inkscape ${EXECUTABLE_OUTPUT_PATH}/inkview
178 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
179 )
180179
181 install(180 install(
182 FILES ${CMAKE_BINARY_DIR}/inkscape.desktop181 FILES ${CMAKE_BINARY_DIR}/inkscape.desktop
183182
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2016-04-16 17:24:08 +0000
+++ src/CMakeLists.txt 2016-04-29 09:53:54 +0000
@@ -558,6 +558,8 @@
558endif()558endif()
559559
560560
561
562
561# Link the inkscape_base library against all external dependencies563# Link the inkscape_base library against all external dependencies
562target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS})564target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS})
563565
@@ -565,3 +567,11 @@
565target_link_libraries(inkscape inkscape_base )567target_link_libraries(inkscape inkscape_base )
566target_link_libraries(inkview inkscape_base)568target_link_libraries(inkview inkscape_base)
567569
570#Define the installation
571install(
572 TARGETS inkscape_base inkscape inkview
573 RUNTIME DESTINATION bin
574 LIBRARY DESTINATION lib
575)
576
577
568578
=== modified file 'src/extension/loader.cpp'
--- src/extension/loader.cpp 2016-04-21 06:14:10 +0000
+++ src/extension/loader.cpp 2016-04-29 09:53:54 +0000
@@ -74,7 +74,7 @@
74 _getInkscapeVersion GetInkscapeVersion = NULL;74 _getInkscapeVersion GetInkscapeVersion = NULL;
75 75
76 // build the path where to look for the plugin76 // build the path where to look for the plugin
77 gchar *path = g_build_filename(_baseDirectory, name, (char *) NULL);77 gchar *path = g_build_filename(_baseDirectory.c_str(), name, (char *) NULL);
78 module = g_module_open(path, G_MODULE_BIND_LOCAL);78 module = g_module_open(path, G_MODULE_BIND_LOCAL);
79 g_free(path);79 g_free(path);
80 80
8181
=== modified file 'src/extension/loader.h'
--- src/extension/loader.h 2016-04-12 09:43:56 +0000
+++ src/extension/loader.h 2016-04-29 09:53:54 +0000
@@ -31,7 +31,7 @@
31 * 31 *
32 * @param dir is the path where the plugin should be loaded from.32 * @param dir is the path where the plugin should be loaded from.
33 */33 */
34 void set_base_directory(const gchar *dir) {34 void set_base_directory(std::string dir) {
35 _baseDirectory = dir;35 _baseDirectory = dir;
36 }36 }
3737
@@ -51,7 +51,7 @@
51 Implementation::Implementation *load_implementation(Inkscape::XML::Document *doc);51 Implementation::Implementation *load_implementation(Inkscape::XML::Document *doc);
5252
53private:53private:
54 const gchar *_baseDirectory; /**< The base directory to load a plugin from */54 std::string _baseDirectory; /**< The base directory to load a plugin from */
5555
5656
57};57};
@@ -70,4 +70,4 @@
70 fill-column:9970 fill-column:99
71 End:71 End:
72*/72*/
73// vim:filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99:
74\ No newline at end of file73\ No newline at end of file
74// vim:filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99:
7575
=== modified file 'src/extension/system.cpp'
--- src/extension/system.cpp 2016-04-12 09:43:56 +0000
+++ src/extension/system.cpp 2016-04-29 09:53:54 +0000
@@ -47,7 +47,7 @@
4747
48static void open_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data);48static void open_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data);
49static void save_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data);49static void save_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data);
50static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp);50static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp, std::string* baseDir);
5151
52/**52/**
53 * \return A new document created from the filename passed in53 * \return A new document created from the filename passed in
@@ -422,7 +422,7 @@
422 * case could apply to modules that are built in (like the SVG load/save functions).422 * case could apply to modules that are built in (like the SVG load/save functions).
423 */423 */
424static Extension *424static Extension *
425build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp)425build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp, std::string* baseDir)
426{426{
427 enum {427 enum {
428 MODULE_EXTENSION,428 MODULE_EXTENSION,
@@ -490,7 +490,9 @@
490 }490 }
491 case MODULE_PLUGIN: {491 case MODULE_PLUGIN: {
492 Inkscape::Extension::Loader loader = Inkscape::Extension::Loader();492 Inkscape::Extension::Loader loader = Inkscape::Extension::Loader();
493 loader.set_base_directory ( Inkscape::Application::profile_path("extensions"));493 if( baseDir != NULL){
494 loader.set_base_directory ( *baseDir );
495 }
494 imp = loader.load_implementation(doc);496 imp = loader.load_implementation(doc);
495 break;497 break;
496 }498 }
@@ -546,7 +548,8 @@
546build_from_file(gchar const *filename)548build_from_file(gchar const *filename)
547{549{
548 Inkscape::XML::Document *doc = sp_repr_read_file(filename, INKSCAPE_EXTENSION_URI);550 Inkscape::XML::Document *doc = sp_repr_read_file(filename, INKSCAPE_EXTENSION_URI);
549 Extension *ext = build_from_reprdoc(doc, NULL);551 std::string dir = Glib::path_get_dirname(filename);
552 Extension *ext = build_from_reprdoc(doc, NULL, &dir);
550 if (ext != NULL)553 if (ext != NULL)
551 Inkscape::GC::release(doc);554 Inkscape::GC::release(doc);
552 else555 else
@@ -568,7 +571,7 @@
568{571{
569 Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), INKSCAPE_EXTENSION_URI);572 Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), INKSCAPE_EXTENSION_URI);
570 g_return_val_if_fail(doc != NULL, NULL);573 g_return_val_if_fail(doc != NULL, NULL);
571 Extension *ext = build_from_reprdoc(doc, in_imp);574 Extension *ext = build_from_reprdoc(doc, in_imp, NULL);
572 Inkscape::GC::release(doc);575 Inkscape::GC::release(doc);
573 return ext;576 return ext;
574}577}