Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New port] Added Sciter.JS port (version 4.4.8.16) #18951

Merged
merged 15 commits into from
Nov 15, 2021
Merged
111 changes: 111 additions & 0 deletions ports/sciter-js/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

if(VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Sciter only supports Windows Desktop")
endif()

set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)

set(SCITER_REVISION d5a13ff197fed3af46d4bc931c158828eb61e357)
set(SCITER_SHA 5be2db9d2e5caa19be158020a084a246acd6dad2047062f603b3af4f3cdbdd7f7750b263ad6dfaa6c3667de6c51084fc2df75cd3cb8cd60501550377dded1928)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(SCITER_ARCH x64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(SCITER_ARCH x32)
else()
message(FATAL_ERROR "Sciter only supports x86/x64")
endif()
VuYeK marked this conversation as resolved.
Show resolved Hide resolved
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved

# check out the `https://github.com/c-smile/sciter-js-sdk/archive/${SCITER_REVISION}.tar.gz`
# hash checksum can be obtained with `curl -L -o tmp.tgz ${URL} && vcpkg hash tmp.tgz`
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO c-smile/sciter-js-sdk
REF ${SCITER_REVISION}
SHA512 ${SCITER_SHA}
)

# install include directory
file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/sciter-js
FILES_MATCHING
PATTERN "*.cpp"
PATTERN "*.mm"
PATTERN "*.h"
PATTERN "*.hpp"
)

set(SCITER_SHARE "${CURRENT_PACKAGES_DIR}/share/sciter-js")
set(SCITER_TOOLS ${CURRENT_PACKAGES_DIR}/tools/sciter-js)
BillyONeal marked this conversation as resolved.
Show resolved Hide resolved
set(TOOL_PERMS FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

# license
file(COPY ${SOURCE_PATH}/logfile.md DESTINATION ${SCITER_SHARE})
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${SCITER_SHARE} RENAME copyright)

# tools
if(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(SCITER_BIN ${SOURCE_PATH}/bin/linux/x64)

file(INSTALL ${SOURCE_PATH}/bin/linux/packfolder DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SOURCE_PATH}/bin/linux/qjs DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SOURCE_PATH}/bin/linux/qjsc DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})

file(INSTALL ${SCITER_BIN}/usciter DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/inspector DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/sciter-sqlite.so DESTINATION ${SCITER_TOOLS})

if ("windowless" IN_LIST FEATURES)
set(SCITER_BIN ${SOURCE_PATH}/bin.lite/linux/x64)
endif()

file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

file(INSTALL ${SCITER_BIN}/sciter-sqlite.so DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/sciter-sqlite.so DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

elseif(VCPKG_TARGET_IS_OSX)
set(SCITER_BIN ${SOURCE_PATH}/bin/macosx)

file(INSTALL ${SCITER_BIN}/packfolder DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/qjs DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/qjsc DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})

file(INSTALL ${SCITER_BIN}/inspector.app DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/usciterjs.app DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${SCITER_TOOLS})

execute_process(COMMAND sh -c "chmod +x usciterjs.app/Contents/MacOS/usciterjs" WORKING_DIRECTORY ${SCITER_TOOLS})
execute_process(COMMAND sh -c "chmod +x inspector.app/Contents/MacOS/inspector" WORKING_DIRECTORY ${SCITER_TOOLS})

file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

elseif(VCPKG_TARGET_IS_WINDOWS)
set(SCITER_BIN ${SOURCE_PATH}/bin/windows/${SCITER_ARCH})
set(SCITER_BIN32 ${SOURCE_PATH}/bin/windows/x32)

file(INSTALL ${SOURCE_PATH}/bin/windows/packfolder.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SOURCE_PATH}/bin/windows/qjs.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SOURCE_PATH}/bin/windows/qjsc.exe DESTINATION ${SCITER_TOOLS})

file(INSTALL ${SCITER_BIN}/scapp.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/usciter.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/inspector.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/sciter-sqlite.dll DESTINATION ${SCITER_TOOLS})

