Skip to content

Commit

Permalink
Merge pull request #9 from poshul/poshul/hendrikweisser-rna-ms2-id
Browse files Browse the repository at this point in the history
Poshul/hendrikweisser rna ms2
  • Loading branch information
hendrikweisser committed May 1, 2018
2 parents b1203ef + 89ecac7 commit 136dfcf
Show file tree
Hide file tree
Showing 370 changed files with 11,523 additions and 6,382 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ addons:
sources:
- ubuntu-toolchain-r-test
- boost-latest
- george-edison55-precise-backports
- sourceline: 'ppa:beineri/opt-qt591-trusty'
packages:
- cmake
- qt59base
- qt59svg
- cmake-data
- g++-4.8
- python-dev
Expand All @@ -37,17 +39,13 @@ addons:
- libxerces-c3.1
- libxerces-c-dev
- libicu-dev
- qt4-dev-tools
- libqt4-dev
- libqt4-core
- libqt4-gui
- libsvm-dev
- libsvm3
- libglpk36
- libglpk-dev
- subversion
- doxygen
- graphviz
- libglpk36
- libglpk-dev
- coinor-cbc
- coinor-libcgl1
- coinor-libclp1
Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ set(OPENMS_WIN32_DLL_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
# define installation subdirectories to allow for custom installations
# note that all those directories are below CMAKE_INSTALL_PREFIX
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
set(INSTALL_DOC_DIR share/doc CACHE PATH "Installation directory for documentation")
set(INSTALL_SHARE_DIR share/OpenMS CACHE PATH "Installation directory for shared data")
set(INSTALL_DOC_DIR share/doc CACHE PATH "Installation directory for documentation")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")

if(WIN32)
set(DEF_INSTALL_CMAKE_DIR CMake)
Expand All @@ -280,13 +280,18 @@ else()
set(DEF_INSTALL_CMAKE_DIR lib/cmake/OpenMS)
set(DEF_INSTALL_LIB_DIR lib)
endif()

set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
set(INSTALL_LIB_DIR ${DEF_INSTALL_LIB_DIR} CACHE PATH "Installation directory for libraries")
set(INSTALL_PLUGIN_SUBDIR plugins CACHE PATH "Installation subdirectory under the lib dir for QT plugins")
set(INSTALL_PLUGIN_DIR ${INSTALL_LIB_DIR}/${INSTALL_PLUGIN_SUBDIR})
file(RELATIVE_PATH INSTALL_LIB_PATH_REL_TO_BIN /${INSTALL_BIN_DIR} /${INSTALL_LIB_DIR})
set(QT_PLUGIN_PATH_REL_TO_BIN ${INSTALL_LIB_PATH_REL_TO_BIN}/${INSTALL_PLUGIN_SUBDIR})

# Never use RPATH. We have other means on every platform.
# E.g. not yet compatible with our fix_mac_dependencies script.
SET(CMAKE_MACOSX_RPATH FALSE)
# macOS-specific variable used when installing own libraries/bins. Use relative paths here.
# macOS-specific variable used when installing own libraries/bins. Use relative path to bin here.
SET(CMAKE_INSTALL_NAME_DIR "@executable_path/../${INSTALL_LIB_DIR}")

#------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions License.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ GLPK
- License:
http://www.gnu.org/copyleft/gpl.html

Qt 4
Qt5 (open-source version)
- URL:
https://www.qt.io/
- License (links):
http://doc.qt.io/qt-4.8/opensourceedition.html
- License:
http://doc.qt.io/qt-5/licensing.html

Xerces-C
- URL:
Expand Down
68 changes: 46 additions & 22 deletions cmake/MacOSX/fix_dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@

##### GLOBAL VARIABLES
$handledLibraries = Set.new
lib = nil
bin = nil
$lib_dir = nil
$bin_dir = nil
$plugin_dir = nil
$install_name_tool=`which install_name_tool`.strip
$DEBUG = false
$currentIndent=0
$executableId="@executable_path/../lib/"
$executableId="@executable_path/"

###############################################################################
def debug(message)
Expand Down Expand Up @@ -124,9 +125,9 @@ def handleDependencies(otool_out, targetPath, currentLib)
newPath=""
libname=""
if isFramework(fix_lib)
newPath, libname = handleFramework(fix_lib, targetPath)
_, libname = handleFramework(fix_lib, $lib_dir)
else
newPath, libname = handleDyLib(fix_lib, targetPath)
_, libname = handleDyLib(fix_lib, $lib_dir)
end

# fix loading of this library
Expand Down Expand Up @@ -231,11 +232,9 @@ def handleFramework(frameworkPath, targetPath)
def handleDyLib(dylibPath, targetPath)
$currentIndent+=1



# copy if necessary
newDyLibPath,libname=copyLib(dylibPath, targetPath)

if not $handledLibraries.include?(libname)
# run otool
otool_out=`otool -L #{dylibPath}`.strip.split(/\n/)
Expand All @@ -262,7 +261,7 @@ def handleDyLib(dylibPath, targetPath)
end

###############################################################################
def handleBinary(binaryPath, targetPath)
def handleBinary(binaryPath)
$currentIndent+=1

debug "Fixing binary #{binaryPath}"
Expand All @@ -275,7 +274,7 @@ def handleBinary(binaryPath, targetPath)

# handle all referenced libraries and copy them if necessary to
# the lib ref path
handleDependencies(otool_out, targetPath, binaryPath)
handleDependencies(otool_out, $lib_dir, binaryPath)

# readjust
$currentIndent-=1
Expand All @@ -291,7 +290,8 @@ def handleBinary(binaryPath, targetPath)
[ '--verbose', '-v', GetoptLong::NO_ARGUMENT ],
[ '--lib-path', '-l', GetoptLong::REQUIRED_ARGUMENT ],
[ '--install-name-tool', '-i', GetoptLong::OPTIONAL_ARGUMENT ],
[ '--bin-path', '-b', GetoptLong::REQUIRED_ARGUMENT ]
[ '--bin-path', '-b', GetoptLong::REQUIRED_ARGUMENT ],
[ '--plugin-path', '-p', GetoptLong::OPTIONAL_ARGUMENT ]
)

