nheko: fix build on darwin, add myself to maintainers (#447212)

This commit is contained in:
Franz Pletz
2025-09-30 02:39:30 +00:00
committed by GitHub
5 changed files with 142 additions and 35 deletions

View File

@@ -21571,6 +21571,12 @@
github = "i-am-logger";
githubId = 1440852;
};
rebmit = {
name = "Lu Wang";
email = "rebmit@rebmit.moe";
github = "rebmit";
githubId = 188659765;
};
reckenrode = {
name = "Randy Eckenrode";
email = "randy@largeandhighquality.com";

View File

@@ -12,29 +12,27 @@
openssl,
re2,
spdlog,
gtest,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "mtxclient";
version = "0.10.1";
src = fetchFromGitHub {
owner = "Nheko-Reborn";
repo = "mtxclient";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-Y0FMCq4crSbm0tJtYq04ZFwWw+vlfxXKXBo0XUgf7hw=";
};
postPatch = ''
# See https://github.com/gabime/spdlog/issues/1897
sed -i '1a add_compile_definitions(SPDLOG_FMT_EXTERNAL)' CMakeLists.txt
'';
patches = [
./remove-network-tests.patch
];
cmakeFlags = [
# Network requiring tests can't be disabled individually:
# https://github.com/Nheko-Reborn/mtxclient/issues/22
"-DBUILD_LIB_TESTS=OFF"
"-DBUILD_LIB_EXAMPLES=OFF"
(lib.cmakeBool "BUILD_LIB_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "BUILD_LIB_EXAMPLES" false)
];
nativeBuildInputs = [
@@ -53,6 +51,10 @@ stdenv.mkDerivation rec {
spdlog
];
checkInputs = [ gtest ];
doCheck = true;
meta = with lib; {
description = "Client API library for the Matrix protocol";
homepage = "https://github.com/Nheko-Reborn/mtxclient";
@@ -60,11 +62,9 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [
fpletz
pstn
rebmit
rnhmjoj
];
platforms = platforms.all;
# Should be fixable if a higher clang version is used, see:
# https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
broken = stdenv.hostPlatform.isDarwin;
};
}
})

View File

@@ -0,0 +1,77 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d9f92932246ebec8ab5d1cc462366a17818d014..ce27390bd754a33986188dd2bf29cd0c818c2d58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -398,36 +398,6 @@ if(BUILD_LIB_TESTS)
file(COPY tests/fixtures DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- add_executable(client_api tests/client_api.cpp)
- target_link_libraries(client_api
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(client_api PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
- add_executable(media_api tests/media_api.cpp)
- target_link_libraries(media_api
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(media_api PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
- add_executable(e2ee tests/e2ee.cpp)
- target_link_libraries(e2ee
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(e2ee PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
- add_executable(device tests/device.cpp)
- target_link_libraries(device
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(device PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
add_executable(utils tests/utils.cpp)
target_link_libraries(utils
MatrixClient::MatrixClient
@@ -435,21 +405,6 @@ if(BUILD_LIB_TESTS)
GTest::Main)
target_include_directories(utils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
- add_executable(pushrules tests/pushrules.cpp)
- target_link_libraries(pushrules
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(pushrules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
- add_executable(connection tests/connection.cpp)
- target_link_libraries(connection
- MatrixClient::MatrixClient
- GTest::GTest
- GTest::Main)
- target_include_directories(connection PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
add_executable(identifiers tests/identifiers.cpp)
target_link_libraries(identifiers
MatrixClient::MatrixClient
@@ -498,13 +453,7 @@ if(BUILD_LIB_TESTS)
GTest::GTest
GTest::Main)
- add_test(BasicConnectivity connection)
- add_test(ClientAPI client_api)
- add_test(MediaAPI media_api)
- add_test(Encryption e2ee)
- add_test(Devices device)
add_test(Utilities utils)
- add_test(Pushrules pushrules)
add_test(Identifiers identifiers)
add_test(Errors errors)
add_test(CryptoStructs crypto)

View File

@@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ff134c53877d5aa2e00e3c344eb5c6783cccb2f..164553d34152639c6a2c5319c2a03d7a25c33ba3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -974,16 +974,11 @@ endif()
# potential workaround for macdeployqt issues
if(APPLE)
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Applications")
install(TARGETS nheko
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
- qt_generate_deploy_qml_app_script(
- TARGET nheko
- OUTPUT_SCRIPT deploy_script
- NO_UNSUPPORTED_PLATFORM_ERROR
- )
- install(SCRIPT ${deploy_script})
endif()
if(UNIX AND NOT APPLE)

View File

@@ -5,7 +5,6 @@
cmake,
asciidoc,
pkg-config,
boost,
cmark,
coeurl,
curl,
@@ -23,16 +22,17 @@
libnice,
qt6Packages,
fetchpatch,
withVoipSupport ? stdenv.hostPlatform.isLinux,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "nheko";
version = "0.12.1";
src = fetchFromGitHub {
owner = "Nheko-Reborn";
repo = "nheko";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-WlWxe4utRSc9Tt2FsnhBwxzQsoDML2hvm3g5zRnDEiU=";
};
@@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
url = "https://github.com/Nheko-Reborn/nheko/commit/2769642d3c7bd3c0d830b2f18ef6b3bf6a710bf4.patch";
hash = "sha256-y8aiS6h5CSJYBdsAH4jYhAyrFug7aH2H8L6rBfULnQQ=";
})
./fix-darwin-build.patch
];
nativeBuildInputs = [
@@ -53,7 +54,6 @@ stdenv.mkDerivation rec {
];
buildInputs = [
boost
cmark
coeurl
curl
@@ -65,35 +65,39 @@ stdenv.mkDerivation rec {
nlohmann_json
olm
qt6Packages.qtbase
qt6Packages.qtdeclarative
qt6Packages.qtimageformats
qt6Packages.qtkeychain
qt6Packages.qtmultimedia
qt6Packages.qtsvg
qt6Packages.qttools
qt6Packages.qtwayland
qt6Packages.qt-jdenticon
re2
spdlog
]
++ (with gst_all_1; [
gstreamer
gst-plugins-base
(gst-plugins-good.override { qt6Support = true; })
gst-plugins-bad
++ lib.optionals stdenv.hostPlatform.isLinux [
qt6Packages.qtwayland
]
++ lib.optionals withVoipSupport [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
(gst_all_1.gst-plugins-good.override { qt6Support = true; })
gst_all_1.gst-plugins-bad
libnice
]);
];
cmakeFlags = [
"-DCOMPILE_QML=ON" # see https://github.com/Nheko-Reborn/nheko/issues/389
(lib.cmakeBool "VOIP" withVoipSupport)
];
preFixup = ''
# add gstreamer plugins path to the wrapper
# unset QT_STYLE_OVERRIDE to avoid showing a blank window when started
# https://github.com/NixOS/nixpkgs/issues/333009
qtWrapperArgs+=(
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
--unset QT_STYLE_OVERRIDE
)
qtWrapperArgs+=(--unset QT_STYLE_OVERRIDE)
''
+ lib.optionalString withVoipSupport ''
# add gstreamer plugins path to the wrapper
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
'';
meta = with lib; {
@@ -104,11 +108,9 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [
ekleog
fpletz
rebmit
rnhmjoj
];
platforms = platforms.all;
# Should be fixable if a higher clang version is used, see:
# https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
broken = stdenv.hostPlatform.isDarwin;
};
}
})