Freebsd compile is not working last 17 days because of missing crypt.h
crypt method is in unistd.h for freebsd so we dont need it
and also I am not sure whether freebsd has crypt.h or not.
can somebody with freebsd try this patch ?
Lint Skipped |
Unit Tests Skipped |
Adding @adridg as a reviewer.
Note that we have moved to Gitlab, so future contributions should be submitted at invent.kde.org. Thanks! You can find the documentation at https://community.kde.org/Infrastructure/GitLab.
kcms/users/src/user.cpp | ||
---|---|---|
23 | wouldn't it be a bit more portable to check for the header file in cmake? (OpenBSD also has the same issue, I would assume from [1]) |
kcms/users/src/user.cpp | ||
---|---|---|
23 | I never think about openbsd , yes you are right about it. So how about if we use something like : |
Sorry i have written one of them twice , so is this aproach wrong ?
#if !defined(Q_OS_UNIX) && !defined(Q_OS_BSD4) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD)
or if this is just for linux think we can make it just directly
if defined(Q_OS_LINUX)
https://invent.kde.org/adridg/plasma-desktop/-/tree/normalize-includes
There's already a CMake-time check for <crypt.h>, it's just not used. (HAVE_CRYPT_H)
@adridg having or not having crypt_h I think won't solve this problem because it looks like Linux needs it on the other hand BSD system doesn't have it and use unistd.h
instead of crypt.h so doesn't we still need to check if the system is linux or not ? I have almost 0 knowledge about bsd systems so i think anyone who has knowledge
on this topic might be more suitable for this patch request. ( at first, I have just think about freebsd and now i can see there are other alternatives (net,open,... bsd has similar issue ) )
Linux will have HAVE_CRYPT_H set and *BSD won't, so this simply solves the issue :
#ifdef HAVE_CRYPT_H #include <crypt.h> #endif
It is used in kscreenlocker/kcheckpass/kcheckpass.h for instance.
kscreenlocker defines HAVE_CRYPT_H as :
set(CRYPT_LIBRARIES) check_library_exists(crypt crypt "" HAVE_CRYPT) if (HAVE_CRYPT) set(CRYPT_LIBRARIES crypt) check_include_files(crypt.h HAVE_CRYPT_H) endif (HAVE_CRYPT)
You will need to add it to plasma-desktop cmake file in the appropriate section.
This review should be closed: a change landed via invent that makes it unnecessary (<crypt.h> is no longer used in the users kcm).