From 0b94324170bf51b71e1ed6e893689262befc9bdd Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Thu, 14 Nov 2024 11:25:59 +0800 Subject: [PATCH] libnick: new port in devel --- devel/libnick/Portfile | 52 ++++ ...01-CMakeLists-improve-platform-logic.patch | 54 ++++ ...communicator.cpp-add-missing-cstring.patch | 20 ++ .../0002-Allow-using-libsecret-on-macOS.patch | 240 ++++++++++++++++++ ...r.cpp-provide-kFSEventStream-values-.patch | 32 +++ ...03-suspendinhibitor.cpp-fix-for-10.7.patch | 38 +++ 6 files changed, 436 insertions(+) create mode 100644 devel/libnick/Portfile create mode 100644 devel/libnick/files/0001-CMakeLists-improve-platform-logic.patch create mode 100644 devel/libnick/files/0001-interprocesscommunicator.cpp-add-missing-cstring.patch create mode 100644 devel/libnick/files/0002-Allow-using-libsecret-on-macOS.patch create mode 100644 devel/libnick/files/0002-filesystemwatcher.cpp-provide-kFSEventStream-values-.patch create mode 100644 devel/libnick/files/0003-suspendinhibitor.cpp-fix-for-10.7.patch diff --git a/devel/libnick/Portfile b/devel/libnick/Portfile new file mode 100644 index 0000000000000..0b27ca3822f04 --- /dev/null +++ b/devel/libnick/Portfile @@ -0,0 +1,52 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup boost 1.0 +PortGroup cmake 1.1 +PortGroup conflicts_build 1.0 +PortGroup github 1.0 +PortGroup openssl 1.0 + +boost.version 1.81 + +github.setup NickvisionApps libnick 2024.10.0 +revision 0 +categories devel +license GPL-3 +maintainers nomaintainer +description Cross-platform base for native Nickvision applications +long_description {*}${description} +checksums rmd160 bff651923b8f1acb368d6d3de24222d50c7dbf55 \ + sha256 6117aae500f6932422da9305762b5968556b0b17e9808356e39bfb837a1c5e64 \ + size 2570119 +github.tarball_from archive + +depends_build-append \ + port:gtest \ + port:maddy-parser \ + path:bin/pkg-config:pkgconfig + +depends_lib-append port:curl \ + path:lib/pkgconfig/glib-2.0.pc:glib2 \ + port:gettext-runtime + +if {${os.platform} ne "darwin" || ${os.major} < 12} { + depends_lib-append \ + port:libsecret + configure.args-append \ + -DUSE_LIBSECRET=ON +} + +compiler.cxx_standard 2020 + +# https://github.com/NickvisionApps/libnick/commit/ccd774186829414bfccdfa5d028ae4622c3a4bb7 +patchfiles-append 0001-CMakeLists-improve-platform-logic.patch \ + 0002-Allow-using-libsecret-on-macOS.patch + +# https://github.com/NickvisionApps/libnick/commit/aca9e1c2d3124b4bf58cdb078b82bec318da5d5f +patchfiles-append 0001-interprocesscommunicator.cpp-add-missing-cstring.patch \ + 0002-filesystemwatcher.cpp-provide-kFSEventStream-values-.patch \ + 0003-suspendinhibitor.cpp-fix-for-10.7.patch + +# https://github.com/NickvisionApps/libnick/issues/50 +conflicts_build boost diff --git a/devel/libnick/files/0001-CMakeLists-improve-platform-logic.patch b/devel/libnick/files/0001-CMakeLists-improve-platform-logic.patch new file mode 100644 index 0000000000000..e444f98bc06e5 --- /dev/null +++ b/devel/libnick/files/0001-CMakeLists-improve-platform-logic.patch @@ -0,0 +1,54 @@ +From 4dd284f47f0ebea88b125e942d6b3b6cfd5188ad Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Thu, 14 Nov 2024 09:54:25 +0800 +Subject: [PATCH] CMakeLists: improve platform logic + +--- + CMakeLists.txt | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git CMakeLists.txt CMakeLists.txt +index db21563..6eb5334 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -94,8 +94,12 @@ endif() + if(WIN32) + find_package(sqlcipher CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC sqlcipher::sqlcipher Advapi32 Dnsapi Dwmapi Gdiplus Kernel32 Shell32 UxTheme) +-elseif(LINUX) ++elseif(APPLE) + set(THREADS_PREFER_PTHREAD_FLAG ON) ++ find_library(CF_LIBRARY CoreFoundation) ++ find_library(CS_LIBRARY CoreServices) ++ find_library(IOKIT_LIBRARY IOKit) ++ find_library(SECURITY_LIBRARY Security) + find_package(Threads REQUIRED) + find_package(OpenSSL REQUIRED) + find_package(PkgConfig REQUIRED) +@@ -104,14 +108,9 @@ elseif(LINUX) + pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0) + pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0) + pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0) +- pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1) +- target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret) +-elseif(APPLE) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ${CF_LIBRARY} ${CS_LIBRARY} ${IOKIT_LIBRARY} ${SECURITY_LIBRARY} Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread) ++else() + set(THREADS_PREFER_PTHREAD_FLAG ON) +- find_library(CF_LIBRARY CoreFoundation) +- find_library(CS_LIBRARY CoreServices) +- find_library(IOKIT_LIBRARY IOKit) +- find_library(SECURITY_LIBRARY Security) + find_package(Threads REQUIRED) + find_package(OpenSSL REQUIRED) + find_package(PkgConfig REQUIRED) +@@ -120,7 +119,8 @@ elseif(APPLE) + pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0) + pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0) + pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0) +- target_link_libraries(${PROJECT_NAME} PUBLIC ${CF_LIBRARY} ${CS_LIBRARY} ${IOKIT_LIBRARY} ${SECURITY_LIBRARY} Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread) ++ pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1) ++ target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret) + endif() + + #libnick Install diff --git a/devel/libnick/files/0001-interprocesscommunicator.cpp-add-missing-cstring.patch b/devel/libnick/files/0001-interprocesscommunicator.cpp-add-missing-cstring.patch new file mode 100644 index 0000000000000..b7c66260c6ae5 --- /dev/null +++ b/devel/libnick/files/0001-interprocesscommunicator.cpp-add-missing-cstring.patch @@ -0,0 +1,20 @@ +From f33ad59adddfa4b273100533681727954d35db8c Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Thu, 14 Nov 2024 08:16:11 +0800 +Subject: [PATCH] interprocesscommunicator.cpp: add missing cstring + +--- + src/app/interprocesscommunicator.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git src/app/interprocesscommunicator.cpp src/app/interprocesscommunicator.cpp +index 5968cf1..af602e7 100644 +--- src/app/interprocesscommunicator.cpp ++++ src/app/interprocesscommunicator.cpp +@@ -1,5 +1,6 @@ + #include "app/interprocesscommunicator.h" + #include ++#include + #include + #include "helpers/stringhelpers.h" + #ifndef _WIN32 diff --git a/devel/libnick/files/0002-Allow-using-libsecret-on-macOS.patch b/devel/libnick/files/0002-Allow-using-libsecret-on-macOS.patch new file mode 100644 index 0000000000000..f84e0479da1b2 --- /dev/null +++ b/devel/libnick/files/0002-Allow-using-libsecret-on-macOS.patch @@ -0,0 +1,240 @@ +From b26d943e70866f9ddd8f936654fa08b79b7bb2d6 Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Thu, 14 Nov 2024 10:10:48 +0800 +Subject: [PATCH] Allow using libsecret on macOS + +--- + CMakeLists.txt | 14 +++- + src/keyring/systemcredentials.cpp | 114 +++++++++++++++--------------- + 2 files changed, 69 insertions(+), 59 deletions(-) + +diff --git CMakeLists.txt CMakeLists.txt +index 6eb5334..a081708 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -25,6 +25,10 @@ include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + include(CTest) + ++if(APPLE) ++ option(USE_LIBSECRET "Use libsecret on macOS instead of Apple keychain" OFF) ++endif() ++ + #libnick Setup + add_compile_definitions(SQLITE_HAS_CODEC) + if(NOT WIN32) +@@ -99,7 +103,6 @@ elseif(APPLE) + find_library(CF_LIBRARY CoreFoundation) + find_library(CS_LIBRARY CoreServices) + find_library(IOKIT_LIBRARY IOKit) +- find_library(SECURITY_LIBRARY Security) + find_package(Threads REQUIRED) + find_package(OpenSSL REQUIRED) + find_package(PkgConfig REQUIRED) +@@ -108,7 +111,14 @@ elseif(APPLE) + pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0) + pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0) + pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0) +- target_link_libraries(${PROJECT_NAME} PUBLIC ${CF_LIBRARY} ${CS_LIBRARY} ${IOKIT_LIBRARY} ${SECURITY_LIBRARY} Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread) ++ if(USE_LIBSECRET) ++ pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1) ++ add_compile_definitions(APPLE_USE_LIBSECRET) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ${CF_LIBRARY} ${CS_LIBRARY} ${IOKIT_LIBRARY} Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret) ++ else() ++ find_library(SECURITY_LIBRARY Security) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ${CF_LIBRARY} ${CS_LIBRARY} ${IOKIT_LIBRARY} ${SECURITY_LIBRARY} Threads::Threads OpenSSL::SSL OpenSSL::Crypto PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread) ++ endif() + else() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) +diff --git src/keyring/systemcredentials.cpp src/keyring/systemcredentials.cpp +index 76b1994..970490c 100644 +--- src/keyring/systemcredentials.cpp ++++ src/keyring/systemcredentials.cpp +@@ -5,18 +5,18 @@ + #ifdef _WIN32 + #include + #include +-#elif defined(__linux__) +-#include +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) && !defined(APPLE_USE_LIBSECRET) + #include + #include ++#else ++#include + #endif + + using namespace Nickvision::Helpers; + + namespace Nickvision::Keyring + { +-#ifdef __linux__ ++#if !defined(_WIN32) && (!defined(__APPLE__) || defined(APPLE_USE_LIBSECRET)) + static const SecretSchema KEYRING_SCHEMA = { "org.nickvision.libnick", SECRET_SCHEMA_NONE, { { "application", SECRET_SCHEMA_ATTRIBUTE_STRING }, { "NULL", SECRET_SCHEMA_ATTRIBUTE_STRING } } }; + #endif + +@@ -37,20 +37,7 @@ namespace Nickvision::Keyring + return Credential{ StringHelpers::str(credName), StringHelpers::str(credUrl), StringHelpers::str(credUsername), StringHelpers::str(credPassword) }; + } + } +-#elif defined(__linux__) +- GError* error{ nullptr }; +- char* password{ secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", name.c_str(), nullptr) }; +- if (!error && password) +- { +- Credential c{ name, "", "default", password }; +- secret_password_free(password); +- return c; +- } +- if (error) +- { +- g_error_free(error); +- } +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) && !defined(APPLE_USE_LIBSECRET) + CFStringRef nameRef{ CFStringCreateWithCString(nullptr, name.c_str(), kCFStringEncodingUTF8) }; + CFMutableDictionaryRef query{ CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks) }; + CFDictionaryAddValue(query, kSecClass, kSecClassGenericPassword); +@@ -86,6 +73,19 @@ namespace Nickvision::Keyring + } + CFRelease(query); + CFRelease(nameRef); ++#else ++ GError* error{ nullptr }; ++ char* password{ secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", name.c_str(), nullptr) }; ++ if (!error && password) ++ { ++ Credential c{ name, "", "default", password }; ++ secret_password_free(password); ++ return c; ++ } ++ if (error) ++ { ++ g_error_free(error); ++ } + #endif + return std::nullopt; + } +@@ -123,16 +123,7 @@ namespace Nickvision::Keyring + cred.CredentialBlobSize = static_cast(password.size() * sizeof(wchar_t)); + cred.CredentialBlob = LPBYTE(password.c_str()); + return CredWriteW(&cred, 0); +-#elif defined(__linux__) +- GError* error{ nullptr }; +- secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, credential.getName().c_str(), credential.getPassword().c_str(), nullptr, &error, "application", credential.getName().c_str(), nullptr); +- if (error) +- { +- g_error_free(error); +- return false; +- } +- return true; +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) && !defined(APPLE_USE_LIBSECRET) + CFStringRef name{ CFStringCreateWithCString(nullptr, credential.getName().c_str(), kCFStringEncodingUTF8) }; + CFStringRef uri{ CFStringCreateWithCString(nullptr, credential.getUri().c_str(), kCFStringEncodingUTF8) }; + CFStringRef username{ CFStringCreateWithCString(nullptr, credential.getUsername().c_str(), kCFStringEncodingUTF8) }; +@@ -153,6 +144,15 @@ namespace Nickvision::Keyring + CFRelease(name); + CFRelease(query); + return status == errSecSuccess; ++#else ++ GError* error{ nullptr }; ++ secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, credential.getName().c_str(), credential.getPassword().c_str(), nullptr, &error, "application", credential.getName().c_str(), nullptr); ++ if (error) ++ { ++ g_error_free(error); ++ return false; ++ } ++ return true; + #endif + } + +@@ -183,25 +183,7 @@ namespace Nickvision::Keyring + CredFree(cred); + return res; + } +-#elif defined(__linux__) +- GError* error{ nullptr }; +- char* password{ secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", credential.getName().c_str(), nullptr) }; +- if (!error && password) +- { +- secret_password_free(password); +- secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, credential.getName().c_str(), credential.getPassword().c_str(), nullptr, &error, "application", credential.getName().c_str(), nullptr); +- if (error) +- { +- g_error_free(error); +- return false; +- } +- return true; +- } +- if (error) +- { +- g_error_free(error); +- } +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) && !defined(APPLE_USE_LIBSECRET) + CFStringRef name{ CFStringCreateWithCString(nullptr, credential.getName().c_str(), kCFStringEncodingUTF8) }; + CFMutableDictionaryRef query{ CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks) }; + CFDictionaryAddValue(query, kSecClass, kSecClassGenericPassword); +@@ -233,6 +215,24 @@ namespace Nickvision::Keyring + } + CFRelease(query); + CFRelease(name); ++#else ++ GError* error{ nullptr }; ++ char* password{ secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", credential.getName().c_str(), nullptr) }; ++ if (!error && password) ++ { ++ secret_password_free(password); ++ secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, credential.getName().c_str(), credential.getPassword().c_str(), nullptr, &error, "application", credential.getName().c_str(), nullptr); ++ if (error) ++ { ++ g_error_free(error); ++ return false; ++ } ++ return true; ++ } ++ if (error) ++ { ++ g_error_free(error); ++ } + #endif + return false; + } +@@ -242,7 +242,16 @@ namespace Nickvision::Keyring + #ifdef _WIN32 + std::wstring wName{ StringHelpers::wstr(name) }; + return CredDeleteW(wName.c_str(), CRED_TYPE_GENERIC, 0); +-#elif defined(__linux__) ++#elif defined(__APPLE__) && !defined(APPLE_USE_LIBSECRET) ++ CFStringRef nameRef{ CFStringCreateWithCString(nullptr, name.c_str(), kCFStringEncodingUTF8) }; ++ CFMutableDictionaryRef query{ CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks) }; ++ CFDictionaryAddValue(query, kSecClass, kSecClassGenericPassword); ++ CFDictionaryAddValue(query, kSecAttrService, nameRef); ++ OSStatus status{ SecItemDelete(query) }; ++ CFRelease(query); ++ CFRelease(nameRef); ++ return status == errSecSuccess; ++#else + GError* error{ nullptr }; + bool res{ secret_password_clear_sync(&KEYRING_SCHEMA, nullptr, &error, "application", name.c_str(), nullptr) }; + if (!error) +@@ -254,15 +263,6 @@ namespace Nickvision::Keyring + g_error_free(error); + } + return false; +-#elif defined(__APPLE__) +- CFStringRef nameRef{ CFStringCreateWithCString(nullptr, name.c_str(), kCFStringEncodingUTF8) }; +- CFMutableDictionaryRef query{ CFDictionaryCreateMutable(nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks) }; +- CFDictionaryAddValue(query, kSecClass, kSecClassGenericPassword); +- CFDictionaryAddValue(query, kSecAttrService, nameRef); +- OSStatus status{ SecItemDelete(query) }; +- CFRelease(query); +- CFRelease(nameRef); +- return status == errSecSuccess; + #endif + } + } +\ No newline at end of file + diff --git a/devel/libnick/files/0002-filesystemwatcher.cpp-provide-kFSEventStream-values-.patch b/devel/libnick/files/0002-filesystemwatcher.cpp-provide-kFSEventStream-values-.patch new file mode 100644 index 0000000000000..12dd48e850117 --- /dev/null +++ b/devel/libnick/files/0002-filesystemwatcher.cpp-provide-kFSEventStream-values-.patch @@ -0,0 +1,32 @@ +From 60076bc93456d332b08d2fd994787e83276a51ef Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Thu, 14 Nov 2024 09:02:06 +0800 +Subject: [PATCH] filesystemwatcher.cpp: provide kFSEventStream* values + when undefined + +--- + src/filesystem/filesystemwatcher.cpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git src/filesystem/filesystemwatcher.cpp src/filesystem/filesystemwatcher.cpp +index 9078631..b43aa69 100644 +--- src/filesystem/filesystemwatcher.cpp ++++ src/filesystem/filesystemwatcher.cpp +@@ -7,6 +7,17 @@ + #include + #endif + ++#ifdef __APPLE__ ++#include ++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 ++ // Only available in 10.7+ ++ #define kFSEventStreamCreateFlagFileEvents 0x00000010 ++ #define kFSEventStreamEventFlagItemCreated 0x00000100 ++ #define kFSEventStreamEventFlagItemRemoved 0x00000200 ++ #define kFSEventStreamEventFlagItemRenamed 0x00000800 ++#endif ++#endif ++ + namespace Nickvision::Filesystem + { + FileSystemWatcher::FileSystemWatcher(const std::filesystem::path& path, bool incudeSubdirectories, WatcherFlags watcherFlags) diff --git a/devel/libnick/files/0003-suspendinhibitor.cpp-fix-for-10.7.patch b/devel/libnick/files/0003-suspendinhibitor.cpp-fix-for-10.7.patch new file mode 100644 index 0000000000000..41d06f2048950 --- /dev/null +++ b/devel/libnick/files/0003-suspendinhibitor.cpp-fix-for-10.7.patch @@ -0,0 +1,38 @@ +From 8557d8459474321a6408e32aee9e82e9f66aa5db Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Thu, 14 Nov 2024 10:30:47 +0800 +Subject: [PATCH] suspendinhibitor.cpp: fix for < 10.7 + +--- + src/system/suspendinhibitor.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git src/system/suspendinhibitor.cpp src/system/suspendinhibitor.cpp +index 23a6611..ed1b279 100644 +--- src/system/suspendinhibitor.cpp ++++ src/system/suspendinhibitor.cpp +@@ -3,6 +3,8 @@ + #include + #elif defined(__linux__) + #include ++#elif defined(__APPLE__) ++#include + #endif + + namespace Nickvision::System +@@ -77,11 +79,15 @@ namespace Nickvision::System + g_variant_unref(result); + g_object_unref(proxy); + #elif defined(__APPLE__) ++ #if MAC_OS_X_VERSION_MIN_REQUIRED > 1060 + IOReturn result{ IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleSystemSleep, kIOPMAssertionLevelOn, CFSTR("Nickvision preventing suspend"), &m_cookie) }; + if(result != kIOReturnSuccess) + { + return false; + } ++ #else ++ return false; ++ #endif + #endif + m_inhibiting = true; + return true;