aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorncihnegn <ncihnegn@users.noreply.github.com>2019-02-01 18:32:57 -0800
committerRobert Schumacher <roschuma@microsoft.com>2019-02-01 18:32:57 -0800
commit6cb714f850b93e3bc3cd30a40d832a5161dbd37a (patch)
tree5ddba191e136e21284cecccc5a2eae3462b7f234
parentc31e85586c8611bfc6d7d62ac3ce3aad60b8a656 (diff)
downloadvcpkg-6cb714f850b93e3bc3cd30a40d832a5161dbd37a.tar.gz
vcpkg-6cb714f850b93e3bc3cd30a40d832a5161dbd37a.zip
[systemc] Add new port (Microsoft#5250) (#5252)
* [systemc] Add new port (Microsoft#5250) * [systemc] Fix debug targets * [systemc] Use vcpkg_extract_source_archive_ex() * [systemc] Disable vcpkg_test_cmake() for now due to issues * [systemc] Fixup cmake targets
-rw-r--r--ports/systemc/CONTROL3
-rw-r--r--ports/systemc/install.patch23
-rw-r--r--ports/systemc/portfile.cmake41
-rw-r--r--ports/systemc/tlm_correct_dependency.patch8
4 files changed, 75 insertions, 0 deletions
diff --git a/ports/systemc/CONTROL b/ports/systemc/CONTROL
new file mode 100644
index 000000000..488a06338
--- /dev/null
+++ b/ports/systemc/CONTROL
@@ -0,0 +1,3 @@
+Source: systemc
+Version: 2.3.3-2
+Description: A set of C++ classes and macros which provide an event-driven simulation kernel in C++
diff --git a/ports/systemc/install.patch b/ports/systemc/install.patch
new file mode 100644
index 000000000..d335a8b18
--- /dev/null
+++ b/ports/systemc/install.patch
@@ -0,0 +1,23 @@
+--- CMakeLists.txt Sat Oct 13 00:19:07 2018
++++ CMakeLists.txt.fixed Mon Jan 28 15:51:38 2019
+@@ -555,7 +555,7 @@
+ endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+ # Set the installation paths for headers, libraries, and documentation.
+-set (CMAKE_INSTALL_DOCDIR "share/doc/systemc" CACHE PATH
++set (CMAKE_INSTALL_DOCDIR "share/systemc" CACHE PATH
+ "Documentation installation directory") # otherwise mixed-case
+ if (INSTALL_TO_LIB_BUILD_TYPE_DIR)
+ # Install libraries to lib-${CMAKE_BUILD_TYPE} so that different build variants
+@@ -589,9 +589,9 @@
+ set (SystemCTLM_INSTALL_CMAKEDIR share/cmake/SystemCTLM CACHE PATH
+ "CMake package configuration installation directory" FORCE)
+ else (INSTALL_TO_LIB_BUILD_TYPE_DIR OR INSTALL_TO_LIB_TARGET_ARCH_DIR)
+- set (SystemCLanguage_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/SystemCLanguage CACHE PATH
++ set (SystemCLanguage_INSTALL_CMAKEDIR share/SystemCLanguage CACHE PATH
+ "CMake package configuration installation directory for the SystemCLanguage package.")
+- set (SystemCTLM_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/SystemCTLM CACHE PATH
++ set (SystemCTLM_INSTALL_CMAKEDIR share/SystemCTLM CACHE PATH
+ "CMake package configuration installation directory for the SystemCTLM package.")
+ endif (INSTALL_TO_LIB_BUILD_TYPE_DIR OR INSTALL_TO_LIB_TARGET_ARCH_DIR)
+ mark_as_advanced(SystemCLanguage_INSTALL_CMAKEDIR SystemCTLM_INSTALL_CMAKEDIR)
diff --git a/ports/systemc/portfile.cmake b/ports/systemc/portfile.cmake
new file mode 100644
index 000000000..0165b8270
--- /dev/null
+++ b/ports/systemc/portfile.cmake
@@ -0,0 +1,41 @@
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+set(SYSTEMC_VERSION 2.3.3)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://www.accellera.org/images/downloads/standards/systemc/systemc-${SYSTEMC_VERSION}.zip"
+ FILENAME "systemc-${SYSTEMC_VERSION}.zip"
+ SHA512 f4df172addf816a1928d411dcab42c1679dc4c9d772f406c10d798a2c174d89cdac7a83947fa8beea1e3aff93da522d2d2daf61a4841ec456af7b7446c5c4a14
+)
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ REF ${SYSTEMC_VERSION}
+ PATCHES
+ install.patch
+ tlm_correct_dependency.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DCMAKE_CXX_STANDARD=17
+ -DDISABLE_COPYRIGHT_MESSAGE=ON
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/SystemCLanguage TARGET_PATH share/SystemCLanguage)
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/SystemCTLM TARGET_PATH share/SystemCTLM)
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/NOTICE DESTINATION ${CURRENT_PACKAGES_DIR}/share/systemc RENAME copyright)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/sysc/packages/qt/time)
+
+# Post-build test for cmake libraries (disabled for now due to issues with vcpkg_test_cmake)
+#vcpkg_test_cmake(PACKAGE_NAME SystemCLanguage)
+#vcpkg_test_cmake(PACKAGE_NAME SystemCTLM)
diff --git a/ports/systemc/tlm_correct_dependency.patch b/ports/systemc/tlm_correct_dependency.patch
new file mode 100644
index 000000000..56a4a466f
--- /dev/null
+++ b/ports/systemc/tlm_correct_dependency.patch
@@ -0,0 +1,8 @@
+--- cmake\SystemCTLMConfig.cmake.in Sat Oct 13 00:19:07 2018
++++ cmake\SystemCTLMConfig.cmake.in.fixed Mon Jan 28 15:23:44 2019
+@@ -2,4 +2,4 @@
+
+ # TLM is part of the SystemC language library.
+ include(CMakeFindDependencyMacro)
+-find_dependency (SystemC @SystemCLanguage_VERSION_MAJOR@.@SystemCLanguage_VERSION_MINOR@.@SystemCLanguage_VERSION_PATCH@.@SystemCLanguage_VERSION_RELEASE_DATE@ EXACT)
++find_dependency (SystemCLanguage @SystemCLanguage_VERSION_MAJOR@.@SystemCLanguage_VERSION_MINOR@.@SystemCLanguage_VERSION_PATCH@.@SystemCLanguage_VERSION_RELEASE_DATE@ EXACT)