aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/extempore-unbundle-external-dependencies.patch
blob: e72f995f0bb31192ad16a2153b452eda9d47adb9 (about) (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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
From b48ef9af13a154939acc245c32d72358001d00f1 Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Sun, 20 Jun 2021 12:53:27 +0200
Subject: [PATCH] Remove build machinery for bundled dependencies.

---
 CMakeLists.txt | 192 +------------------------------------------------
 1 file changed, 1 insertion(+), 191 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17d13d7c..2a7206ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,6 @@
 cmake_minimum_required(VERSION 3.1) # we use target_sources()
 project(Extempore VERSION 0.8.9)
 
-# for backwards compatibility with CMake older than 3.19
-cmake_policy(SET CMP0114 OLD)
-
 option(ASSETS "download multimedia assets (approx 500MB)" OFF)
 option(BUILD_TESTS "build test targets (including examples)" ON)
 option(PACKAGE "set up install targets for packaging" OFF)
@@ -142,55 +139,6 @@ else()
   message(FATAL_ERROR "Sorry, Extempore isn't supported on this platform - macOS, Linux & Windows only.")
 endif()
 
-########
-# PCRE #
-########
-
-# current in-tree PCRE version: 8.38
-
-add_library(pcre STATIC
-  # headers
-  src/pcre/config.h
-  src/pcre/pcre.h
-  src/pcre/ucp.h
-  # source files
-  src/pcre/pcre_chartables.c
-  src/pcre/pcre_compile.c
-  src/pcre/pcre_exec.c
-  src/pcre/pcre_globals.c
-  src/pcre/pcre_internal.h
-  src/pcre/pcre_newline.c
-  src/pcre/pcre_tables.c
-  )
-
-target_compile_definitions(pcre
-  PRIVATE -DHAVE_CONFIG_H
-  )
-
-if(PACKAGE)
-  target_compile_options(pcre
-    PRIVATE -mtune=generic)
-endif()
-
-#############
-# portaudio #
-#############
-
-include(ExternalProject)
-
-ExternalProject_Add(portaudio_static
-  PREFIX portaudio
-  URL https://github.com/PortAudio/portaudio/archive/3f7bee79a65327d2e0965e8a74299723ed6f072d.zip
-  URL_MD5 182b76e05f6ef21d9f5716da7489905d
-  CMAKE_ARGS
-  -DPA_BUILD_STATIC=ON
-  -DPA_BUILD_SHARED=OFF
-  -DPA_LIBNAME_ADD_SUFFIX=OFF
-  -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-  -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-  -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-  -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/portaudio)
-
 ##############
 # LLVM 3.8.0 #
 ##############
@@ -323,11 +271,6 @@ if(UNIX)
   set_source_files_properties(src/Scheme.cpp PROPERTIES COMPILE_FLAGS -Wno-switch)
 endif()
 
-# static extempore build dependencies
-
-add_dependencies(extempore pcre)
-add_dependencies(extempore portaudio_static)
-
 if(BUILD_LLVM)
   if(WIN32)
     add_dependencies(extempore LLVM-install)
@@ -342,12 +285,9 @@ endif()
 
 target_include_directories(extempore
   PRIVATE
-  src/pcre
-  ${CMAKE_BINARY_DIR}/portaudio/include # installed by ExternalProject
   ${EXT_LLVM_DIR}/include)
 
-target_link_directories(extempore PRIVATE ${CMAKE_BINARY_DIR}/portaudio/lib)
-target_link_libraries(extempore PRIVATE pcre portaudio${CMAKE_STATIC_LIBRARY_SUFFIX} ${LLVM_LIBRARIES})
+target_link_libraries(extempore PRIVATE pcre portaudio ${LLVM_LIBRARIES})
 if(UNIX AND NOT APPLE)
   target_link_libraries(extempore PRIVATE asound)
 endif()
@@ -425,7 +365,6 @@ elseif(APPLE) # macOS
     PRIVATE "-framework AudioToolbox")
 
 elseif(UNIX AND NOT APPLE) # Linux
-  set_property(TARGET pcre PROPERTY POSITION_INDEPENDENT_CODE ON)
   set_property(TARGET extempore PROPERTY POSITION_INDEPENDENT_CODE ON)
   # target_link_libraries(extempore PRIVATE --export-dynamic)
   target_link_libraries(extempore PRIVATE dl)
@@ -529,7 +468,6 @@ else(WIN32)
       DEPENDS ${filename} extempore)
     set_target_properties(${targetname} PROPERTIES FOLDER AOT)
     if(NOT ${group} STREQUAL "core")
-      add_dependencies(${targetname} external_shlibs_${group})
       add_dependencies(aot_external_${group} ${targetname})
     endif()
     foreach(dep ${ARGN})
@@ -568,59 +506,6 @@ add_custom_target(clean_aot
 if(UNIX)
   if(EXTERNAL_SHLIBS_AUDIO)
 
-    # first, download & build the shared libraries themselves (these are all external to Extempore)
-
-    ExternalProject_Add(portmidi
-      PREFIX portmidi
-      URL https://github.com/extemporelang/portmidi/archive/8602f548f71daf5ef638b2f7d224753400cb2158.zip
-      CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(portmidi PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    ExternalProject_Add(rtmidi
-      PREFIX rtmidi
-      URL https://github.com/thestk/rtmidi/archive/84d130bf22d878ff1b0e224346e2e0f9e3ba8099.zip
-      URL_MD5 d932b9fef01b859a1b8b86a3c8dc6621
-      CMAKE_ARGS
-      -DRTMIDI_BUILD_TESTING=OFF
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(rtmidi PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    ExternalProject_Add(kiss_fft
-      PREFIX kiss_fft
-      URL https://github.com/extemporelang/kiss_fft/archive/1.3.0.zip
-      CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(kiss_fft PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    # build with as few deps as we can get away with
-
-    ExternalProject_Add(sndfile
-    PREFIX libsndfile
-    URL https://github.com/erikd/libsndfile/archive/ae64caf9b5946d365971c550875000342e763de6.zip
-    CMAKE_ARGS
-    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-    -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-    -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-    -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR}
-    -DBUILD_SHARED_LIBS=ON
-    -DBUILD_PROGRAMS=OFF
-    -DBUILD_EXAMPLES=OFF
-	-DENABLE_EXTERNAL_LIBS=OFF
-    -DBUILD_TESTING=OFF
-    -DENABLE_CPACK=OFF
-    -DENABLE_PACKAGE_CONFIG=OFF)
-    set_target_properties(sndfile PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
     add_custom_target(aot_external_audio ALL)
     set_target_properties(aot_external_audio PROPERTIES FOLDER AOT)
     aotcompile_lib(libs/external/fft.xtm audio base math)
@@ -629,76 +514,13 @@ if(UNIX)
     aotcompile_lib(libs/external/instruments_ext.xtm audio base sndfile instruments)
     aotcompile_lib(libs/external/portmidi.xtm audio base)
 
-    add_custom_target(external_shlibs_audio
-      COMMENT "moving shared libs into ${EXT_PLATFORM_SHLIBS_DIR}"
-      DEPENDS LLVM sndfile kiss_fft portmidi rtmidi
-      COMMAND ${CMAKE_COMMAND} -E make_directory ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libkiss_fft${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libportmidi${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy librtmidi${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libsndfile${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      WORKING_DIRECTORY ${EXT_DEPS_INSTALL_DIR}/lib)
-    set_target_properties(external_shlibs_audio PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
     add_dependencies(aot_external_audio extempore)
-    add_dependencies(aot_external_audio external_shlibs_audio)
 
   endif(EXTERNAL_SHLIBS_AUDIO)
 
   if(EXTERNAL_SHLIBS_GRAPHICS)
 
-    ExternalProject_Add(nanovg
-      PREFIX nanovg
-      URL https://github.com/extemporelang/nanovg/archive/3c60175fcc2e5fe305b04355cdce35d499c80310.tar.gz
-      CMAKE_ARGS
-      -DEXTEMPORE_LIB_PATH=${CMAKE_SOURCE_DIR}/libs/platform-shlibs/extempore.lib
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(nanovg PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    add_dependencies(nanovg extempore)
-
-    ExternalProject_Add(stb_image
-      PREFIX stb_image
-      URL https://github.com/extemporelang/stb/archive/152a250a702bf28951bb0220d63bc0c99830c498.zip
-      CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(nanovg PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    ExternalProject_Add(glfw3
-      PREFIX glfw3
-      URL https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
-      CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DBUILD_SHARED_LIBS=ON
-      -DGLFW_BUILD_EXAMPLES=OFF
-      -DGLFW_BUILD_TESTS=OFF
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(glfw3 PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
-    ExternalProject_Add(assimp
-      PREFIX assimp
-      URL https://github.com/assimp/assimp/archive/v3.2.zip
-      CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_C_FLAGS=${EXT_DEPS_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${EXT_DEPS_CXX_FLAGS}
-      -DCMAKE_DEBUG_POSTFIX=
-      -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-      -DASSIMP_BUILD_SAMPLES=OFF
-      -DASSIMP_BUILD_TESTS=OFF
-      -DCMAKE_INSTALL_PREFIX=${EXT_DEPS_INSTALL_DIR})
-    set_target_properties(assimp PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
     add_custom_target(aot_external_graphics ALL)
-    set_target_properties(assimp PROPERTIES FOLDER AOT)
 
     aotcompile_lib(libs/external/stb_image.xtm graphics base)
     aotcompile_lib(libs/external/glfw3.xtm graphics base)
@@ -715,20 +537,8 @@ if(UNIX)
     aotcompile_lib(libs/external/assimp.xtm graphics base stb_image graphics-pipeline)
     aotcompile_lib(libs/external/gl/glcompat-${GL_BIND_METHOD}.xtm graphics base)
 
-    add_custom_target(external_shlibs_graphics
-      COMMENT "moving shared libs into ${EXT_PLATFORM_SHLIBS_DIR}"
-      DEPENDS LLVM assimp glfw3 stb_image nanovg
-      COMMAND ${CMAKE_COMMAND} -E make_directory ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libassimp${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libglfw${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libnanovg${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      COMMAND ${CMAKE_COMMAND} -E copy libstb_image${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXT_PLATFORM_SHLIBS_DIR}
-      WORKING_DIRECTORY ${EXT_DEPS_INSTALL_DIR}/lib)
-    set_target_properties(external_shlibs_graphics PROPERTIES FOLDER EXTERNAL_SHLIBS)
-
     # set up these libs for AOT compilation
     add_dependencies(aot_external_graphics extempore)
-    add_dependencies(aot_external_graphics external_shlibs_graphics)
 
   endif(EXTERNAL_SHLIBS_GRAPHICS)
 endif(UNIX)
-- 
2.32.0