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

[tcl] Add new port #8026

Merged
merged 1 commit into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ports/tcl/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Source: tcl
Version: 8.6.5
Homepage: https://github.com/tcltk/tcl
Description: Tcl provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications.
85 changes: 85 additions & 0 deletions ports/tcl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
include(vcpkg_common_functions)
# the working 9.0 alpha release has fixes to their nmake script that are needed, 8.6.9 has issues with configuration
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO tcltk/tcl
REF fb28af5fa6c4ffcd2d176c5617e5640acbfb8114
SHA512 f58a0039eb6d48dc711675e5052e18c6a90e377afe02922ab3ba0cbd6655c85d01ae2d954698c6563d45672f700c97cddf1d165ca8bb6064e5aaf8c31c76856f)

if(VCPKG_TARGET_IS_WINDOWS)
find_program(NMAKE nmake REQUIRED)

if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
set(MACHINE_STR AMD64)
else()
set(MACHINE_STR IX86)
endif()

if(VCPKG_LIBRARY_LINKAGE MATCHES "static")
set(STATIC_OPT ",static")
endif()

message(STATUS "Building ${TARGET_TRIPLET}-release")
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f makefile.vc release OPTS=${STATIC_OPT} MACHINE=${MACHINE_STR}
WORKING_DIRECTORY ${SOURCE_PATH}/win
LOGNAME build-${TARGET_TRIPLET}-release
)
message(STATUS "Building ${TARGET_TRIPLET}-release done")
message(STATUS "Building ${TARGET_TRIPLET}-debug")

vcpkg_execute_required_process(
COMMAND ${NMAKE} -f makefile.vc release OPTS=symbols${STATIC_OPT} MACHINE=${MACHINE_STR}
WORKING_DIRECTORY ${SOURCE_PATH}/win
LOGNAME build-${TARGET_TRIPLET}-debug
)
message(STATUS "Building ${TARGET_TRIPLET}-debug done")

message(STATUS "Installing ${TARGET_TRIPLET}-debug")
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR}\\debug OPTS=symbols${STATIC_OPT} SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\tools\\tcl\\debug\\lib\\tcl9.0
WORKING_DIRECTORY ${SOURCE_PATH}/win
LOGNAME install-${TARGET_TRIPLET}-debug
)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(VCPKG_LIBRARY_LINKAGE MATCHES "dynamic")
file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/dde1.4 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/dde1.4)
file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/reg1.3 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/reg1.3)
file(COPY ${CURRENT_PACKAGES_DIR}/debug/bin/tcl90g.dll DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug)
file(COPY ${CURRENT_PACKAGES_DIR}/debug/bin/tclsh90g.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug/bin)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/tclsh90g.exe)
else()
file(COPY ${CURRENT_PACKAGES_DIR}/debug/bin/tclsh90sg.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

message(STATUS "Installing ${TARGET_TRIPLET}-debug done")

message(STATUS "Installing ${TARGET_TRIPLET}-release")
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f makefile.vc install INSTALLDIR=${CURRENT_PACKAGES_DIR} OPTS=${STATIC_OPT} SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}\\tools\\tcl\\lib\\tcl9.0
WORKING_DIRECTORY ${SOURCE_PATH}/win
LOGNAME install-${TARGET_TRIPLET}-release
)

if(VCPKG_LIBRARY_LINKAGE MATCHES "dynamic")
file(COPY ${CURRENT_PACKAGES_DIR}/lib/dde1.4 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/dde1.4)
file(COPY ${CURRENT_PACKAGES_DIR}/lib/reg1.3 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/reg1.3)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/tclsh90.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/bin)
else()
file(COPY ${CURRENT_PACKAGES_DIR}/bin/tclsh90s.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tcl/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/tcl/bin)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/tclsh90.exe)
message(STATUS "Installing ${TARGET_TRIPLET}-release done")

file(INSTALL ${SOURCE_PATH}/license.terms DESTINATION ${CURRENT_PACKAGES_DIR}/share/tcl RENAME copyright)
else()
message(ERROR "Unsupported Operating System ${VCPKG_CMAKE_SYSTEM_NAME}")
Copy link
Contributor

Choose a reason for hiding this comment

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

While I appreciate you explicitly failing on platforms you didn't develop for, I know for a fact that TCL is cross-platform. Is the effort in getting it to work with linux and osx too high?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cbezault you are absolutely right! tcl has a custom config for linux https://github.com/tcltk/tcl/tree/master/unix and osx https://github.com/tcltk/tcl/tree/master/macosx.

unfortunately I didn't have much luck implementing on my Ubuntu VM, I believe the configuration needs a treatment similar to ffmpeg https://github.com/microsoft/vcpkg/tree/master/ports/ffmpeg , but was unable to apply this.

as far as osx goes I do not have a VM for that OS and so I cannot push a OS specific configuration with confidence. I can run it against the azure pipelines but that doesn't help me know if the package is usable after configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cbezault I would also like to add that I do not know if ARM configuration is possible on Windows, see this line https://github.com/tcltk/tcl/blob/master/win/makefile.vc#L96

I know that ARM is definitely possible on Linux as I have seen builds for that configuration online

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah last I remember I couldn't run Tcl on ARM. We'd have people emulate x86 on their arm devices if they really needed to run on them.

endif()