Closed Petross404 closed 3 years ago
@Petross404 I am relying on you - haven't tested at all. :smile: Once you confirm it's working, please close the issue.
I'll try to make RPi release later today.
@Petross404 I am relying on you - haven't tested at all. smile Once you confirm it's working, please close the issue.
I'll try to make RPi release later today.
Ok I will right now. I will test the master and if it works I will create a small patch to work with the ebuild for version 4.0.
Silly me, I hadn't tested the proposed variable (VERSION
) and it's not suitable. In fact what is needed is ${PROJECT_VERSION}
.
Never mind, I will clone the repo and make a PR later because I suspect further issues with FHS down the road. Thank you and sorry :)
Before I commit something you don't like, I want to ask you here a few questions.
1) Pigpio is working only on arm platforms such as RPi because it needs a specific Broadcom chip for gpio functionality. Such thing doesn't exist on a typical x86 Linux pc (even with gpio breakout boards like adafruit's). I have tried and failed to use pigpio on my pc.
Do you mind if the build system prints something like this to inform the user?
/mnt/Volume_3/Gentoo/projects/CPlus/gpio.git/build> /usr/bin/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug /mnt/Volume_3/Gentoo/projects/CPlus/gpio.git
CMake Warning at CMakeLists.txt:24 (message):
PiGPIO is functional only on Arm/RasperyPi platforms!
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/Volume_3/Gentoo/projects/CPlus/gpio.git/build
*** Finished ***
Code:
option(BUILD_PIGPIO "Build pigpio backend" ON)
if(BUILD_PIGPIO)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
message(WARNING "PiGPIO is functional only on Arm/RasberyPi platforms!")
endif()
# Maybe use this? : find_package(pigpio REQUIRED)
add_subdirectory(pigpio)
endif(BUILD_PIGPIO)
2) Do you mind to include(GNUInstallDirs)
? This way cmake won't use hardcoded install paths but rather will detect them and will act accordingly. More info here. The code will be like:
# install
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR})
3) You are recommending cpp Asio but a) Don't find any package for it b) S.O. proposes using Boost.Asio since Asio is developed in Boost since some time. I don't know anything on the matter, it's totally on you :) .
All the best, Petros
Silly me, I hadn't tested the proposed variable (
VERSION
) and it's not suitable. In fact what is needed is${PROJECT_VERSION}
.Never mind, I will clone the repo and make a PR later because I suspect further issues with FHS down the road. Thank you and sorry :)
OK I rolled back the changes. Hopefully no one noticed. :laughing:
- Pigpio is working only on arm platforms such as RPi because it needs a specific Broadcom chip for gpio functionality. Such thing doesn't exist on a typical x86 Linux pc (even with gpio breakout boards like adafruit's). I have tried and failed to use pigpio on my pc.
IMHO it should just be a dependent option which depends on ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm"
. In other words it would only be available on ARM platforms.
- Do you mind to
include(GNUInstallDirs)
? This way cmake won't use hardcoded install paths...
I don't mind.
- You are recommending cpp Asio but a) Don't find any package for it
Gentoo: dev-cpp/asio
.
Ubuntu: libasio-dev
.
b) S.O. proposes using Boost.Asio since Asio is developed in Boost since some time. I don't know anything on the matter, it's totally on you :) .
Asio has been included in Boost a while ago, but it's also available as a standalone library. I am not a big fan of adding dependency on boost, so I went with the standalone version.
I agree with you on dependent option for pigpio. Also, when I was writing about asio I meant that your cmakelists should use find_package(...
, I 've already installed asio ;) And finally I am not a fun of a huge dependency like Boost either.
So, as of now I will stick with GnuInstallDirs :)
Yeah, I have to continue what I started here. I will get it ready in the next few days.
It's here but a few problems remain.
a) I can't find a solution on how cmake will search for asio during configuration. Anything I found is about boost. b) Ebuilds are supposed to be the same across all platforms. This one doesn't enable pigpio while on arm pigpio will be unconditionally enabled.
Anyway, I can't find an alternative.
a) You had a typo in find_library
.
b) Add a USE flag that is platform dependent. It's been a while since I've used Gentoo, but it should be possible.
@Petross404 I've switched to GNUInstallDirs
and made BUILD_PIGPIO
option platform-dependent. Please test version 4.1 and let me know if that works for you.
NB: On my box CMAKE_INSTALL_DOCDIR
still expands to /usr/share/doc/gpio++
without the version number. YMMV.
Closing for now. Please reopen as needed.
Hello, I recently found your library and I want to experiment with it and my adafruit board. I am installing gpio (maybe gpio++ or cppgpio would describe the lib better among all the others for gpio programming?) with portage on Gentoo since I don't want to mess my system.
The thing is that I get an error about violating the FHS policy paths:
Now, looking at other examples inside
/usr/share/doc/
I see this convention:All of these packages install their documentation inside a directory which has the version number too. Like
/usr/share/doc/gpio++-${VERSION}
. I think this line should change as:From :
To:
So if ever my ebuild gets in the main portage tree, it will not deal with FHS shortcomings. Thank you from your time.