-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packaging: Fix debian packaging #485
Conversation
Acked. Is DH_VERBOSE intended or just a misstake? |
Looks like a left-over from troubleshooting. I'm doing this in a terrible rush switching from day-job so these are expected ;( And it looks like installing configs to /etc/ broke cpack somehow. I wonder if @xor-gate came across this one in the past. Meanwhile I'll see if I can fix it. |
That should hopefully work-around the remaining problems |
@xor-gate Could you look at CMakeLists.txt changes that break cpack and hence the travis build run? The only way I found to workaround failing installation of configs to etc is to add an optional parameter when running cmake, e,g. cmake -DINSTALL_UDEV_RULES=yes. Perhaps you know a cleaner solution. |
You should probably use something like: |
The debian packaging works nicely, dh calls cmake with -DCMAKE_PREFIX=/usr and later uses DESTDIR= when installing and cmake handles all of that nicely. |
I will investigate why it fails in the upcoming week! |
Default build wants to install to CMAKE_PREFIX, but this change does not respect this variable.
Maybe it is better to keep documented behavior for sandbox and direct install, to install udev rules and modconfig by hand. For debian package we can do in debian/rules. |
I had a busy week, will take a look this weekend. |
I have a patch which also installs modprobe, udev only for linux: diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc00d18..b9fe67d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,12 +127,12 @@ install(TARGETS st-flash st-info
RUNTIME DESTINATION bin
)
-if (UNIX AND (NOT CPACK_GENERATOR))
+if (LINUX)
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
install(FILES etc/modprobe.d/stlink_v1.conf
- DESTINATION /etc)
+ DESTINATION etc)
install(FILES ${RULES_FILES}
- DESTINATION /lib/udev/rules.d/)
+ DESTINATION lib/udev/rules.d)
endif()
add_subdirectory(src/gdbserver) The cmake documentation states:
|
Sounds like it would install the files under /usr/etc and /usr/lib/udev. Anyway I would prefer to keep normal cmake install as it is documented, so only debian packager knows about module config and udev rules installation to /lib. Hopefully I can spends some time today. |
It is likely for distro package maintainers to have a different guidelines for installing modprobe and udev helper files. I know it is not the best way to go how my patch works, it would be better to have seperate paths in the cmake file then. |
You mean something like a switch for install directory. |
Probably we should not apply my patch. As on the cmake mailing list they say:
So that mean when setting CPACK_SET_DESTDIR we should be good to go for travis/cpack builds ( And the pack doc says exactly what we need:
We need an absolute destination for this. |
Seems this way is a dead road. |
Now I have a real patch which works (on top of this pull request): @nekromant could you cherry-pick my commit into your PR and check if it works? When good you can update the pull request, squash-merge and then we should be able to close this. |
Files didn´t get installed. Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "None"
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/lib/x86_64-linux-gnu/libstlink.so.1.3.0
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/lib/x86_64-linux-gnu/libstlink.so.1
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/lib/x86_64-linux-gnu/libstlink.so
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/lib/x86_64-linux-gnu/libstlink.a
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-flash
-- Removed runtime path from "/home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-flash"
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-info
-- Removed runtime path from "/home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-info"
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-util
-- Removed runtime path from "/home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/st-util"
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/stlink-gui
-- Removed runtime path from "/home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/bin/stlink-gui"
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/share/stlink/stlink-gui.ui
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/stlink.pc
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/commands.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/logging.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/usb.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/chipid.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/backend.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/reg.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/sg.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/flash_loader.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/mmap.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/include/x86_64-linux-gnu/stlink/version.h
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/share/man/man1/st-util.1
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/share/man/man1/st-flash.1
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/share/man/man1/st-info.1
-- Installing: /home/osterlad/buildbox/stlink/stlink-nekromant/debian/tmp/usr/share/man/man1/st-term.1
make[1]: Leaving directory `/home/osterlad/buildbox/stlink/stlink-nekromant/obj-x86_64-linux-gnu'
dh_install -O--buildsystem=cmake
dh_install: libstlink missing files (lib/udev/rules.d/*.rules), aborting |
I'm not sure but I have not change the normal |
It´s because of your change to CMakeLists.txt: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 01f7147..bc00d18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,7 +127,7 @@ install(TARGETS st-flash st-info
RUNTIME DESTINATION bin
)
-if (LINUX)
+if (UNIX AND (NOT CPACK_GENERATOR))
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
install(FILES etc/modprobe.d/stlink_v1.conf
DESTINATION /etc) And it works ;-) Why do you want to change this line? |
I'm running mostly on a mac (main machine) and I have forgotten We should probably replace it by:
|
@OsterlaD DESTINATION /etc breaks cpack packaging ;( I think the only less dirty solution would be to skip the installation to /etc when running cpack, perhaps only install the configs when -DSTLINK_INSTALL_ETC=yes is passed to cmake |
I prefer cpack packaging as you can create zipfile,debfile,rpm just with one tool. I would like not to make any difference in the |
@nekromant I guess you mean @xor-gate |
@nekromant do you agree to the changes suggested by @xor-gate? |
…system The top-level makefile that was used to drive cmake broke the autodetection of the used buildsystem by debhelper. This commit fixes it and moves most of the installation stuff to CMakeLists.txt to keep debian/ folder contents to the bare minimum. Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
156c3ca
to
650a88a
Compare
That should be it, packaging works once again. Everything's merged into one commit |
Looks good to me. And the Mac/Linux travis build seems to be satisfied 👍 |
Looks good. |
Finally :+), thanks guys. |
The sole reason debian packaging got broken - the addition of the toplevel makefile broke debhelper's autodetection. This patchset does the following:
This pretty much passes most of the lintian checks, the remaining are:
But these are easy to fix and are only relevant if we're going to integrate it to debian (I'm not a debian maintainer myself, don't know any debian maintainers, so I can't help out with this task). @xor-gate, @OsterlaD, comments are welcome.