if ("windowless" IN_LIST FEATURES)
set(SCITER_BIN ${SOURCE_PATH}/bin.lite/windows/${SCITER_ARCH})
endif()

file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

file(INSTALL ${SCITER_BIN}/sciter-sqlite.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/sciter-sqlite.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

message(WARNING "Sciter requires manual deployment of the correct DLL files.")
endif()
12 changes: 12 additions & 0 deletions ports/sciter-js/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "sciter-js",
"version-string": "4.4.8.16",
"description": "Sciter.JS - Sciter but with QuickJS on board instead of TIScript. Sciter is an embeddable HTML/CSS/scripting engine.",
"homepage": "https://github.com/c-smile/sciter-js-sdk",
"supports": "!uwp & !arm & !static",
"features": {
"windowless": {
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
"description": "windowless version - lite version"
}
}
}
111 changes: 9 additions & 102 deletions ports/sciter/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,105 +1,12 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "Sciter only supports Windows Desktop")
endif()
message(FATAL_ERROR "The sciter port is deprecated by upstream and conflicts with upstream's replacement.

# header-only library
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
Upstream has stopped active development of sciter and instead encourage users to move to a new library Sciter.JS that uses javascript as the internal scripting language (sciter-js in vcpkg).

set(SCITER_REVISION 29a598b6d20220b93848b5e8abab704619296857)
set(SCITER_SHA dc9ebcc59a4ca7b154efcbd96c7e0aa53dc344f6a2cfa91f8c351c1edc5a0f060129715f8eac85e00df9b6c153322a9ba36b430da5020d38769740434cbcd52c)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(SCITER_ARCH x64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(SCITER_ARCH x32)
endif()

# check out the `https://github.com/c-smile/sciter-sdk/archive/${SCITER_REVISION}.tar.gz`
# hash checksum can be obtained with `curl -L -o tmp.tgz ${URL} && vcpkg hash tmp.tgz`
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO c-smile/sciter-sdk
REF ${SCITER_REVISION}
SHA512 ${SCITER_SHA}
)

# install include directory
file(INSTALL ${SOURCE_PATH}/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/sciter
FILES_MATCHING
PATTERN "*.cpp"
PATTERN "*.mm"
PATTERN "*.h"
PATTERN "*.hpp"
)

set(SCITER_SHARE ${CURRENT_PACKAGES_DIR}/share/sciter)
set(SCITER_TOOLS ${CURRENT_PACKAGES_DIR}/tools/sciter)
set(TOOL_PERMS FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

# license
file(COPY ${SOURCE_PATH}/logfile.htm DESTINATION ${SCITER_SHARE})
file(INSTALL ${SOURCE_PATH}/license.htm DESTINATION ${SCITER_SHARE} RENAME copyright)

# samples & widgets
file(COPY ${SOURCE_PATH}/samples DESTINATION ${SCITER_SHARE})
file(COPY ${SOURCE_PATH}/widgets DESTINATION ${SCITER_SHARE})

# tools
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Linux AND VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(SCITER_BIN ${SOURCE_PATH}/bin.lnx/x64)

file(INSTALL ${SOURCE_PATH}/bin.lnx/packfolder DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SOURCE_PATH}/bin.lnx/tiscript DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})

file(INSTALL ${SCITER_BIN}/usciter DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/inspector DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${SCITER_TOOLS})

if ("windowless" IN_LIST FEATURES)
set(SCITER_BIN ${SOURCE_PATH}/bin.lnx/x64lite)
endif()

file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/libsciter-gtk.so DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(SCITER_BIN ${SOURCE_PATH}/bin.osx)

file(INSTALL ${SCITER_BIN}/packfolder DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})
file(INSTALL ${SCITER_BIN}/tiscript DESTINATION ${SCITER_TOOLS} ${TOOL_PERMS})

file(INSTALL ${SCITER_BIN}/inspector.app DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/sciter.app DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${SCITER_TOOLS})

