Page 1 of 1

telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by tingo
I'm trying to compile telldus-core 2.1.2 under FreeBSD 8.4-stable (FWIW, telldus-core 2.1.1 compiles and works without problems):

Code: Select all

tingo@kg-v2$ uname -a
FreeBSD kg-v2.kg4.no 8.4-STABLE FreeBSD 8.4-STABLE #7 r256430: Sun Oct 13 19:43:35 CEST 2013
     root@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
It chokes early, on cmake:

Code: Select all

tingo@kg-v2$ pwd
/home/tingo/work/telldus-core-2.1.2
tingo@kg-v2$ cmake .
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28")
-- checking for one of the modules 'libftdi'
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.3.1")
CMake Error: File /home/tingo/work/telldus-core-2.1.2/Doxyfile.in does not exist.
CMake Error at CMakeLists.txt:64 (CONFIGURE_FILE):
  configure_file Problem configuring file


-- Configuring incomplete, errors occurred!
Is this a bug, or user error (I'm not a CMake expert)?

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
You could probably get the file from here:
http://developer.telldus.com/export/434 ... oxyfile.in

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by tingo
Ok, with the missing file in place, cmake works:

Code: Select all

tingo@kg-v2$ cmake .
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28") 
-- checking for one of the modules 'libftdi'
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.3.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tingo/work/telldus-core-2.1.2
but now make complains:

Code: Select all

tingo@kg-v2$ make
[  1%] Building CXX object common/CMakeFiles/TelldusCommon.dir/Socket_unix.cpp.o
/home/tingo/work/telldus-core-2.1.2/common/Socket_unix.cpp: In member function 'void TelldusCore::Socket::connect(const std::wstring&)':
/home/tingo/work/telldus-core-2.1.2/common/Socket_unix.cpp:64: error: 'SOCK_CLOEXEC' was not declared in this scope
*** Error code 1

Stop in /usr/home/tingo/work/telldus-core-2.1.2.
*** Error code 1

Stop in /usr/home/tingo/work/telldus-core-2.1.2.
*** Error code 1

Stop in /usr/home/tingo/work/telldus-core-2.1.2.
Not sure why (it worked with 2.1.1)

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by micke.prag

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by jstrom
Hi there!

I just got a fully working FreeBSD port which handles config-files, devd rules and the whole she-bang.. I think.

All patches from https://github.com/telldus/telldus/pull/6 and https://github.com/telldus/telldus/pull/8 are "baked in", plus rc.d script.

The attached file is a "shell archive", standard way to transfer sources.

How to use (assuming pkgng system, and /root/telldus-core.shar.gz):

gzip -d /root/telldus-core.shar.gz
cd /usr/ports/comms
mkdir telldus-core
cd telldus-core
sh /root/telldus-core.shar
make package
pkg add /usr/ports/packages/All/telldus-core-2.1.2.txz

Have been tested on FreeBSD 9.2, I think it works on 8.4 as well. Not sure on 10.x, but I'm quite sure it does not work due to clang.. A friend of mine did some hacking and patched away some tr1 includes (tr1/memory -> memory) and namespacing, since those are default.. But I got nothing proper for that, don't have a 10.x box to play with.

Let me know how it works!

(Edit: file just updated with minor fixes but I dont think anyone snatched it yet.. :))

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by tingo
micke.prag wrote:You may try these pathes:
https://github.com/telldus/telldus/pull/6
Aha, OK. My simplistic try with

Code: Select all

tingo@kg-v2$ git pull https://github.com/telldus/telldus/pull/6/
fatal: Not a git repository (or any parent up to mount point /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
didn't work.
Is there a how-to / writeup anywhere on how I might add patches from github (or another repository) to my local directory tree (which came from an archive, not from git <something>)?

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by jstrom
tingo wrote:
micke.prag wrote:You may try these pathes:
https://github.com/telldus/telldus/pull/6
Aha, OK. My simplistic try with

Code: Select all

tingo@kg-v2$ git pull https://github.com/telldus/telldus/pull/6/
fatal: Not a git repository (or any parent up to mount point /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
didn't work.
Is there a how-to / writeup anywhere on how I might add patches from github (or another repository) to my local directory tree (which came from an archive, not from git <something>)?
You want to do git clone rather than git pull. But if you are no developer, I'd suggest to try the freebsd port I posted above, rather than trying my patches manually. Much easier!

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by tingo
It might be easier, but I am also trying to learn a few things as well. I figure git isn't going away soon, so I will be better off if I learn how to use it. I'm not there yet:

Code: Select all

tingo@kg-v2$ pwd
/home/tingo/work/telldus-core-2.1.2
tingo@kg-v2$ git clone https://github.com/telldus/telldus/pull/6/
Cloning into '6'...
fatal: repository 'https://github.com/telldus/telldus/pull/6/' not found
tingo@kg-v2$ git clone https://github.com/telldus/telldus/pull/6
Cloning into '6'...
fatal: repository 'https://github.com/telldus/telldus/pull/6/' not found
Surely, there must be a way to add git patches to a local directory that isn't a git repository?

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by patrikg
There are many places to read online how to do.
Like this one:
http://stackoverflow.com/questions/1494 ... ll-request

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by jstrom
Learning is always good :) Here are some pointers to get started:

The link is to an actual pull request, which means a request to merge changes in my git repo, into the telldus master repo.
My repo, with the changes, is at https://github.com/stromnet/telldus/. The branch with the fixes is fbsd-fix (https://github.com/stromnet/telldus/tree/fbsd-fix)
To checkout this code, you first obtain the HTTP clone URL for my repo: "https://github.com/stromnet/telldus.git". When this has been cloned, you change to the freebsd-fix branch by issuing "git checkout fbsd-fix". If you run "git log" you should see the same list of commits as you can see in the pull request (https://github.com/telldus/telldus/pull/6/commits).

To actually apply the patches yourself, clone the telldus repo (from which my is forked), and go through each patch and apply them. Not sure how to view the raw diffs on github, but if you checkout my fork, and the freebsd branch, you can get the diffs by doing "git diff master..fbsd-fix".

Edit: just realized you asked how to apply patches on the raw source.. let's leave that as an exercise, "git diff" from above and "patch" are you friends.. :)

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by jstrom
An update:
The port has now been fixed up with FreeBSD 10.0 support, and has been submitted to ports (not yet accepted/handled): http://www.freebsd.org/cgi/query-pr.cgi?pr=189221

Ref discussions and fixes for 10.0: https://forums.freebsd.org/viewtopic.ph ... 79#p258295

Re: telldus-core 2.1.2 under FreeBSD - fails

Posted: Fri Mar 17, 2023 9:45 am
by jstrom
FYI: http://www.telldus.com/forum/viewtopic.php?f=11&t=4524, port comms/telldus-core now available.