Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Troble making ebuild for telldius-core

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

Troble making ebuild for telldius-core

  • Quote

Post by arnelj » Sun Nov 04, 2012 1:39 pm

Hi,

I try to make an ebuild for the telldius-core-2.1.1, the code can be compiled and installed into my system by these actions:
adding "#include <unistd.h>" into file telldus-core-2.1.1/common/Socket_unix.cpp

Then:
cmake .
make
make install
ldconfig

The current ebuild looks like this:

Code: Select all

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $

EAPI="2"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_install() {
	emake DESTDIR="${D}" install
}

pkg_postinst() {
	elog "Start /usr/local/sbin/telldusd before use of service"
}
and the patch file looks like this:

Code: Select all

--- common/Socket_unix.cpp.orig	2012-11-04 13:21:56.000000000 +0100
+++ common/Socket_unix.cpp	2012-11-04 13:21:56.000000000 +0100
@@ -7,6 +7,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <math.h>
+#include <unistd.h>
 
 #define BUFSIZE 512
When I run the ebuild by the command "ACCEPT_KEYWORDS="~amd64" emerge -av telldus-core" I get this: (last part shown)

Code: Select all

[ 18%] Building CXX object common/CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/x86_64-pc-linux-gnu-g++  -D_LINUX  -DNDEBUG -march=core2 -O2 -pipe    -fPIC -fvisibility=hidden -o CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o -c /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1/common/EventHandler_unix.cpp
/usr/bin/cmake -E cmake_progress_report /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/CMakeFiles 8
[ 20%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/x86_64-pc-linux-gnu-g++  -D_LINUX  -DNDEBUG -march=core2 -O2 -pipe    -fPIC -fvisibility=hidden -o CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o -c /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1/common/Socket_unix.cpp
Linking CXX static library libTelldusCommon.a
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/cmake -P CMakeFiles/TelldusCommon.dir/cmake_clean_target.cmake
cd /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/common && /usr/bin/cmake -E cmake_link_script CMakeFiles/TelldusCommon.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-ar cr libTelldusCommon.a  CMakeFiles/TelldusCommon.dir/Event.cpp.o CMakeFiles/TelldusCommon.dir/Message.cpp.o CMakeFiles/TelldusCommon.dir/Mutex.cpp.o CMakeFiles/TelldusCommon.dir/Strings.cpp.o CMakeFiles/TelldusCommon.dir/Thread.cpp.o CMakeFiles/TelldusCommon.dir/Event_unix.cpp.o CMakeFiles/TelldusCommon.dir/EventHandler_unix.cpp.o CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o
/usr/bin/x86_64-pc-linux-gnu-ranlib libTelldusCommon.a
make[2]: Lämnar katalogen "/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build"
/usr/bin/cmake -E cmake_progress_report /var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build/CMakeFiles  1 2 3 4 5 6 7 8
[ 20%] Built target TelldusCommon
make[1]: Lämnar katalogen "/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build"
make: *** [all] Fel 2
emake failed
 * ERROR: dev-util/telldus-core-2.1.1 failed (compile phase):
 *   Make failed!
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 2783:  Called cmake-utils_src_compile
 *   environment, line  751:  Called _execute_optionaly 'src_compile'
 *   environment, line  269:  Called enable_cmake-utils_src_compile
 *   environment, line 1000:  Called cmake-utils_src_make
 *   environment, line  776:  Called die
 * The specific snippet of code:
 *               emake VERBOSE=1 "$@" || die "Make failed!";
 * 
 * If you need support, post the output of `emerge --info '=dev-util/telldus-core-2.1.1'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/telldus-core-2.1.1'`.
 * This ebuild is from an overlay named 'local-repo': '/usr/local/portage/'
 * The complete build log is located at '/var/tmp/portage/dev-util/telldus-core-2.1.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/telldus-core-2.1.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1_build'
 * S: '/var/tmp/portage/dev-util/telldus-core-2.1.1/work/telldus-core-2.1.1'
I cant find the reason why the linking phase at 20% fails. Any ideas?
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sun Nov 04, 2012 7:31 pm

Hi, again
I think there was a problem with the working directory, by changing it, the problem disappeared.

The new ebuild looks like this

Code: Select all

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	make || die "make failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog " "
}
one more patchfile was also needed. (telldus-core-2.1.1_fix_wrong_udev_location.patch)

Code: Select all

