summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
Diffstat (limited to 'swig')
-rw-r--r--swig/CMakeLists.txt39
-rw-r--r--swig/RepoManager.i18
-rw-r--r--swig/RepoType.i3
-rw-r--r--swig/zypp.i3
4 files changed, 25 insertions, 38 deletions
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
index 251b5b5..400c894 100644
--- a/swig/CMakeLists.txt
+++ b/swig/CMakeLists.txt
@@ -19,19 +19,26 @@ OPTION(BUILD_PERL5_BINDINGS "Build Perl 5 bindings" ON)
# Let's see which target languages are available
#
-FIND_PACKAGE(Ruby)
-FIND_PACKAGE(PythonLibs)
-FIND_PACKAGE(Perl)
-
-
-IF (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
- ADD_SUBDIRECTORY(ruby)
-ENDIF(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
-
-IF (PYTHON_LIBRARY)
- ADD_SUBDIRECTORY(python)
-ENDIF(PYTHON_LIBRARY)
-
-#IF (PERL_EXECUTABLE)
-# ADD_SUBDIRECTORY(perl5)
-#ENDIF (PERL_EXECUTABLE)
+IF(BUILD_RUBY_BINDINGS)
+ FIND_PACKAGE(Ruby)
+ IF(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+ ADD_SUBDIRECTORY(ruby)
+ ENDIF()
+ENDIF()
+
+IF(BUILD_PYTHON2_BINDINGS)
+ # Enforce Python 2.7, libzypp-bindings does not yet work with Python3
+ set(PythonLibs_FIND_VERSION 2.7)
+ set(PythonLibs_FIND_VERSION_MAJOR 2)
+ FIND_PACKAGE(PythonLibs)
+ IF(PYTHON_LIBRARY)
+ ADD_SUBDIRECTORY(python)
+ ENDIF()
+ENDIF()
+
+IF(BUILD_PERL5_BINDINGS)
+ FIND_PACKAGE(Perl)
+ IF(PERL_EXECUTABLE)
+ ADD_SUBDIRECTORY(perl5)
+ ENDIF()
+ENDIF()
diff --git a/swig/RepoManager.i b/swig/RepoManager.i
index a150d32..8f7870d 100644
--- a/swig/RepoManager.i
+++ b/swig/RepoManager.i
@@ -1,19 +1 @@
%include <zypp/RepoManager.h>
-
-#ifdef SWIGPYTHON
-%extend zypp::RepoManager{
- std::string loadSolvFile(std::string _solv, std::string _alias)
- {
- RepoInfo tmpRepo;
- tmpRepo.setAlias(_alias);
- try {
- sat::Pool::instance().addRepoSolv(_solv, tmpRepo);
- } catch ( const Exception & e ){
- return e.msg();
- }
-
- return std::string();
- }
-}
-#endif
-
diff --git a/swig/RepoType.i b/swig/RepoType.i
index 3907371..d9f1164 100644
--- a/swig/RepoType.i
+++ b/swig/RepoType.i
@@ -1,2 +1 @@
-%ignore zypp::operator<<;
-%include <zypp/repo/RepoType.h>
+%include <zypp/repo/RepoType.h> \ No newline at end of file
diff --git a/swig/zypp.i b/swig/zypp.i
index bdb2371..eaca647 100644
--- a/swig/zypp.i
+++ b/swig/zypp.i
@@ -239,7 +239,6 @@ namespace zypp {
%include "SolvAttr.i"
%include "Resolvable.i"
%include "RepoType.i"
-%include "TmpPath.i"
%include "RepoInfo.i"
%include "Repository.i"
%include "ServiceInfo.i"
@@ -263,10 +262,10 @@ namespace zypp {
%include "ResPool.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
+%include "TmpPath.i"
%include "Resolver.i"
%include "ZConfig.i"
%include "PoolQuery.i"
-%include "SolvAttr.i"
//just simple files, where we need default ctor
%include <zypp/repo/RepoProvideFile.h>