Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 200574 Details for
Bug 280744
[kde-testing] ebuild for kdebindings-ruby (kde 4)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
kdebindings-ruby ebuild
kdebindings-ruby-9999.ebuild (text/plain), 8.20 KB, created by
Stefano Crocco
on 2009-08-08 13:33:42 UTC
(
hide
)
Description:
kdebindings-ruby ebuild
Filename:
MIME Type:
Creator:
Stefano Crocco
Created:
2009-08-08 13:33:42 UTC
Size:
8.20 KB
patch
obsolete
># Copyright 1999-2009 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: $ > ># Ebuild which builds the kde ruby bindings for both ruby 1.8 and ruby 1.9. To ># do so, it needs to heavily modify the CMakeLists.txt files included in the ># source and to add a FindRUBIES.cmake cmake modules. ># ># The main idea is to duplicate the ruby subdirectory and modify the CMakeLists.txt ># in each to build the bindings for a different version of ruby. For this to work, ># the FindRUBY cmake module used by kdebindings needs to be replaced, since it ># only provides parameters for a single, hardcoded, ruby version. That file is ># replaced with the custom FindRUBIES.cmake module which can look for both ruby ># 1.8 and ruby 1.9, depending on which of RUBY18_EXECUTABLE and RUBY19_EXECUTABLE ># are defined (if neither is defined, the version provided by the ruby executable ># is used) > >EAPI="2" > >KMNAME="kdebindings" >KMMODULE="ruby" >WEBKIT_REQUIRED="optional" >inherit kde4-meta > >DESCRIPTION="KDE 4 ruby bindings" >KEYWORDS="" >IUSE="akonadi kdevplatform +phonon qscintilla qwt +semantic-desktop ruby19 +ruby18" ># okular > >COMMON_DEPEND=" > >=kde-base/smoke-${PV}:${SLOT}[akonadi?,kdeprefix=,kdevplatform?,phonon?,qscintilla?,qwt?,semantic-desktop?] > ruby19? ( =dev-lang/ruby-1.9* ) !ruby19? ( =dev-lang/ruby-1.8* ) > !dev-ruby/qt4-qtruby > !kde-base/qtruby > !kde-base/korundum >" ># okular? ( kde-base/okular) -- it can't find it anyway > >DEPEND="${COMMON_DEPEND}" >RDEPEND="${COMMON_DEPEND}" > >KMEXTRACTONLY="smoke/" > >PATCHES=( > "${FILESDIR}/soprano_libs.patch" #Missing library declarations for soprano > "${FILESDIR}/nepomuk_libs.patch" ) #Missing library declarations for nepomuk > "${FILESDIR}/nepomuk19-svn.patch" #Make nepomuk compile with ruby 1.9 >#) > ># Functions which change the contents of the ruby18 or ruby19 subdirectories to ># make it build the bindings for the corresponding version of ruby. It takes one ># argument, which can be either 18 or 19. This argument will determine which ># subdirectory will be modified and for which version of ruby. ># ># The following changes will be made: ># * if changing the ruby19 directory, everywhere the RUBY_INCLUDE_PATH variable ># is used, the RUBY19_CONFIG_H_DIR variable is added (this is the path where ># the ruby/config.h file is in ruby 1.9) ># * all instances of variables like RUBY_ or _RUBY_ in CMakeLists.txt files are ># changed to contain the ruby version (18 or 19) after RUBY, so that they use ># the parameters for the correct version of ruby ># * in all CMakeLists.txt, all references to the two shared libraries libqtruby4shared ># and krubypluginfactory are replaced with names including the ruby version. ># Without this, only one of them would be installed and used by both versions, ># leading to an immediate crash for the bindings using the wrong version ># * in all CMakeLists.txt, replace every occurrence of the ruby subdirectory ># with ruby18 or ruby19. This is needed because there are places which need ># to include files in other subdirectories ># * change the names of all the ruby modules by adding the ruby version to their ># name. This is needed because cmake doesn't allow two targets with the same ># name. To have the libraries installed with the correct names (without the ># suffixes), the TARGET_PROPERTY OUTPUT_NAME needs to be set to the real name ># * replace the use of FindRUBY in the top-level CMakeLists.txt file with the ># custom FindRUBIES module ># * set the CMAKE_LIBRARY_OUTPUT_DIRECTORY to the top level lib/rubyxx directory ># as first thing in the top-level CMakeLists.txt files. This is needed to put ># libraries for the different ruby versions in different places. Without this ># they would both be put in the same directory (lib), where the last built would ># overwrite the first (since they have the same names) >create_ruby_targets() { > > # A list of all CMakeLists.txt files in the directory > CMAKELISTS=`find ruby${1} -name CMakeLists.txt` > > # A list of the ruby modules > LIBRARIES=" > rubyqwt \ > rubyhtml \ > rubysolid \ > rubyktexteditor \ > rubyqscintilla \ > korundum4 \ > rubysoprano \ > rubynepomuk \ > rubyokular \ > rubyphonon \ > plasma_applet \ > qtruby4 \ > qttest \ > qtscrupt \ > rubyqtwebkit \ > rubykdevplatform > " > > if [ "${1}" -eq 19 ]; then > # Add ${RUBY19_CONFIG_H_DIR} (the directory were the config.h is) to everywhere > # there's a ${RUBY_INCLUDE_PATH} in the ruby19 directory > for f in ${CMAKELISTS}; do > sed -i 's%\${RUBY_INCLUDE_PATH}%\${RUBY_INCLUDE_PATH} \${RUBY19_CONFIG_H_DIR}%' "${f}" > done > fi > > for f in ${CMAKELISTS}; do > # Replace all the instances of RUBY_ with ${RUBYxx_} > sed -i "s%\\(\\b\\|_\\)RUBY_%\\1RUBY${1}_%g" ${f} > # Replace libqtruby4shared with libqtruby4sharedxx > sed -i "s%qtruby4shared%qtruby4shared${1}%" "${f}" > # Replace krubypluginfactory with krubypluginfactoryxx > sed -i "s%krubypluginfactory\\([^.\\w]\\)%krubypluginfactory${1}\\1%" "${f}" > # Replace the occurrences of the /ruby subdirectory with /rubyxx/ > sed -i "s%/ruby/%/ruby${1}/%g" "${f}" > > # Change the names of the ruby modules to include the ruby version and set > # the correct OUTPUT_NAME > for lib in ${LIBRARIES}; do > sed -i "s%\\b${lib} %${lib}${1} %g" ${f} > sed -i "s%\\(target_link_libraries(${lib}${1} \\)%set_target_properties(${lib}${1} PROPERTIES OUTPUT_NAME ${lib})\n\\1%" ${f} > done > > done > > # Correct a (possible) wrong substitution > for lib in ${LIBRARIES}; do > sed -i "s%add_subdirectory( ${lib}${1} )%add_subdirectory( ${lib} )%" "ruby${1}/CMakeLists.txt" > done > > # Replace back RUBYxx_ with RUBY_ in a MATH expression in the toplevel CMakeLists.txt > sed -i "s%\"print RUBY${1}_VERSION\"%\"print RUBY_VERSION\"%" "ruby${1}/CMakeLists.txt" > > > # Replace the macro_optional_find_package(RUBY) from the toplevel CMakeLists.txt > # in the rubyxx directory with macro_optional_find_package(RUBIES) > sed -i "s%macro_optional_find_package(RUBY)%SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PWD}/lib/ruby${1})\nmacro_optional_find_package(RUBIES)%" "ruby${1}/CMakeLists.txt" >} > >src_configure() { > > # Adds /usr/kde/${SLOT}/lib to the link path for all libraries. Without this, > # the build system can't find the smoke library. This is only needed if the > # kdeprefix use flag is enabled because in this case smoke is instalelled in > # a directory which isn't automatically searched. Without this use flag, smoke > # is installed in /usr/lib and is automatically found > if use kdeprefix; then > sed -i "s%project\(kdebindings\)%project\(kdebindings\)\\nlink_directories\(/usr/kde/${SLOT}/lib/\)" > fi > > # Copy the custom FindRUBIES.cmake cmake module to cmake/modules > cp "${FILESDIR}/FindRUBIES.cmake" cmake/modules > > # Duplicate the ruby source directories, naming one ruby18 and the other ruby19 > cp -R ruby 'ruby18' > mv ruby 'ruby19' > > > # Remove the subdirectory 'ruby' and add the subdirectories 'ruby18' and 'ruby19' > # to the top level CMakeLists.txt (actually, replace the former with the latter) > sed -i "s%macro_optional_add_subdirectory(ruby)%macro_optional_add_subdirectory(ruby18)\nmacro_optional_add_subdirectory(ruby19)%" CMakeLists.txt > > # Correct the contents of the ruby18 and ruby19 directories so that the bidings > # for the two versions of ruby are build > create_ruby_targets 18 > create_ruby_targets 19 > > local mycmakeargs=" > $(cmake-utils_use_enable webkit QTWEBKIT_RUBY) > $(cmake-utils_use_enable qwt QWT_RUBY) > $(cmake-utils_use_enable qscintilla QSCI_RUBY) > $(cmake-utils_use_enable phonon PHONON_RUBY) > $(cmake-utils_use_enable kdevplatform KDEVPLATFORM_RUBY) > $(cmake-utils_use_with semantic-desktop Nepomuk) > $(cmake-utils_use_with semantic-desktop Soprano) > $(cmake-utils_use_with akonadi Kdepimlibs) > $(cmake-utils_use_with akonadi) > -DENABLE_QTSCRIPT=OFF > -DENABLE_Okular=OFF > -DENABLE_KROSSRUBY=OFF > " > # Add the appropriate -DRUBYxx_EXECUTABLE arguments (with xx=19 or xx=18) to > # the cmake arguments, according to the use flags set by the user. If neither > # flag is set, the FindRUBIES cmake module will find the appropriate version > if use ruby19; then > mycmakeargs="${mycmakeargs} -DRUBY19_EXECUTABLE=/usr/bin/ruby19" > fi > > if use ruby18; then > mycmakeargs="${mycmakeargs} -DRUBY18_EXECUTABLE=/usr/bin/ruby18" > fi > > kde4-meta_src_configure >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 280744
:
200574
|
200575
|
200581
|
200582
|
200584
|
201322
|
201323