--- tdadmin/CMakeLists.txt.orig	2012-04-11 19:44:46.000000000 +0200
+++ tdadmin/CMakeLists.txt	2012-04-11 19:44:46.000000000 +0200
@@ -59,7 +59,7 @@
 INSTALL(TARGETS tdadmin RUNTIME DESTINATION sbin)
 
 IF (UNIX AND NOT APPLE)
-	SET(UDEV_RULES_DIR	"/etc/udev/rules.d" CACHE PATH "The directory where udev store its rules" )
+	SET(UDEV_RULES_DIR	"/lib/udev/rules.d" CACHE PATH "The directory where udev store its rules" )
 	CONFIGURE_FILE(
 		${CMAKE_CURRENT_SOURCE_DIR}/05-tellstick.rules
 		${CMAKE_BINARY_DIR}/parsed/05-tellstick.rules
The application can control a tellstick device that controls rf controlled switches used for home automation.
Top
Hu
Administrator
Administrator
Posts: 24395
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Nov 05, 2012 2:30 am

arnelj wrote:

Code: Select all

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	make || die "make failed"
}
You should use emake, not make.
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Mon Nov 05, 2012 4:33 pm

Hi,

I tried that, but then I got the same error as in the first post. I hadn't figured out why.
the make instead of emake probably hides some unwanted behaviours in the telldus-core makefiles.
Top
Hu
Administrator
Administrator
Posts: 24395
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Nov 06, 2012 2:21 am

If you use make, then user $MAKEOPTS are not respected. This means the build will be serial, which can work around bugs in upstream build systems. However, if the problem is that the upstream build is not parallel safe, you should use emake -j1, so that other user $MAKEOPTS are respected. You should also include a comment explaining the -j1, so that future maintainers who wish to check whether upstream has fixed their build system can do so. Finally, if no one else has yet reported it, you should report to the upstream maintainers if their build system works with -j1, but fails with -jN for N > 1.
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Wed Nov 07, 2012 6:40 pm

Hi,
thank you for your answer, the correct ebuild should look like this:

Code: Select all

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog "Caution - the build does only work with -j1"
}
the patchfiles are the same as in the previous posts
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sun Nov 11, 2012 4:00 pm

Hi,

when I installed the Telldus software on my ASUS eee 901 computer I had to change the the user and group to "root" in the /etc/tellstick.conf file. Otherwise I got the message "TellStick not found" when trying to control a switch via the "tdtool -n 1" command.
I also discovered two missed dependencies that has to be added into the telldus-core-2.1.1.ebuild file.

The current ebuild looks like this:

Code: Select all

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	dev-embedded/libftdi
	dev-libs/confuse
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Eventually you have to change user and group to root in the tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog "Caution - the build does only work with -j1"
}

I have also made a ebuild for the telldus-gui:

Code: Select all

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/openvas-manager/openvas-manager-2.0.4.ebuild,v 1.2 2012/05/04 06:08:10 jdhore Exp $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils
inherit qt4-r2

DESCRIPTION="Gui for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-gui/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND="dev-util/telldus-core"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-gui-2.1.1_fix_missing_include.patch
}

src_configure() {
	qmake "${S}"/3rdparty/qt-components-desktop
	cmake-utils_src_configure
}

src_compile() {
	cd "${S}"/3rdparty/qt-components-desktop
	emake -j1 || die "make failed"
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

src_install() {
	cd "${CMAKE_BUILD_DIR}"
	emake DESTDIR="${D}" install || die "Install failed"
	cd "${S}"/3rdparty/qt-components-desktop
	qt4-r2_src_install

}
I don't kwow it the qmake command is the one to use.

The telldus-gui ebuild needs one patch file:

Code: Select all

 --- 3rdparty/qtsingleapplication/src/qtlocalpeer.cpp.orig	2012-11-07 20:19:34.000000000 +0100
+++ 3rdparty/qtsingleapplication/src/qtlocalpeer.cpp	2012-11-07 20:19:09.000000000 +0100
@@ -48,6 +48,7 @@
 #include "qtlocalpeer.h"
 #include <QtCore/QCoreApplication>
 #include <QtCore/QTime>
+#include <unistd.h>
 
 #if defined(Q_OS_WIN)
 #include <QtCore/QLibrary>
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sat May 10, 2014 5:39 pm

Hi,

here are the ebuilds for telldus-core-2.1.2 and telldus-gui-2.1.2.

First the patch file for telldus-core:
telldus-core-2.1.2_remove_doxygen.patch

Code: Select all

--- CMakeLists.txt.orig	2014-05-10 18:44:44.665917160 +0200
+++ CMakeLists.txt	2014-05-10 18:45:07.757916517 +0200
@@ -55,21 +55,3 @@
 
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)
-
-FIND_PACKAGE(Doxygen)
-
-IF(DOXYGEN_FOUND)
-	SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
-
-	CONFIGURE_FILE(
-		"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
-		${DOXY_CONFIG} @ONLY
-	)
-
-	ADD_CUSTOM_TARGET(docs
-		${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG}
-		DEPENDS ${DOXY_CONFIG}
-		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-		COMMENT "Generating doxygen documentation" VERBATIM
-	)
-ENDIF() 
and then the ebuild:
telldus-core-2.1.2.ebuild

