Skip to content

Commit

Permalink
Merge pull request NixOS#276743 from raphaelr/fix/liboqs
Browse files Browse the repository at this point in the history
liboqs: Fix build error
  • Loading branch information
wegank authored Jan 18, 2024
2 parents 9b8cec7 + a35d101 commit b06ff4b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/development/libraries/liboqs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-h3mXoGRYgPg0wKQ1u6uFP7wlEUMQd5uIBt4Hr7vjNtA=";
};

patches = [ ./fix-openssl-detection.patch ];

nativeBuildInputs = [ cmake ];
buildInputs = [ openssl ];

Expand Down
36 changes: 36 additions & 0 deletions pkgs/development/libraries/liboqs/fix-openssl-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 6bdcf53de74ac2afba42deea63522939ca51f871 Mon Sep 17 00:00:00 2001
From: Raphael Robatsch <raphael-git@tapesoftware.net>
Date: Mon, 25 Dec 2023 16:15:29 +0000
Subject: [PATCH] Do not forcibly set OPENSSL_ROOT_DIR.

CMake can already find OpenSSL via pkg-config. Setting OPENSSL_ROOT_DIR
forcibly to "/usr" breaks this.
---
CMakeLists.txt | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 288bcbe8..9750fae6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,17 +119,6 @@ include(.CMake/compiler_opts.cmake)
include(.CMake/alg_support.cmake)

if(${OQS_USE_OPENSSL})
- if(NOT DEFINED OPENSSL_ROOT_DIR)
- if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
- if(EXISTS "/usr/local/opt/openssl@1.1")
- set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@1.1")
- elseif(EXISTS "/opt/homebrew/opt/openssl@1.1")
- set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl@1.1")
- endif()
- elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
- set(OPENSSL_ROOT_DIR "/usr")
- endif()
- endif()
find_package(OpenSSL 1.1.1 REQUIRED)
endif()

--
2.42.0

0 comments on commit b06ff4b

Please sign in to comment.