diff options
| -rw-r--r-- | media-sound/amarok-utils/ChangeLog | 5 | ||||
| -rw-r--r-- | media-sound/amarok-utils/Manifest | 6 | ||||
| -rw-r--r-- | media-sound/amarok-utils/amarok-utils-2.0.90.ebuild | 10 | ||||
| -rw-r--r-- | media-sound/amarok-utils/files/FindGettext.cmake | 243 | ||||
| -rw-r--r-- | media-sound/amarok-utils/files/MacroOptionalAddSubdirectory.cmake | 31 |
5 files changed, 292 insertions, 3 deletions
diff --git a/media-sound/amarok-utils/ChangeLog b/media-sound/amarok-utils/ChangeLog index 9eb3a9652c8..fd8e5e3e856 100644 --- a/media-sound/amarok-utils/ChangeLog +++ b/media-sound/amarok-utils/ChangeLog @@ -2,6 +2,11 @@ # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 14 Apr 2009; Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> + +media-sound/amarok-utils/files/FindGettext.cmake, + +media-sound/amarok-utils/files/MacroOptionalAddSubdirectory.cmake: + Added missing cmake includes. + 31 Mar 2009; Maciej Mrozowski (reavertm) <reavertm@poczta.fm> amarok-utils-9999.ebuild: Moved to new eclass diff --git a/media-sound/amarok-utils/Manifest b/media-sound/amarok-utils/Manifest index 43b79d63024..d18befae2a5 100644 --- a/media-sound/amarok-utils/Manifest +++ b/media-sound/amarok-utils/Manifest @@ -1,5 +1,7 @@ +AUX FindGettext.cmake 8556 RMD160 72d989748ab79fe059313556ce3541c2561f6b45 SHA1 84c58146c064edbe391805075aacdc6c852b3abb SHA256 86a93ab459fe8875badfd13cfd54a696426a42a5259658c8cd668678c31f7302 +AUX MacroOptionalAddSubdirectory.cmake 1410 RMD160 4a99142eac37138c0eb678d7529c993e5e8bfbe7 SHA1 a48f784b6471712a18fdf394d4372c4869c057ff SHA256 ea7fa47ddfacd32dbd90b2b33b4c9363dca8115036be48be55da93cdbe9bbb39 DIST amarok-2.0.90.tar.bz2 5201787 RMD160 a0bb847cd254197e17e1cfcf7b565c395629e7c4 SHA1 a7926b514d52e4a445fbf307fb16d4b5b058c017 SHA256 ef38f9bb0b34f12e1aac7884431038ae62d1bb9a2a1a6ffe36c2fcd6f3d7e51b -EBUILD amarok-utils-2.0.90.ebuild 738 RMD160 e4a369469c63007f843e4929fd5d8a9b0fe1f9b8 SHA1 d10641a32684049cb6fc38612fa815edfe0ffa60 SHA256 6eb9d3afa15e9b0b430608a303da5c3cdd09ffc90223fb91dd6be2b33787def2 +EBUILD amarok-utils-2.0.90.ebuild 1023 RMD160 3f75055d8567ff7cc40f68d445d9133e5600abed SHA1 94c42da87f3a4274bf506948964717458735522d SHA256 a6558e5d05e925bc89610e328f5924ff1a4c9cee33eb982a1b586c034e0f00aa EBUILD amarok-utils-9999.ebuild 621 RMD160 ff58d4f2ff3dccf8281628d6e335b7cd08dab43c SHA1 d44a6266444c650bae6b996a6811d1a3602509a3 SHA256 a19798afb7a8d5815c29d41a4c6703de69d87d67330a03894bfac1547921fde7 -MISC ChangeLog 676 RMD160 4e5ea80b9dfbd818de31dcc333ba1de159e45425 SHA1 f0be8b6dfc9e84c24ee24c36e6a10c62583bc0c1 SHA256 b643d454260a2206fc6055cdc9c45b33a80b66568897735f42bd987120bb1de9 +MISC ChangeLog 899 RMD160 470184e39f869b69d2862ebf21d75217632397bf SHA1 d802397c0462ba465cb613e1bbdaf0d5b8b47b89 SHA256 b1ccecf38202cd5685066e77dc5f45e2abffa11c918453a876cd3fd8f9bdd751 MISC metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 SHA1 b64f7c0b4e5db816d82ad19848f72118af129d35 SHA256 2f4da28506b9d4185f320f67a6191d30c7a921217ed4447ed46ea0bc4aefc79a diff --git a/media-sound/amarok-utils/amarok-utils-2.0.90.ebuild b/media-sound/amarok-utils/amarok-utils-2.0.90.ebuild index 5c3d9c49a04..fdd77fe0447 100644 --- a/media-sound/amarok-utils/amarok-utils-2.0.90.ebuild +++ b/media-sound/amarok-utils/amarok-utils-2.0.90.ebuild @@ -9,7 +9,7 @@ KMMODULE="amarok" KDE_REQUIRED="never" inherit kde4-base -DESCRIPTION="Variuos utility programs for Amarok." +DESCRIPTION="Various utility programs for Amarok." HOMEPAGE="http://amarok.kde.org/" SRC_URI="mirror://kde/unstable/${PN/-utils/}/${PV}/src/${P/-utils/}.tar.bz2" @@ -29,6 +29,14 @@ RDEPEND="${DEPEND} S="${WORKDIR}/${P/-utils/}" +src_unpack() { + kde4-base_src_unpack + + # Add missing cmake modules + cp "${FILESDIR}/MacroOptionalAddSubdirectory.cmake" "${S}/cmake/modules" || die "Failed to add OptionalAddSubdirectory Macro". + cp "${FILESDIR}/FindGettext.cmake" "${S}/cmake/modules" || die "Failed to add Macro". +} + src_configure() { mycmakeargs="${mycmakeargs} -DWITH_PLAYER=OFF diff --git a/media-sound/amarok-utils/files/FindGettext.cmake b/media-sound/amarok-utils/files/FindGettext.cmake new file mode 100644 index 00000000000..e35dceda7af --- /dev/null +++ b/media-sound/amarok-utils/files/FindGettext.cmake @@ -0,0 +1,243 @@ +# Try to find Gettext functionality +# Once done this will define +# +# GETTEXT_FOUND - system has Gettext +# GETTEXT_INCLUDE_DIR - Gettext include directory +# GETTEXT_LIBRARIES - Libraries needed to use Gettext + +# TODO: This will enable translations only if Gettext functionality is +# present in libc. Must have more robust system for release, where Gettext +# functionality can also reside in standalone Gettext library, or the one +# embedded within kdelibs (cf. gettext.m4 from Gettext source). +# +# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + # in cache already + set(GETTEXT_FOUND TRUE) + +else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + include(CheckLibraryExists) + include(CheckFunctionExists) + + find_path(GETTEXT_INCLUDE_DIR libintl.h) + if(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 1) + else(GETTEXT_INCLUDE_DIR) + set(HAVE_LIBINTL_H 0) + endif(GETTEXT_INCLUDE_DIR) + + set(GETTEXT_LIBRARIES) + + if (HAVE_LIBINTL_H) + check_function_exists(dgettext LIBC_HAS_DGETTEXT) + if (LIBC_HAS_DGETTEXT) + set(GETTEXT_SOURCE "built in libc") + set(GETTEXT_FOUND TRUE) + else (LIBC_HAS_DGETTEXT) + find_library(LIBINTL_LIBRARY NAMES intl libintl ) + + check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT) + if (LIBINTL_HAS_DGETTEXT) + set(GETTEXT_SOURCE "in ${LIBINTL_LIBRARY}") + set(GETTEXT_LIBRARIES ${LIBINTL_LIBRARY}) + set(GETTEXT_FOUND TRUE) + endif (LIBINTL_HAS_DGETTEXT) + endif (LIBC_HAS_DGETTEXT) + endif (HAVE_LIBINTL_H) + + if (GETTEXT_FOUND) + if (NOT Gettext_FIND_QUIETLY) + message(STATUS "Found Gettext: ${GETTEXT_SOURCE}") + endif (NOT Gettext_FIND_QUIETLY) + else (GETTEXT_FOUND) + if (Gettext_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find Gettext") + endif (Gettext_FIND_REQUIRED) + endif (GETTEXT_FOUND) + + mark_as_advanced(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES) + +endif (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT) + + +# - Find GNU gettext tools +# This module looks for the GNU gettext tools. This module defines the +# following values: +# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. +# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. +# GETTEXT_FOUND: True if gettext has been found. +# +# Additionally it provides the following macros: +# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) +# This will create a target "translations" which will convert the +# given input po files into the binary output mo file. If the +# ALL option is used, the translations will also be created when +# building the default target. +# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... ) +# Process the given pot file to mo files. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the pot file is processed when building the all traget. +# It creates a custom target "potfile". +# +# GETTEXT_PROCESS_PO_FILES(<lang> [ALL] [INSTALL_DESTINATION <dir>] <po1> <po2> ...) +# Process the given po files to mo files for the given language. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the po files are processed when building the all traget. +# It creates a custom target "pofiles". + + + +FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge) + +FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) + +MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile) + + SET(_gmoFiles) + GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + + SET(_addToAll) + IF(${_firstPoFile} STREQUAL "ALL") + SET(_addToAll "ALL") + SET(_firstPoFile) + ENDIF(${_firstPoFile} STREQUAL "ALL") + + FOREACH (_currentPoFile ${ARGN}) + GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) + GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH) + GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) + + ADD_CUSTOM_COMMAND( + OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} + DEPENDS ${_absPotFile} ${_absFile} + ) + + INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) + + ENDFOREACH (_currentPoFile ) + + ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) + +ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) + +# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... ) +MACRO(GETTEXT_PROCESS_POT_FILE _potFile) + + SET(_gmoFiles) + SET(_args ${ARGN}) + SET(_addToAll) + SET(_installDest) + + IF(_args) + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "ALL") + SET(_addToAll ALL) + LIST(REMOVE_AT _args 0) + ENDIF("${_tmp}" STREQUAL "ALL") + ENDIF(_args) + + IF(_args) + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + LIST(GET _args 1 _installDest ) + LIST(REMOVE_AT _args 0 1) + ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + ENDIF(_args) + + GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + +# message(STATUS "1 all ${_addToAll} dest ${_installDest} args: ${_args}") + + FOREACH (_lang ${_args}) + SET(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po") + SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo") + + ADD_CUSTOM_COMMAND( + OUTPUT "${_poFile}" + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile} + DEPENDS ${_absPotFile} + ) + + ADD_CUSTOM_COMMAND( + OUTPUT "${_gmoFile}" + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile} + DEPENDS ${_absPotFile} ${_poFile} + ) + + IF(_installDest) + INSTALL(FILES ${_gmoFile} DESTINATION ${_installDest}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ENDIF(_installDest) + LIST(APPEND _gmoFiles ${_gmoFile}) + + ENDFOREACH (_lang ) + + ADD_CUSTOM_TARGET(potfile ${_addToAll} DEPENDS ${_gmoFiles}) + +ENDMACRO(GETTEXT_PROCESS_POT_FILE) + + +# GETTEXT_PROCESS_PO_FILES(<lang> [ALL] [INSTALL_DESTINATION <dir>] <po1> <po2> ...) +MACRO(GETTEXT_PROCESS_PO_FILES _lang) + SET(_gmoFiles) + SET(_args ${ARGN}) + SET(_addToAll) + SET(_installDest) + + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "ALL") + SET(_addToAll ALL) + LIST(REMOVE_AT _args 0) + ENDIF("${_tmp}" STREQUAL "ALL") + + LIST(GET _args 0 _tmp) + IF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + LIST(GET _args 1 _installDest ) + LIST(REMOVE_AT _args 0 1) + ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION") + +# message(STATUS "2 all ${_addToAll} dest ${_installDest} args: ${_args}") + + FOREACH(_current_PO_FILE ${_args}) + GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo) + add_custom_command(OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_current_PO_FILE} + ) + + IF(_installDest) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_installDest}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo) + ENDIF(_installDest) + LIST(APPEND _gmoFiles ${_gmoFile}) + ENDFOREACH(_current_PO_FILE) + ADD_CUSTOM_TARGET(pofiles ${_addToAll} DEPENDS ${_gmoFiles}) +ENDMACRO(GETTEXT_PROCESS_PO_FILES) + + +#IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) +# SET(GETTEXT_FOUND TRUE) +#ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) +# SET(GETTEXT_FOUND FALSE) +# IF (GetText_REQUIRED) +# MESSAGE(FATAL_ERROR "GetText not found") +# ENDIF (GetText_REQUIRED) +#ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) + + + diff --git a/media-sound/amarok-utils/files/MacroOptionalAddSubdirectory.cmake b/media-sound/amarok-utils/files/MacroOptionalAddSubdirectory.cmake new file mode 100644 index 00000000000..32e25141d40 --- /dev/null +++ b/media-sound/amarok-utils/files/MacroOptionalAddSubdirectory.cmake @@ -0,0 +1,31 @@ +# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION() +# MACRO_OPTIONAL_ADD_SUBDIRECTORY( <dir> ) +# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(), +# this will have two effects +# 1 - CMake will not complain if the directory doesn't exist +# This makes sense if you want to distribute just one of the subdirs +# in a source package, e.g. just one of the subdirs in kdeextragear. +# 2 - If the directory exists, it will offer an option to skip the +# subdirectory. +# This is useful if you want to compile only a subset of all +# directories. + +# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir ) + GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE) + IF(EXISTS ${_fullPath}) + SET(_DEFAULT_OPTION_VALUE TRUE) + IF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir}) + SET(_DEFAULT_OPTION_VALUE FALSE) + ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir}) + OPTION(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE}) + IF(BUILD_${_dir}) + ADD_SUBDIRECTORY(${_dir}) + ENDIF(BUILD_${_dir}) + ENDIF(EXISTS ${_fullPath}) +ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY) |