usage = "#{File.basename($0)} --bin-path PATH-TO-BINARIES --lib-path PATH-TO-STORE-LIBRARIES
Expand All @@ -303,6 +303,8 @@ def handleBinary(binaryPath, targetPath)
the target path where the handled libraries should be stored and possibly already libraries exist
-b, --bin-path:
the path were all the binaries that should be handled are located
-p, --plugin-path:
the path were optional plugin libraries like from QT5 are located
-v, --verbose:
increase verbosity
"
Expand All @@ -315,36 +317,58 @@ def handleBinary(binaryPath, targetPath)
$install_name_tool = arg
puts "Use #{install_name_tool} to fix binaries in #{bin}"
when '--lib-path'
lib = Pathname.new(arg).realpath
$lib_dir = Pathname.new(arg).realpath
when '--bin-path'
bin = Pathname.new(arg).realpath
$bin_dir = Pathname.new(arg).realpath
when '--plugin-path'
$plugin_dir = Pathname.new(arg).realpath
when '--verbose'
$DEBUG = true
end
end

if lib == nil or bin == nil
if $lib_dir.nil? or $bin_dir.nil?
puts "Please provide a bin and lib path"
puts "#{usage}"
exit 1
else
$executableId = $executableId + $lib_dir.relative_path_from($bin_dir).to_s
$executableId += "/"
puts "Substituting prefix to find libs with:"
puts $executableId
end

debug "HANDLING LIB DIR"
# fix libraries contained in lib-path
for content in Dir.entries(lib)
if fixable(content, lib)
for content in Dir.entries($lib_dir)
if fixable(content, $lib_dir)
if isFramework(content)
# handleFramework(lib + content, lib)
# handleFramework($lib_dir + content, $lib_dir)
else
handleDyLib(lib + content, lib)
handleDyLib($lib_dir + content, $lib_dir)
end
end
end

debug "HANDLING BIN DIR"
# fix binary references
for content in Dir.entries(bin)
if fixable(content, bin)
debug "Handle binary #{bin + content}"
handleBinary(bin + content, lib)
for content in Dir.entries($bin_dir)
if fixable(content, $bin_dir)
if content.end_with?("dylib")
debug "Handle dylib #{$bin_dir + content}"
handleDyLib($bin_dir + content, $bin_dir)
else
debug "Handle binary #{$bin_dir + content}"
handleBinary($bin_dir + content)
end
end
end

if !$plugin_dir.nil?
debug "HANDLING PLUGIN DIR"
for content in Dir.glob("#{$plugin_dir}/**/*.dylib")
debug "Handle dylib #{$plugin_dir + content}"
handleDyLib($plugin_dir + content, File.dirname($plugin_dir + content))
end
end

Loading

0 comments on commit 136dfcf

Please sign in to comment.