aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/squirrel
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/squirrel
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/squirrel')
-rw-r--r--vcpkg/ports/squirrel/fix_optionally_build_sq.patch41
-rw-r--r--vcpkg/ports/squirrel/portfile.cmake53
-rw-r--r--vcpkg/ports/squirrel/vcpkg.json21
3 files changed, 115 insertions, 0 deletions
diff --git a/vcpkg/ports/squirrel/fix_optionally_build_sq.patch b/vcpkg/ports/squirrel/fix_optionally_build_sq.patch
new file mode 100644
index 0000000..9566ec8
--- /dev/null
+++ b/vcpkg/ports/squirrel/fix_optionally_build_sq.patch
@@ -0,0 +1,41 @@
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dc35b6f..628c649 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,6 +3,7 @@ project(squirrel VERSION 3.1 LANGUAGES C CXX)
+
+ option(DISABLE_STATIC "Avoid building/installing static libraries.")
+ option(LONG_OUTPUT_NAMES "Use longer names for binaries and libraries: squirrel3 (not sq).")
++option(BUILD_SQ "Build sq interpreter.")
+
+ if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
+@@ -35,15 +36,24 @@ endif()
+
+ add_subdirectory(squirrel)
+ add_subdirectory(sqstdlib)
+-add_subdirectory(sq)
++
++if(BUILD_SQ)
++ add_subdirectory(sq)
++endif()
+
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(tgts)
+ if(NOT DISABLE_DYNAMIC)
+- list(APPEND tgts squirrel sqstdlib sq)
++ list(APPEND tgts squirrel sqstdlib)
++ if(BUILD_SQ)
++ list(APPEND tgts sq)
++ endif()
+ endif()
+ if(NOT DISABLE_STATIC)
+- list(APPEND tgts squirrel_static sqstdlib_static sq_static)
++ list(APPEND tgts squirrel_static sqstdlib_static)
++ if(BUILD_SQ)
++ list(APPEND tgts sq_static)
++ endif()
+ endif()
+ foreach(t ${tgts})
+ target_compile_definitions(${t} PUBLIC -D_SQ64)
diff --git a/vcpkg/ports/squirrel/portfile.cmake b/vcpkg/ports/squirrel/portfile.cmake
new file mode 100644
index 0000000..d344afc
--- /dev/null
+++ b/vcpkg/ports/squirrel/portfile.cmake
@@ -0,0 +1,53 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO albertodemichelis/squirrel
+ HEAD_REF master
+ REF 23a0620658714b996d20da3d4dd1a0dcf9b0bd98
+ SHA512 205ba0b2b37ca2133f8c1b3024a3a34186697998714140d409006ae0f5facc76b2664dbbad33bbc51c86199e2524bd0cd905b8941e306db892a50a58f1b96371
+ PATCHES fix_optionally_build_sq.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DYNAMIC)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ "interpreter" BUILD_SQ
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DDISABLE_DYNAMIC=${DISABLE_DYNAMIC}
+ -DDISABLE_STATIC=${DISABLE_STATIC}
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/squirrel)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if(BUILD_SQ)
+ if(BUILD_STATIC)
+ message(STATUS "Copying sq tool")
+ vcpkg_copy_tools(
+ TOOL_NAMES sq
+ AUTO_CLEAN
+ )
+ elseif(BUILD_DYNAMIC)
+ message(STATUS "Copying sq and sq_static tool")
+ vcpkg_copy_tools(
+ TOOL_NAMES sq sq_static
+ AUTO_CLEAN
+ )
+ endif()
+endif()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/squirrel/vcpkg.json b/vcpkg/ports/squirrel/vcpkg.json
new file mode 100644
index 0000000..bdf5fb5
--- /dev/null
+++ b/vcpkg/ports/squirrel/vcpkg.json
@@ -0,0 +1,21 @@
+{
+ "name": "squirrel",
+ "version-date": "2021-09-17",
+ "description": "Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games.",
+ "homepage": "http://www.squirrel-lang.org",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "interpreter": {
+ "description": "Build sq command-line interpreter"
+ }
+ }
+}