Code: Select all

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/dev-util/telldus-core/telldus-core-2.1.2.ebuild 2012/05/04 $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Core library for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	dev-embedded/libftdi
	dev-libs/confuse
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.2_remove_doxygen.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog "Caution - the build does only work with -j1"
} 
These files should be placed under dev-util/telldus-core/




And now the patch file for telldus-gui:
telldus-core-2.1.2_fix_wrong_ftdi_reference.patch

Code: Select all

--- Plugins/Controllers/CMakeLists.txt.orig	2014-03-31 12:30:09.000000000 +0200
+++ Plugins/Controllers/CMakeLists.txt	2014-04-18 17:26:12.000000000 +0200
@@ -45,8 +45,8 @@
 	tellstick_duo.png
 )
 
-FIND_LIBRARY(FTD2XX_LIBRARY ftd2xx)
+FIND_LIBRARY(FTD2XX_LIBRARY ftdi)
 FIND_PACKAGE(TelldusCore REQUIRED)
-SET( Plugin_LIBRARIES ${TELLDUSCORE_LIBRARY} ${FTD2XX_LIBRARY} )
+SET( Plugin_LIBRARIES ${TELLDUSCORE_LIBRARY} ${FTD2XX_LIBRARY} )
 
 INCLUDE( ../TelldusCenterPlugin.cmake NO_POLICY_SCOPE ) 
and at last the ebuild for telldus-gui
telldus-gui-2.1.2.ebuild

Code: Select all

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/app-misc/telldus-gui/telldus-gui-2.1.2.ebuild 2012/05/04 $

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils
inherit qt4-r2

DESCRIPTION="Gui for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-gui/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64"
IUSE=""

RDEPEND="dev-util/telldus-core"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.2_fix_wrong_ftdi_reference.patch
}

src_configure() {
	qmake "${S}"/3rdparty/qt-components-desktop
	cmake-utils_src_configure
}

src_compile() {
	cd "${S}"/3rdparty/qt-components-desktop
	emake -j1 || die "make failed"
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

src_install() {
	cd "${CMAKE_BUILD_DIR}"
	emake DESTDIR="${D}" install || die "Install failed"
	cd "${S}"/3rdparty/qt-components-desktop
	qt4-r2_src_install

}
These files should be placed under app-misc/telldus-gui
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sat Jun 07, 2014 7:52 pm

Hi,

when I used the telldus-core-2.1.2.ebuild to set up a new Raspberry Pi system I discovered that the ebuild also depends on threads.

Here is the updated ebuild:

Code: Select all

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: Telldus-core 2014/06/07 21:08:10$

EAPI="4"
RESTRICT="primaryuri"

inherit cmake-utils

DESCRIPTION="Cli for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm ~x86"
LDFLAGS="-lpthread"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	dev-embedded/libftdi
	dev-libs/confuse
	virtual/pkgconfig
	dev-util/cmake
	dev-libs/libpthread-stubs"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_missing_include.patch
	epatch "${FILESDIR}"/telldus-core-2.1.1_fix_wrong_udev_location.patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog "Caution - the build does only work with -j1"
}
Top
Nimo
Tux's lil' helper
Tux's lil' helper
Posts: 111
Joined: Sun Nov 23, 2003 12:23 pm

  • Quote

Post by Nimo » Sun Mar 22, 2015 9:16 pm

For some reason I had to modify telldus-core-2.1.2_fix_wrong_ftdi_reference.patch into:

Code: Select all

--- Plugins/Controllers/CMakeLists.txt.orig     2015-03-22 12:09:17.265745651 +0100
+++ Plugins/Controllers/CMakeLists.txt  2015-03-22 12:09:35.092888122 +0100
@@ -45,7 +45,7 @@
        tellstick_duo.png
 )