# not sure whether there is a better way to do this, because
# `file(INSTALL sciter.app FILE_PERMISSIONS EXECUTE)`
# would mark everything as executable which is no go.
execute_process(COMMAND sh -c "chmod +x sciter.app/Contents/MacOS/sciter" WORKING_DIRECTORY ${SCITER_TOOLS})
execute_process(COMMAND sh -c "chmod +x inspector.app/Contents/MacOS/inspector" WORKING_DIRECTORY ${SCITER_TOOLS})

file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/libsciter.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)

else()
set(SCITER_BIN ${SOURCE_PATH}/bin.win/${SCITER_ARCH})
set(SCITER_BIN32 ${SOURCE_PATH}/bin.win/x32)

file(INSTALL ${SOURCE_PATH}/bin.win/packfolder.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SOURCE_PATH}/bin.win/tiscript.exe DESTINATION ${SCITER_TOOLS})

file(INSTALL ${SCITER_BIN32}/wsciter.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN32}/inspector.exe DESTINATION ${SCITER_TOOLS})
file(INSTALL ${SCITER_BIN32}/sciter.dll DESTINATION ${SCITER_TOOLS})

if ("windowless" IN_LIST FEATURES)
set(SCITER_BIN ${SOURCE_PATH}/bin.win/${SCITER_ARCH}lite)
endif()

file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SCITER_BIN}/sciter.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

message(STATUS "Warning: Sciter requires manual deployment of the correct DLL files.")
Options for existing users are:
1. Depend upon `sciter-js` and change your code to work with the new library
2. Use `"overrides"` in manifest mode to pin to `"version-string": "4.4.8.3#1"`
3. Copy the last available `sciter` version into an overlay port (commit 756f1845537a916ba706f6af544b2f490c30fbb1 at subpath `ports/sciter`)
4. Use the community registry `https://github.com/VuYeK/vcpkg-registry` which may have newer versions of `sciter` available (not affiliated with Microsoft)
")
11 changes: 2 additions & 9 deletions ports/sciter/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"name": "sciter",
"version-string": "4.4.8.3",
"port-version": 1,
"version-string": "deprecated",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe deprecated.use.sciter-js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this on different deprecated libraries in vcpkg and i wanted to be consistency

"description": "Sciter is an embeddable HTML/CSS/scripting engine.",
"homepage": "https://github.com/c-smile/sciter-sdk",
"supports": "!uwp",
"features": {
"windowless": {
"description": "Uses Sciter.Lite builds"
}
}
"homepage": "https://github.com/c-smile/sciter-js-sdk"
VuYeK marked this conversation as resolved.
Show resolved Hide resolved
}
5 changes: 5 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1379,8 +1379,13 @@ ryu:x86-windows=fail
ryu::arm64-windows=fail
sciter:arm64-windows=fail
sciter:arm-uwp=fail
sciter:x64-linux=fail
sciter:x64-osx=fail
sciter:x64-uwp=fail
sciter:x64-windows=fail
sciter:x64-windows-static=fail
sciter:x64-windows-static-md=fail
sciter:x86-windows=fail
scnlib:arm-uwp=fail
scnlib:x64-uwp=fail
scylla-wrapper:arm-uwp=fail
Expand Down
8 changes: 6 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5881,8 +5881,12 @@
"port-version": 0
},
"sciter": {
"baseline": "4.4.8.3",
"port-version": 1
"baseline": "deprecated",
"port-version": 0
},
"sciter-js": {
"baseline": "4.4.8.16",
"port-version": 0
},
"scnlib": {
"baseline": "0.4",
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/sciter-js.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "d8b949852b38b18eac5c4fa0c25282d531c596fd",
"version-string": "4.4.8.16",
"port-version": 0
}
]
}
5 changes: 5 additions & 0 deletions versions/s-/sciter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "942b0c505b2dd4317db0eb419416110c9db024be",
"version-string": "deprecated",
"port-version": 0
},
{
"git-tree": "7508c766a2564096e3ca656f6b4a26d582dcf855",
"version-string": "4.4.8.3",
Expand Down