D29847: Fixes compile problem for freebsd because of missing crypt.h

Méven Car noreply at phabricator.kde.org
Mon Jun 15 12:34:47 BST 2020


meven added a comment.


  In D29847#674811 <https://phabricator.kde.org/D29847#674811>, @usta wrote:
  
  > In D29847#674807 <https://phabricator.kde.org/D29847#674807>, @adridg wrote:
  >
  > > 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.

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D29847

To: usta, #plasma, bcooksley, ngraham, adridg, #freebsd
Cc: meven, tcberner, adridg, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, arrowd, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200615/f6c1612b/attachment.htm>


More information about the Plasma-devel mailing list