From bfb3ef841b339b969708f52762efc38f6f799a50 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Mon, 27 Mar 2017 02:09:39 -0400 Subject: add pybind11 port --- ports/pybind11/CONTROL | 3 +++ ports/pybind11/portfile.cmake | 45 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ports/pybind11/CONTROL create mode 100644 ports/pybind11/portfile.cmake diff --git a/ports/pybind11/CONTROL b/ports/pybind11/CONTROL new file mode 100644 index 000000000..536647265 --- /dev/null +++ b/ports/pybind11/CONTROL @@ -0,0 +1,3 @@ +Source: pybind11 +Version: 2.0.1 +Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. \ No newline at end of file diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake new file mode 100644 index 000000000..47e195a22 --- /dev/null +++ b/ports/pybind11/portfile.cmake @@ -0,0 +1,45 @@ +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pybind11-2.0.1) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/pybind/pybind11/archive/v2.0.1.tar.gz" + FILENAME "pybind11-2.0.1.tar.gz" + SHA512 c156d01321b79eaac7992f431b30a9f4fb06e92909bf02e76a45e2d9329e7949dad686ee42a49c293214aec2a79eb400fa3373d2ba4876271895822096b50ff4 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# link the MSVC runtime statically if set. +if(VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(CRUNTIME /MD) +else() + set(CRUNTIME /MT) +endif() + +#STREQUAL empty here means the enviroment variable is not defined. +if(NOT $ENV{PYTHON} STREQUAL "") + set(PYTHON_VER $ENV{PYTHON}) +else() + message(FATAL_ERROR "You must set the PYTHON environment variable, eg. set PYTHON=3.5 or export PYTHON=3.5") +endif() + +if(NOT $ENV{CPP} STREQUAL "") + set(CPP_STD $ENV{CPP}) +else() + message(FATAL_ERROR "You must set the CPP environment variable, eg. set CPP=11 or export CPP=11.") +endif() +message(STATUS "Using C++${CPP_STD} and Python ${PYTHON_VER}") +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DPYBIND11_PYTHON_VERSION=${PYTHON_VER} + -DPYBIND11_CPP_STANDARD=${CPP_STD} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/) + + +# copy license +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pybind11/copyright) \ No newline at end of file -- cgit v1.2.3 From 0723e5268d37d4c9632c4b0fa99504216cfec38e Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Mon, 27 Mar 2017 02:21:48 -0400 Subject: update pybind11 to 2.1.0 --- ports/pybind11/CONTROL | 2 +- ports/pybind11/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/pybind11/CONTROL b/ports/pybind11/CONTROL index 536647265..a51fd173c 100644 --- a/ports/pybind11/CONTROL +++ b/ports/pybind11/CONTROL @@ -1,3 +1,3 @@ Source: pybind11 -Version: 2.0.1 +Version: 2.1.0 Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. \ No newline at end of file diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index 47e195a22..5dd99fddf 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -3,9 +3,9 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pybind11-2.0.1) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/pybind/pybind11/archive/v2.0.1.tar.gz" - FILENAME "pybind11-2.0.1.tar.gz" - SHA512 c156d01321b79eaac7992f431b30a9f4fb06e92909bf02e76a45e2d9329e7949dad686ee42a49c293214aec2a79eb400fa3373d2ba4876271895822096b50ff4 + URLS "https://github.com/pybind/pybind11/archive/v2.1.0.tar.gz" + FILENAME "pybind11-2.1.0.tar.gz" + SHA512 2f74dcd2b82d8e41da7db36351284fe04511038bec66bdde820da9c0fce92f6d2c5aeb2e48264058a91a775a1a6a99bc757d26ebf001de3df4183d700d46efa1 ) vcpkg_extract_source_archive(${ARCHIVE}) -- cgit v1.2.3 From 7a703e7a985589993518f72830f96738175e4d53 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Mon, 27 Mar 2017 02:36:12 -0400 Subject: remove unused options --- ports/pybind11/portfile.cmake | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index 5dd99fddf..d899aa31e 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -16,24 +16,9 @@ else() set(CRUNTIME /MT) endif() -#STREQUAL empty here means the enviroment variable is not defined. -if(NOT $ENV{PYTHON} STREQUAL "") - set(PYTHON_VER $ENV{PYTHON}) -else() - message(FATAL_ERROR "You must set the PYTHON environment variable, eg. set PYTHON=3.5 or export PYTHON=3.5") -endif() - -if(NOT $ENV{CPP} STREQUAL "") - set(CPP_STD $ENV{CPP}) -else() - message(FATAL_ERROR "You must set the CPP environment variable, eg. set CPP=11 or export CPP=11.") -endif() -message(STATUS "Using C++${CPP_STD} and Python ${PYTHON_VER}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DPYBIND11_PYTHON_VERSION=${PYTHON_VER} - -DPYBIND11_CPP_STANDARD=${CPP_STD} ) vcpkg_install_cmake() -- cgit v1.2.3 From 4990c31f7690131cea5fee7bcd2dea94a203606d Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Mon, 27 Mar 2017 03:21:22 -0400 Subject: fix sourcepath pybind11 2.1.0 --- ports/pybind11/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index d899aa31e..892b260b2 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -1,6 +1,6 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pybind11-2.0.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pybind11-2.1.0) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/pybind/pybind11/archive/v2.1.0.tar.gz" -- cgit v1.2.3 From 2aff607cbf0e946773a1804d630655209439930c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 27 Mar 2017 17:25:38 -0700 Subject: [pybind11] Disable building tests to remove pytest dependency. --- ports/pybind11/portfile.cmake | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index 892b260b2..933efbd19 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -9,22 +9,14 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -# link the MSVC runtime statically if set. -if(VCPKG_CRT_LINKAGE STREQUAL dynamic) - set(CRUNTIME /MD) -else() - set(CRUNTIME /MT) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS -DPYBIND11_TEST=OFF ) vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/) - # copy license file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pybind11/copyright) \ No newline at end of file -- cgit v1.2.3