Skip to content
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
78 changes: 78 additions & 0 deletions ports/jsonnet/001-enable-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8682cc8..88b95c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,8 @@ set(GLOBAL_OUTPUT_PATH_SUFFIX "" CACHE STRING

project(jsonnet C CXX)

+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
# Discourage in-source builds because they overwrite the hand-written Makefile.
# Use `cmake . -B<dir>` or the CMake GUI to do an out-of-source build.
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} AND
@@ -73,17 +75,6 @@ elseif (BUILD_TESTS AND USE_SYSTEM_GTEST)
add_subdirectory(/usr/src/googletest ${GLOBAL_OUTPUT_PATH}/googletest-build)
endif()

-# Compiler flags.
-if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR
- ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
- set(OPT "-O3")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wextra -pedantic -std=c99 -O3 ${OPT}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC ${OPT}")
-else()
- # TODO: Windows support.
- message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported")
-endif()
-
# Look for libraries in global output path.
link_directories(${GLOBAL_OUTPUT_PATH})

diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index f1c32b8..1a45a51 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -28,7 +28,7 @@ set(LIBJSONNET_SOURCE
string_utils.cpp
vm.cpp)

-add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
+add_library(libjsonnet ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet md5 stdlib)
target_link_libraries(libjsonnet md5)

@@ -36,13 +36,12 @@ target_link_libraries(libjsonnet md5)
# this step the output would be |liblibjsonnet|.
set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet
VERSION 0.12.1 SOVERSION 0)
-install(TARGETS libjsonnet DESTINATION lib)
+install(TARGETS libjsonnet DESTINATION lib RUNTIME DESTINATION bin)

# Static library for jsonnet command-line tool.
add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet_static md5 stdlib)
target_link_libraries(libjsonnet_static md5)
-set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet)

# Tests

diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt
index a481d9f..9fe768e 100644
--- a/stdlib/CMakeLists.txt
+++ b/stdlib/CMakeLists.txt
@@ -2,14 +2,6 @@

add_executable(to_c_array to_c_array.cpp)

-# Custom command that will only build stdlib when it changes.
-add_custom_command(
- OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h
- COMMAND ${GLOBAL_OUTPUT_PATH}/to_c_array
- ${PROJECT_SOURCE_DIR}/stdlib/std.jsonnet
- ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h
- DEPENDS to_c_array std.jsonnet)
-
# Standard library build target that libjsonnet can depend on.
add_custom_target(stdlib ALL
DEPENDS ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h)
49 changes: 0 additions & 49 deletions ports/jsonnet/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions ports/jsonnet/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: jsonnet
Version: 2018-11-01-3
Description: Jsonnet - The data templating language
Source: jsonnet
Version: 2019-05-08
Description: Jsonnet - The data templating language
22 changes: 13 additions & 9 deletions ports/jsonnet/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/jsonnet
REF a0876b301daf8f45e16ac5f7bb814d0617772bb0
SHA512 a57380ecc578b11f3a763202abb7ab703f2cc3c098ca7602d0bd199594a9e8d1cebc6d51332658edb08bf088e565d6afae0cb2faaf127fa33542a406de1ac055
HEAD_REF master
OUT_SOURCE_PATH SOURCE_PATH
REPO google/jsonnet
REF c323f5ce5b8aa663585d23dc0fb94d4b166c6f16
SHA512 d9f84c39929e9e80272e2b834f68a13b48c1cb4d64b70f5b6fa16e677555d947f7cf57372453e23066a330faa6a429b9aa750271b46f763581977a223d238785
HEAD_REF master
PATCHES
001-enable-msvc.patch
)

if (WIN32)
Expand All @@ -24,15 +28,15 @@ else()
)
endif()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
PREFER_NINJA
OPTIONS -DBUILD_JSONNET=OFF -DBUILD_TESTS=OFF
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/jsonnet)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jsonnet RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)