-FIND_LIBRARY(FTD2XX_LIBRARY ftd2xx)
+FIND_LIBRARY(FTD2XX_LIBRARY ftdi)
 FIND_PACKAGE(TelldusCore REQUIRED)
 SET( Plugin_LIBRARIES ${TELLDUSCORE_LIBRARY} ${FTD2XX_LIBRARY} )
to get it to emerge correctly.
//Nimo
Top
Nimo
Tux's lil' helper
Tux's lil' helper
Posts: 111
Joined: Sun Nov 23, 2003 12:23 pm

  • Quote

Post by Nimo » Sun Mar 22, 2015 9:18 pm

Where is a good place to upload tarball of the ebuild files+patches to save some hour of work for the next person having the same problems?
//Nimo
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sat Jan 27, 2018 6:51 pm

Hi,

here are updated ebuild files for telldus-core source code.

We need tree patchfiles:
telldus-core-2.1.2_narrowing_Ikea_patch

Code: Select all

--- service/ProtocolIkea-org.cpp	1970-01-01 01:00:00.000000000 +0100
+++ service/ProtocolIkea.cpp	2014-03-31 12:30:09.000000000 +0200
@@ -23,7 +23,7 @@
 
 std::string ProtocolIkea::getStringForMethod(int method, unsigned char level, Controller *) {
 	const char B1[] = {84, 84, 0};
-	const char B0[] = {170, 0};
+	const char B0[] = {-86, 0};
 
 	int intSystem = this->getIntParameter(L"system", 1, 16)-1;
 	int intFadeStyle = TelldusCore::comparei(this->getStringParameter(L"fade", L"true"), L"true");
telldus-core-2.1.2_narrowing_X10_patch

Code: Select all

--- service/ProtocolX10-org.cpp	2018-01-27 19:34:25.000000000 +0100
+++ service/ProtocolX10.cpp	2018-01-27 19:26:02.000000000 +0100
@@ -22,7 +22,7 @@
 std::string ProtocolX10::getStringForMethod(int method, unsigned char data, Controller *controller) {
 	const unsigned char S = 59, L = 169;
 	const char B0[] = {S, S, 0};
-	const char B1[] = {S, L, 0};
+	const char B1[] = {S, (char)L, 0};
 	const unsigned char START_CODE[] = {'S', 255, 1, 255, 1, 255, 1, 100, 255, 1, 180, 0};
 	const unsigned char STOP_CODE[] = {S, 0};
telldus-core-2.1.2_remove_doxygen.patch

Code: Select all

--- CMakeLists.txt.orig	2014-05-10 18:44:44.665917160 +0200
+++ CMakeLists.txt	2014-05-10 18:45:07.757916517 +0200
@@ -55,21 +55,3 @@
 
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)
-
-FIND_PACKAGE(Doxygen)
-
-IF(DOXYGEN_FOUND)
-	SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
-
-	CONFIGURE_FILE(
-		"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
-		${DOXY_CONFIG} @ONLY
-	)
-
-	ADD_CUSTOM_TARGET(docs
-		${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG}
-		DEPENDS ${DOXY_CONFIG}
-		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-		COMMENT "Generating doxygen documentation" VERBATIM
-	)
-ENDIF()
and then have the ebuild file telldus-core-2.1.2.ebuild

Code: Select all

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/dev-util/telldus-core/telldus-core-2.1.2.ebuild 2012/05/04 $

EAPI="5"
RESTRICT="primaryuri"

inherit cmake-utils multilib

DESCRIPTION="Core library for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-core/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64 ~arm"
LDFLAGS="-lpthread" 
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	dev-embedded/libftdi
	dev-libs/confuse
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.2_remove_doxygen.patch
	epatch "${FILESDIR}"/telldus-core-2.1.2_narrowing_X10_patch
	epatch "${FILESDIR}"/telldus-core-2.1.2_narrowing_Ikea_patch
}

src_configure() {
	cmake-utils_src_configure
}

