-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
wip: libtypec: init at 0.5.0 (cmake help needed) #270763
base: master
Are you sure you want to change the base?
Conversation
The current best practice seems to be cd into the subdirectory in preConfigure.
There should be some cmake options controlling the rpath handling behavior, if that fails, patchelf is also fine. |
Regarding the
🤔 hmm, ok, that gives me something to (rip)grep for anyway. Thanks @NickCao |
Or split it into two derivations? |
It does sound easier, but I feel like the multi-output support was made for something like this. (Happy to be wrong, I just can't of any nixpkgs pkgs that have two derivations that map to the same source (well, for something small like this anyway). |
I'm no cmake expert, but this works. (so many cmake crimes going on...) diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7f617f..a46f096 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,3 +36,5 @@ configure_file(
install(FILES ${CMAKE_BINARY_DIR}/libtypec.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
+
+add_subdirectory(utils)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index b726a54..87a71e6 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -4,13 +4,13 @@ project(lstypec VERSION 0.4.0)
include(CTest)
enable_testing()
-get_filename_component(libtypec_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
add_executable(lstypec lstypec.c names.c)
add_executable(typecstatus typecstatus.c names.c)
-target_link_libraries(lstypec "${CMAKE_CURRENT_LIST_DIR}/../bin/libtypec.so" udev)
-target_link_libraries(typecstatus "${CMAKE_CURRENT_LIST_DIR}/../bin/libtypec.so" udev)
+target_link_libraries(lstypec libtypec udev)
+target_link_libraries(typecstatus libtypec udev)
+install(TARGETS lstypec typecstatus)
set(CMAKE_C_FLAGS "-g -O2 -fstack-protector-strong -Wformat=1 -Werror=format-security -Wdate-time -fasynchronous-unwind-tables -D_FORTIFY_SOURCE=2")
set(CPACK_PROJECT_NAME ${PROJECT_NAME}) |
74deb13
to
6b332fa
Compare
Thanks @NickCao! That's great. I do still feel a bit weird given that this strikes me as a lib that the author expects to be used in other things, so I feel like this still needs one more pass to split it into |
I took a naive stab at it, but it complains about references in a new commit. I'm also not sure if it should be
|
Updated this to 0.5.0 but it still doesn't naively build with cmake. Going to share this with the upstream author and see if they have ideas. |
0.5.1 is out, does it work? |
Description of changes
Hi, I need help with this.
Out standing issues:
utils
binaries? They link against the local relative path to libtypec, which is incorrect and fails the reference check at the end of the build.Init
libtypec
at0.4.0
.project url: https://github.com/Rajaram-Regupathy/libtypec
description:
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Priorities
Add a 👍 reaction to pull requests you find important.