@bniladridas/cursor 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +58 -57
- package/Formula/cursor.rb +3 -3
- package/install.js +26 -19
- package/package.json +1 -1
- package/release/checksums.txt +3 -3
- package/release/cursor-linux/{cursor_v0.1.8_linux_amd64.tar.gz → cursor_v0.1.9_linux_amd64.tar.gz} +0 -0
- package/release/cursor-macos/cursor_v0.1.9_darwin_arm64.tar.gz +0 -0
- package/release/cursor-windows/cursor__windows_amd64.zip +0 -0
- package/release/cursor-macos/cursor_v0.1.8_darwin_arm64.tar.gz +0 -0
package/CMakeLists.txt
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.14)
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
find_package(Git)
|
|
3
|
+
# Try to get version from git tag
|
|
4
|
+
find_package(Git QUIET)
|
|
5
|
+
set(PROJECT_VERSION "0.0.0")
|
|
5
6
|
if(GIT_FOUND)
|
|
6
7
|
execute_process(
|
|
7
8
|
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
|
|
@@ -12,11 +13,16 @@ if(GIT_FOUND)
|
|
|
12
13
|
)
|
|
13
14
|
if(GIT_TAG)
|
|
14
15
|
string(REGEX REPLACE "^v" "" PROJECT_VERSION ${GIT_TAG})
|
|
15
|
-
else()
|
|
16
|
-
set(PROJECT_VERSION "0.1.6")
|
|
17
16
|
endif()
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
endif()
|
|
18
|
+
|
|
19
|
+
# Fallback: extract from source dir name (e.g., cursor-0.1.8 from tarball)
|
|
20
|
+
if(PROJECT_VERSION STREQUAL "0.0.0")
|
|
21
|
+
get_filename_component(SOURCE_DIR_NAME ${CMAKE_SOURCE_DIR} NAME)
|
|
22
|
+
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" EXTRACTED_VERSION ${SOURCE_DIR_NAME})
|
|
23
|
+
if(EXTRACTED_VERSION)
|
|
24
|
+
set(PROJECT_VERSION ${EXTRACTED_VERSION})
|
|
25
|
+
endif()
|
|
20
26
|
endif()
|
|
21
27
|
|
|
22
28
|
project(cursor VERSION ${PROJECT_VERSION} LANGUAGES CXX)
|
|
@@ -317,43 +323,38 @@ if(NOT CPR_FOUND)
|
|
|
317
323
|
message(FATAL_ERROR "Failed to find or build CPR. Please install it manually or check your network connection.")
|
|
318
324
|
endif()
|
|
319
325
|
endif()
|
|
320
|
-
|
|
321
|
-
enable_testing()
|
|
326
|
+
option(CURSOR_BUILD_TESTS "Build tests" ON)
|
|
322
327
|
|
|
323
|
-
|
|
324
|
-
|
|
328
|
+
if(CURSOR_BUILD_TESTS)
|
|
329
|
+
enable_testing()
|
|
325
330
|
|
|
326
|
-
|
|
327
|
-
if(NOT TARGET gtest)
|
|
328
|
-
message(STATUS "Downloading and building Google Test...")
|
|
329
|
-
FetchContent_Declare(
|
|
330
|
-
googletest
|
|
331
|
-
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
332
|
-
GIT_TAG v1.14.0
|
|
333
|
-
GIT_SHALLOW TRUE
|
|
334
|
-
)
|
|
331
|
+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
335
332
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
333
|
+
if(NOT TARGET gtest)
|
|
334
|
+
message(STATUS "Downloading and building Google Test...")
|
|
335
|
+
FetchContent_Declare(
|
|
336
|
+
googletest
|
|
337
|
+
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
338
|
+
GIT_TAG v1.14.0
|
|
339
|
+
GIT_SHALLOW TRUE
|
|
340
|
+
)
|
|
341
341
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
342
|
+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
343
|
+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|
344
|
+
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
|
345
|
+
set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
|
|
346
|
+
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
|
|
346
347
|
|
|
347
|
-
|
|
348
|
+
FetchContent_MakeAvailable(googletest)
|
|
348
349
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
)
|
|
350
|
+
if(NOT TARGET gtest_all_tests)
|
|
351
|
+
add_library(gtest_all_tests INTERFACE)
|
|
352
|
+
target_link_libraries(gtest_all_tests
|
|
353
|
+
INTERFACE
|
|
354
|
+
GTest::GTest
|
|
355
|
+
GTest::Main
|
|
356
|
+
)
|
|
357
|
+
endif()
|
|
357
358
|
endif()
|
|
358
359
|
endif()
|
|
359
360
|
|
|
@@ -517,26 +518,26 @@ target_link_libraries(cursor-agent PRIVATE
|
|
|
517
518
|
cursor_lib
|
|
518
519
|
)
|
|
519
520
|
|
|
520
|
-
|
|
521
|
-
add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
|
|
522
|
-
target_include_directories(cursor-tests PRIVATE
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
)
|
|
526
|
-
target_link_libraries(cursor-tests PRIVATE
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
)
|
|
531
|
-
add_test(NAME basic_tests COMMAND cursor-tests)
|
|
521
|
+
if(CURSOR_BUILD_TESTS)
|
|
522
|
+
add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
|
|
523
|
+
target_include_directories(cursor-tests PRIVATE
|
|
524
|
+
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
525
|
+
${CMAKE_CURRENT_BINARY_DIR}/include
|
|
526
|
+
)
|
|
527
|
+
target_link_libraries(cursor-tests PRIVATE
|
|
528
|
+
cursor_lib
|
|
529
|
+
gtest_main
|
|
530
|
+
gtest
|
|
531
|
+
)
|
|
532
|
+
add_test(NAME basic_tests COMMAND cursor-tests)
|
|
532
533
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
)
|
|
534
|
+
set_target_properties(cursor-tests PROPERTIES
|
|
535
|
+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
536
|
+
MACOSX_RPATH ON
|
|
537
|
+
INSTALL_RPATH "@executable_path/lib"
|
|
538
|
+
BUILD_WITH_INSTALL_RPATH TRUE
|
|
539
|
+
)
|
|
540
|
+
endif()
|
|
540
541
|
|
|
541
542
|
# Set target properties
|
|
542
543
|
set_target_properties(cursor-agent PROPERTIES
|
|
@@ -626,7 +627,7 @@ add_custom_target(test-quick
|
|
|
626
627
|
# Code coverage target (requires lcov)
|
|
627
628
|
find_program(LCOV_EXE lcov)
|
|
628
629
|
find_program(GENHTML_EXE genhtml)
|
|
629
|
-
if(LCOV_EXE)
|
|
630
|
+
if(LCOV_EXE AND CURSOR_BUILD_TESTS)
|
|
630
631
|
add_custom_target(coverage
|
|
631
632
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
|
|
632
633
|
COMMAND ctest --output-on-failure
|
package/Formula/cursor.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
class Cursor < Formula
|
|
2
2
|
desc "Professional AI agent with command execution and file operations"
|
|
3
3
|
homepage "https://github.com/bniladridas/cursor"
|
|
4
|
-
url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.
|
|
5
|
-
sha256 "
|
|
4
|
+
url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.9.tar.gz"
|
|
5
|
+
sha256 "f5e1f0380c218a528ad3de6a3239f0cd5a8ba6356849a68348c8b61d2e8e2e0e"
|
|
6
6
|
license "Apache-2.0"
|
|
7
7
|
|
|
8
8
|
depends_on "cmake" => :build
|
|
@@ -10,7 +10,7 @@ class Cursor < Formula
|
|
|
10
10
|
depends_on "nlohmann-json"
|
|
11
11
|
|
|
12
12
|
def install
|
|
13
|
-
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
|
|
13
|
+
system "cmake", "-S", ".", "-B", "build", "-DCURSOR_BUILD_TESTS=OFF", *std_cmake_args
|
|
14
14
|
system "cmake", "--build", "build"
|
|
15
15
|
bin.install "build/bin/cursor-agent"
|
|
16
16
|
|
package/install.js
CHANGED
|
@@ -27,24 +27,31 @@ fs.mkdirSync(binaryDir, { recursive: true });
|
|
|
27
27
|
console.log(`downloading cursor v${version}...`);
|
|
28
28
|
|
|
29
29
|
const file = fs.createWriteStream(path.join(binaryDir, archive));
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (process.platform === 'win32') {
|
|
40
|
-
execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
|
|
41
|
-
} else {
|
|
42
|
-
execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
|
|
30
|
+
function download(url) {
|
|
31
|
+
https.get(url, (res) => {
|
|
32
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
33
|
+
download(res.headers.location);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (res.statusCode !== 200) {
|
|
37
|
+
console.error(`download failed (${res.statusCode}): ${url}`);
|
|
38
|
+
process.exit(1);
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
res.pipe(file);
|
|
41
|
+
file.on('finish', () => {
|
|
42
|
+
file.close();
|
|
43
|
+
console.log('extracting...');
|
|
44
|
+
if (process.platform === 'win32') {
|
|
45
|
+
execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
|
|
46
|
+
} else {
|
|
47
|
+
execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
|
|
48
|
+
}
|
|
49
|
+
fs.unlinkSync(path.join(binaryDir, archive));
|
|
50
|
+
console.log('done');
|
|
51
|
+
});
|
|
52
|
+
}).on('error', (err) => {
|
|
53
|
+
console.error(`download failed: ${err.message}`);
|
|
54
|
+
process.exit(1);
|
|
46
55
|
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
process.exit(1);
|
|
50
|
-
});
|
|
56
|
+
}
|
|
57
|
+
download(url);
|
package/package.json
CHANGED
package/release/checksums.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
dae4ec4d23edaaddb6470b13977fb7776d2169c78925a62931d781bdae45738a release/cursor-macos/cursor_v0.1.9_darwin_arm64.tar.gz
|
|
2
|
+
108f843a6dbe1aa8b8a9bf68e35359f258df39921d93a9919192ff734837bc50 release/cursor-linux/cursor_v0.1.9_linux_amd64.tar.gz
|
|
3
|
+
e3ee1d44f26cb7e1ee103de0fd69139a68d7e6875dc22854ce6893b838b3ffc6 release/cursor-windows/cursor__windows_amd64.zip
|
package/release/cursor-linux/{cursor_v0.1.8_linux_amd64.tar.gz → cursor_v0.1.9_linux_amd64.tar.gz}
RENAMED
|
index 2ff074e..5552a31 100644
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|