src_compile() {
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

src_install() {
    cmake-utils_src_install
 
    # Do not violate multilib strict
    mv "${ED}/usr/lib" "${ED}/usr/$(get_libdir)" || die "mv failed"
}

pkg_postinst() {
	elog "Configure your devices by editing the /etc/tellstick.conf file"
	elog "Start /usr/sbin/telldusd before use of service"
	elog "Caution - the build does only work with -j1"
}
This ebuild have been tested on amd64 system with profile
default/linux/amd64/17.0/desktop/plasma/systemd (stable)
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sat Jan 27, 2018 8:07 pm

Here are the ebuild for telldus-gui source code.

We need one patch file telldus-core-2.1.2_fix_wrong_ftdi_reference.patch

Code: Select all

--- Plugins/Controllers/CMakeLists.txt.orig	2014-03-31 12:30:09.000000000 +0200
+++ Plugins/Controllers/CMakeLists.txt	2014-04-18 17:26:12.000000000 +0200
@@ -45,8 +45,8 @@
 	tellstick_duo.png
 )
 
-FIND_LIBRARY(FTD2XX_LIBRARY ftd2xx)
+FIND_LIBRARY(FTD2XX_LIBRARY ftdi)
 FIND_PACKAGE(TelldusCore REQUIRED)
-SET( Plugin_LIBRARIES ${TELLDUSCORE_LIBRARY} ${FTD2XX_LIBRARY} )
+SET( Plugin_LIBRARIES ${TELLDUSCORE_LIBRARY} ${FTD2XX_LIBRARY} )
 
 INCLUDE( ../TelldusCenterPlugin.cmake NO_POLICY_SCOPE )
and the ebuild file telldus-gui-2.1.2.ebuild

Code: Select all

# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/app-misc/telldus-gui/telldus-gui-2.1.2.ebuild 2012/05/04 $

EAPI="5"
RESTRICT="primaryuri"

inherit cmake-utils multilib
inherit qt4-r2

DESCRIPTION="Gui for tellstick house automation transmitter/reciever"
HOMEPAGE="http://www.telldus.se/"
SRC_URI="http://download.telldus.se/TellStick/Software/telldus-gui/${P}.tar.gz"
SLOT="0"
LICENSE="LGPL-2"
KEYWORDS="~amd64"
IUSE=""

RDEPEND="dev-util/telldus-core"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	dev-util/cmake"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.2_fix_wrong_ftdi_reference.patch
}

src_configure() {
	qmake "${S}"/3rdparty/qt-components-desktop
	cmake-utils_src_configure
}

src_compile() {
	cd "${S}"/3rdparty/qt-components-desktop
	emake -j1 || die "make failed"
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}

src_install() {
	cd "${CMAKE_BUILD_DIR}"
	emake DESTDIR="${D}" install || die "Install failed"
		
	# Do not violate multilib strict
    mv "${ED}/usr/lib" "${ED}/usr/$(get_libdir)" || die "mv failed"
    
	cd "${S}"/3rdparty/qt-components-desktop
	qt4-r2_src_install
}
Top
Hu
Administrator
Administrator
Posts: 24395
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Jan 27, 2018 10:46 pm

arnelj wrote:

Code: Select all

EAPI="5"

src_prepare() {
	epatch "${FILESDIR}"/telldus-core-2.1.2_fix_wrong_ftdi_reference.patch
}
If you bump to EAPI=6, you can omit src_prepare and instead list the patch(es) in global variable PATCHES. See EAPI 6.
arnelj wrote:

Code: Select all

src_compile() {
	cd "${S}"/3rdparty/qt-components-desktop
	emake -j1 || die "make failed"
	cd "${CMAKE_BUILD_DIR}"
	emake -j1 || die "make failed"
}
You could simplify this by using -C directory to emake instead of a separate cd.

Why does the emake calls need -j1? That is usually a bug in the upstream build. Where possible, the bug should be documented so that future maintainers can easily check whether it still applies.
arnelj wrote:

Code: Select all

src_install() {
	# Do not violate multilib strict
    mv "${ED}/usr/lib" "${ED}/usr/$(get_libdir)" || die "mv failed"
Why not patch the build to install the files in the right place, rather than move them afterward?
Top
arnelj
n00b
n00b
Posts: 45
Joined: Thu Jan 08, 2004 6:31 pm
Location: Uppsala, Sweden

  • Quote

Post by arnelj » Sun Jan 28, 2018 6:34 pm

Hi,

thank you for your proposals.

I have tried to implement the them but I have not succeeded with all of them.
I cannot use EAPI="6" in the telldus-gui-2.1.2.ebuild because it uses "qt4-r2_src_install" and that is not compatible with EAPI="6".

The use of -C directory in the emake does work.

The original build files are not so easy to understand so the easiest way to make it work is to move the files afterwards.

For some reason the source code can only be compiled with -j1. The source code is not maintained so the easiest way to solve the problem is to set the -j flag in the .ebuild.
Top
Post Reply

15 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic