summaryrefslogtreecommitdiff
path: root/patches/rstudio-server-install.patch
blob: 9ee3304b1cf6de7ff03da0b60abc1c1a1dda1018 (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
Avoid copying all of mathjax, pandoc, and node to the output.
Avoid building copies of existing libraries.  Link with Guix-provided libraries instead.

--- a/src/cpp/session/CMakeLists.txt
+++ b/src/cpp/session/CMakeLists.txt
@@ -493,18 +493,6 @@
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../NOTICE
                ${CMAKE_CURRENT_SOURCE_DIR}/resources COPYONLY)
 
-# configure custom panmirror script into the resources directory
-#
-# On Linux and Windows builders, found in the tools directory, on Mac and dev
-# environments found in the source tree.
-set(RSTUDIO_PANMIRROR_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/../../gwt/lib/quarto/packages/editor-server/src/resources/md-writer.lua)
-if(NOT EXISTS "${RSTUDIO_PANMIRROR_SCRIPT}")
-   set(RSTUDIO_PANMIRROR_SCRIPT ${RSTUDIO_TOOLS_ROOT}/../src/gwt/lib/quarto/packages/editor-server/src/resources/md-writer.lua)
-endif()
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources/panmirror-scripts)
-configure_file(${RSTUDIO_PANMIRROR_SCRIPT}
-               ${CMAKE_CURRENT_SOURCE_DIR}/resources/panmirror-scripts/ COPYONLY)
-
 # set include directories
 include_directories(
    include
@@ -715,9 +703,6 @@
    # notice
    install(FILES "resources/NOTICE"
            DESTINATION ${RSTUDIO_INSTALL_SUPPORTING}/resources)
-   # panmirror scripts
-   install(DIRECTORY "resources/panmirror-scripts"
-           DESTINATION ${RSTUDIO_INSTALL_SUPPORTING}/resources)
 
    # citation
    configure_file("resources/CITATION.in"
@@ -754,16 +739,6 @@
    install(DIRECTORY "${RSTUDIO_DEPENDENCIES_DICTIONARIES_DIR}"
            DESTINATION "${RSTUDIO_INSTALL_SUPPORTING}/resources")
 
-   # install mathjax for local html preview
-   install(DIRECTORY "${RSTUDIO_DEPENDENCIES_MATHJAX_DIR}"
-           DESTINATION "${RSTUDIO_INSTALL_SUPPORTING}/resources")
-
-   # install node
-   install(
-      DIRECTORY "${RSTUDIO_DEPENDENCIES_DIR}/common/node/${RSTUDIO_INSTALLED_NODE_VERSION}-installed/"
-      DESTINATION "${RSTUDIO_INSTALL_BIN}/node"
-      USE_SOURCE_PERMISSIONS)
-
    # install quarto (or pandoc if quarto disabled)
    if(QUARTO_ENABLED)
       # install some quarto folders into Resources, as needed
@@ -781,9 +756,6 @@
                EXCLUDE)
       endif()
    else()
-      install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/"
-              DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc"
-              USE_SOURCE_PERMISSIONS)
    endif()
 
    # install Copilot Language Server

--- a/src/cpp/ext/CMakeLists.txt
+++ b/src/cpp/ext/CMakeLists.txt
@@ -360,7 +360,7 @@
 # a valid library artifact when libgit2's SelectZlib.cmake calls find_package(ZLIB).
 # If zlib is not yet present, FindZLIB fails and libgit2 falls back to its bundled
 # deps/zlib, resulting in duplicate zlib symbols in the final binary.
-fetch(zlib ZLIB)
+fetch(ZLIB ZLIB)
 
 # libgit2's src/libgit2/CMakeLists.txt uses FILE(WRITE) to produce git2.h in
 # the build tree.  Unlike configure_file(), FILE(WRITE) unconditionally updates
@@ -403,45 +403,6 @@
 
 restore_global_settings()
 
-
-# Create dtl target.
-add_library(rstudio-dtl INTERFACE EXCLUDE_FROM_ALL)
-target_include_directories(rstudio-dtl INTERFACE "${DTL_SOURCE_DIR}")
-
-
-# Create hunspell target.
-file(GLOB HUNSPELL_HEADER_FILES "${HUNSPELL_SOURCE_DIR}/src/hunspell/*.h*")
-file(GLOB HUNSPELL_SOURCE_FILES "${HUNSPELL_SOURCE_DIR}/src/hunspell/*.c*")
-add_library(rstudio-hunspell STATIC ${HUNSPELL_SOURCE_FILES} ${HUNSPELL_HEADER_FILES})
-set_target_properties(rstudio-hunspell PROPERTIES LINKER_LANGUAGE CXX)
-target_include_directories(rstudio-hunspell SYSTEM AFTER INTERFACE "${HUNSPELL_SOURCE_DIR}/src")
-target_compile_definitions(rstudio-hunspell PUBLIC HUNSPELL_STATIC=1)
-
-if(WIN32)
-   target_include_directories(rstudio-hunspell SYSTEM AFTER PRIVATE "${HUNSPELL_PREFIX_DIR}/msvc")
-   target_compile_options(rstudio-hunspell PRIVATE /wd4244 /wd4267)
-   target_compile_options(rstudio-hunspell INTERFACE /wd4996)
-else()
-   target_compile_options(rstudio-hunspell PRIVATE -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable)
-endif()
-
-
-# Create rapidjson target.
-add_library(rstudio-rapidjson INTERFACE EXCLUDE_FROM_ALL)
-target_compile_definitions(rstudio-rapidjson INTERFACE "-DRAPIDJSON_NO_SIZETYPEDEFINE")
-target_include_directories(rstudio-rapidjson INTERFACE "${RAPIDJSON_SOURCE_DIR}/include")
-
-
-# Create utfcpp target.
-add_library(rstudio-utfcpp INTERFACE EXCLUDE_FROM_ALL)
-target_include_directories(rstudio-utfcpp INTERFACE "${UTFCPP_SOURCE_DIR}/source")
-
-
-# Create websocketpp target.
-add_library(rstudio-websocketpp INTERFACE EXCLUDE_FROM_ALL)
-target_include_directories(rstudio-websocketpp INTERFACE "${WEBSOCKETPP_SOURCE_DIR}")
-
-
 # Create zlib target (Windows only).
 # Uses a custom target name to avoid colliding with the 'zlib' OBJECT target
 # that libgit2 creates from its bundled deps/zlib.
