summaryrefslogtreecommitdiff
path: root/editors/bee-host/files/patch-CMakeLists.txt
blob: cfc68a29e43fa9e0bf3c3fc90ecc9315d2667808 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--- CMakeLists.txt.orig	2025-04-21 15:28:54 UTC
+++ CMakeLists.txt
@@ -39,27 +39,7 @@ set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR}/external)
 
 set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR}/external)
 
-# cJSON and cJSONUtils
-ExternalProject_Add(cjson
-  GIT_REPOSITORY "https://github.com/DaveGamble/cJSON"
-  GIT_TAG "v1.7.15"
-  PREFIX "${EXTERNAL_DIR}/cJSON"
-  BUILD_IN_SOURCE 1
-  TEST_COMMAND ""
-  INSTALL_COMMAND ""
-  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-    -DBUILD_SHARED_AND_STATIC_LIBS=On
-    -DBUILD_SHARED_LIBS=Off
-    -DENABLE_CJSON_TEST=Off
-    -DENABLE_CJSON_UTILS=On
-    -DENABLE_TARGET_EXPORT=On
-  )
-ExternalProject_Get_Property(cjson source_dir)
-ExternalProject_Get_Property(cjson binary_dir)
-ExternalProject_Get_Property(cjson download_dir)
-set(CJSON_SOURCE_DIR "${source_dir}")
-set(CJSON_BINARY_DIR "${binary_dir}")
-set(CJSON_DOWNLOAD_DIR "${download_dir}")
+# cJSON and cJSONUtils installed from devel/libcjson
 
 # beectl
 set(BEECTL_SRCS
@@ -70,21 +50,13 @@ set(BEECTL_SRCS
   src/mkstemps.c
   # This is nasty, but I couldn't find a way to use CMAKE_TOOLCHAIN_FILE
   # for the external project (see comments below.)
-  "${CJSON_SOURCE_DIR}/cJSON.c"
   )
 
 add_executable(beectl ${BEECTL_SRCS})
 
-# Workaround for CMake versions which require the cJSON.c file to exist before
-# downloading the external project.
-add_custom_command(TARGET beectl PRE_BUILD
-    BYPRODUCTS "${CJSON_SOURCE_DIR}/cJSON.c"
-    COMMAND touch "${CJSON_SOURCE_DIR}/cJSON.c")
-
 target_compile_features(beectl PRIVATE c_variadic_macros)
 target_include_directories(beectl PRIVATE "${CJSON_DOWNLOAD_DIR}")
 set_property(TARGET beectl PROPERTY C_STANDARD 11) # C11
-add_dependencies(beectl cjson)
 
 # The following would be better approach than including cJSON files in our
 # source list. But the build fails when cross-compiling, since
@@ -126,14 +98,14 @@ set(BEECTL_MANIFEST_TARGET_PATH "${CMAKE_INSTALL_PREFI
 
 message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
 set(BEECTL_MANIFEST_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/beectl")
-set(BEECTL_CHROME_MANIFEST_DIR "etc/opt/chrome/native-messaging-hosts")
+set(BEECTL_CHROME_MANIFEST_DIR "etc/chrome/native-messaging-hosts")
 set(BEECTL_CHROMIUM_MANIFEST_DIR "etc/chromium/native-messaging-hosts")
 
 if(uppercase_CMAKE_SYSTEM_NAME MATCHES LINUX AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd|x86_)64$")
     # Fedora 36 amd64 may have a separate /usr/lib64 dir different from /usr/lib.
     set(BEECTL_FIREFOX_MANIFEST_DIR "usr/lib64/mozilla/native-messaging-hosts")
 else()
-    set(BEECTL_FIREFOX_MANIFEST_DIR "usr/lib/mozilla/native-messaging-hosts")
+    set(BEECTL_FIREFOX_MANIFEST_DIR "lib/mozilla/native-messaging-hosts")
 endif()
 
 # RPM package properties
@@ -288,7 +260,7 @@ else(uppercase_CMAKE_SYSTEM_NAME MATCHES WINDOWS)
         COMPONENT config)
 else(uppercase_CMAKE_SYSTEM_NAME MATCHES WINDOWS)
     # Install host app
-    install(TARGETS beectl RUNTIME DESTINATION usr/local/bin COMPONENT applications)
+    install(TARGETS beectl RUNTIME DESTINATION bin COMPONENT applications)
 
     configure_file(
         chrome-com.ruslan_osmanov.bee.json.in