diff --git a/CMakeModules/FindCrypt.cmake b/CMakeModules/FindCrypt.cmake index 293228e6f..d17d70178 100644 --- a/CMakeModules/FindCrypt.cmake +++ b/CMakeModules/FindCrypt.cmake @@ -5,19 +5,30 @@ # LIBCRYPT_LIBRARY, the path to libcrypt # LIBCRYPT_FOUND, whether libcrypt was found +if( CMAKE_SYSTEM MATCHES "FreeBSD" ) + # FreeBSD has crypt(3) declared in unistd.h, which lives in + # libc; the libcrypt found here is not used. + find_path( CRYPT_INCLUDE_DIR NAMES unistd.h ) + add_definitions( -DNO_CRYPT_H ) +else() + find_path( CRYPT_INCLUDE_DIR + NAMES crypt.h + HINTS + ${CMAKE_INSTALL_INCLUDEDIR} + NO_CACHE + ) +endif() -find_path( CRYPT_INCLUDE_DIR NAMES crypt.h - HINTS - ${CMAKE_INSTALL_INCLUDEDIR} -) - -find_library( CRYPT_LIBRARIES NAMES crypt +find_library( CRYPT_LIBRARIES + NAMES crypt HINTS ${CMAKE_INSTALL_LIBDIR} ) include( FindPackageHandleStandardArgs ) -find_package_handle_standard_args( Crypt - REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR ) +find_package_handle_standard_args( + Crypt + REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR +) mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES ) diff --git a/src/modules/users/CMakeLists.txt b/src/modules/users/CMakeLists.txt index 116da68e4..074118d54 100644 --- a/src/modules/users/CMakeLists.txt +++ b/src/modules/users/CMakeLists.txt @@ -5,7 +5,7 @@ if( ECM_FOUND ) endif() find_package( Qt5 COMPONENTS Core Test REQUIRED ) -find_package( Crypt ) +find_package( Crypt REQUIRED ) include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ) diff --git a/src/modules/users/SetPasswordJob.cpp b/src/modules/users/SetPasswordJob.cpp index a077d8cb5..d917e6d5f 100644 --- a/src/modules/users/SetPasswordJob.cpp +++ b/src/modules/users/SetPasswordJob.cpp @@ -27,7 +27,11 @@ #include #include + +#ifndef NO_CRYPT_H #include +#endif +#include SetPasswordJob::SetPasswordJob( const QString& userName, const QString& newPassword )