--- a/src/cpp/shared_core/CMakeLists.txt
+++ b/src/cpp/shared_core/CMakeLists.txt
@@ -46,6 +46,9 @@
 set (SHARED_INCLUDE_DIRS
    include
    ${BOOST_INCLUDEDIR}
+   ${rapidjson_INCLUDE_DIRS}
+   ${gsl_lite_INCLUDE_DIRS}
+   ${dtl_INCLUDE_DIRS}
    ${EXT_SOURCE_DIR})
 
 # UNIX specific
@@ -92,8 +94,8 @@
 target_link_libraries(rstudio-shared-core
    ${Boost_LIBRARIES}
    ${SHARED_CORE_SYSTEM_LIBS}
-   gsl::gsl-lite-v1
-   rstudio-rapidjson)
+   ${gsl_lite_LIBRARIES}
+   ${rapidjson_LIBRARIES})
 
 # Define executable for running unit tests
 if (RSTUDIO_UNIT_TESTS_ENABLED)
--- a/src/cpp/core/CMakeLists.txt
+++ b/src/cpp/core/CMakeLists.txt
@@ -324,6 +324,11 @@
    ${EXT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    ${TESTS_INCLUDE_DIR}
+   ${hunspell_INCLUDE_DIRS}
+   ${tl-expected_INCLUDE_DIRS}
+   ${gsl_lite_INCLUDE_DIRS}
+   ${websocketpp_INCLUDE_DIRS}
+   ${dtl_INCLUDE_DIRS}
 )
 
 # define shared library
@@ -333,10 +338,10 @@
 # link dependencies
 target_link_libraries(rstudio-core
    rstudio-shared-core
-   rstudio-dtl
-   rstudio-hunspell
-   rstudio-utfcpp
-   rstudio-websocketpp
+   ${dtl_LIBRARIES}
+   ${utfcpp_LIBRARIES}
+   ${hunspell_LIBRARIES}
+   ${websocketpp_LIBRARIES}
    ${Boost_LIBRARIES}
    ${SOCI_LIBRARIES}
    ${CORE_SYSTEM_LIBRARIES}
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -381,7 +381,14 @@
 
    find_package(OpenSSL REQUIRED)
    include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
-
+   find_package(fmt REQUIRED)
+   find_package(gsl-lite REQUIRED)
+   find_package(tl-expected REQUIRED)
+   find_package(yaml-cpp REQUIRED)
+   find_package(hunspell REQUIRED)
+   include_directories(SYSTEM "${hunspell_INCLUDE_DIRS}")
+   find_package(dtl REQUIRED)
+   include_directories(SYSTEM "${dtl_INCLUDE_DIRS}")
 endif()
 
 if(WIN32)
--- a/src/gwt/build.xml
+++ b/src/gwt/build.xml
@@ -87,18 +87,9 @@
    <!-- For automatically re-generating acesupport on change -->
    <property name="acesupport.watcher.dir" value="${tools.dir}/acesupport-watcher"/>
 
-   <!-- Detect git worktree and resolve main repo root for shared dependencies -->
-   <exec executable="git" outputproperty="git.common.dir"
-         failonerror="false" errorproperty="git.common.dir.error">
-      <arg value="rev-parse"/>
-      <arg value="--path-format=absolute"/>
-      <arg value="--git-common-dir"/>
-   </exec>
-   <dirname property="git.main.worktree" file="${git.common.dir}"/>
-
    <!-- Path to GWT libraries -->
    <set-if-exists property="lib.dir" value="../../dependencies/common/gwtproject"/>
-   <set-if-exists property="lib.dir" value="${git.main.worktree}/dependencies/common/gwtproject"/>
+   <set-if-exists property="lib.dir" value="./lib"/>
    <set-if-exists property="lib.dir" value="/opt/rstudio-tools/dependencies/common/gwtproject"/>
    <set-if-exists property="lib.dir" value="C:/rstudio-tools/dependencies/common/gwtproject"/>
 
@@ -235,7 +226,6 @@
    <!-- ensure version matches RSTUDIO_NODE_VERSION -->
    <property name="node.version" value="18.18.2"/>
    <set-if-exists property="node.dir" value="../../dependencies/common/node/${node.version}"/>
-   <set-if-exists property="node.dir" value="${git.main.worktree}/dependencies/common/node/${node.version}"/>
    <set-if-exists property="node.dir" value="/opt/rstudio-tools/dependencies/common/node/${node.version}"/>
    <set-if-unset  property="node.dir" value="/gnu/store/wb4d206jpiskjjp3jqv6ngqxrxvmdjw4-node-22.14.0"/>
 
@@ -253,7 +243,7 @@
    <set-if-exists property="panmirror.dir" value="./lib/quarto/apps/panmirror"/>
    <property name="panmirror.build.dir" value="./www/js/panmirror"/>
 
-   <target name="panmirror" description="Compile panmirror library">
+   <target name="panmirror" if="false" description="Compile panmirror library">
 
       <!-- Make sure a default value for panmirror.minify is set -->
       <condition property="panmirror.minify" value="true">