diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/rappture | |
Diffstat (limited to 'vcpkg/ports/rappture')
| -rw-r--r-- | vcpkg/ports/rappture/CMakeLists.txt | 112 | ||||
| -rw-r--r-- | vcpkg/ports/rappture/include_functional.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/rappture/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/rappture/rappture.patch | 89 | ||||
| -rw-r--r-- | vcpkg/ports/rappture/vcpkg.json | 19 |
5 files changed, 264 insertions, 0 deletions
diff --git a/vcpkg/ports/rappture/CMakeLists.txt b/vcpkg/ports/rappture/CMakeLists.txt new file mode 100644 index 0000000..1ddaaa7 --- /dev/null +++ b/vcpkg/ports/rappture/CMakeLists.txt @@ -0,0 +1,112 @@ +cmake_minimum_required(VERSION 3.11)
+cmake_policy(VERSION 3.11)
+
+project (rappture)
+
+set(SRC_RAPPTURE_CORE
+ src/core/scew_extras.c
+ src/core/RpBindingsDict.cc
+ src/core/RpBuffer.cc
+ src/core/RpBufferCInterface.cc
+ src/core/RpDXWriter.cc
+ src/core/RpDXWriterFInterface.cc
+ src/core/RpEncode.cc
+ src/core/RpEntityRef.cc
+ src/core/RpFortranCommon.cc
+ src/core/RpLibrary.cc
+ src/core/RpLibraryCInterface.cc
+ src/core/RpLibraryFInterface.cc
+ src/core/RpOutcome.cc
+ src/core/RpOutcomeCInterface.cc
+ src/core/RpPtr.cc
+ src/core/RpResult.cc
+ src/core/RpUnits.cc
+ src/core/RpUnitsCInterface.cc
+ src/core/RpUnitsFInterface.cc
+ src/core/RpUnitsStd.cc
+ src/core/RpUtils.cc
+ src/core/RpUtilsCInterface.cc
+ src/core/RpUtilsFInterface.cc
+ src/core/b64/cdecode.c
+ src/core/b64/cencode.c
+ src/core/scew/attribute.c
+ src/core/scew/element.c
+ src/core/scew/error.c
+ src/core/scew/parser.c
+ src/core/scew/str.c
+ src/core/scew/tree.c
+ src/core/scew/writer.c
+ src/core/scew/xattribute.c
+ src/core/scew/xerror.c
+ src/core/scew/xhandler.c
+ src/core/scew/xparser.c
+ src/core/scew/xprint.c
+)
+
+set(HEADERS
+ src/core/rappture.h
+ src/core/RpBindingsDict.h
+ src/core/RpBuffer.h
+ src/core/RpBufferCHelper.h
+ src/core/RpBufferCInterface.h
+ src/core/RpDict.h
+ src/core/RpDXWriter.h
+ src/core/RpDXWriterFInterface.h
+ src/core/RpDXWriterFStubs.h
+ src/core/RpEncode.h
+ src/core/RpEntityRef.h
+ src/core/RpFortranCommon.h
+ src/core/RpLibrary.h
+ src/core/RpLibraryCInterface.h
+ src/core/RpLibraryFInterface.h
+ src/core/RpLibraryFStubs.h
+ src/core/RpOutcome.h
+ src/core/RpOutcomeCHelper.h
+ src/core/RpOutcomeCInterface.h
+ src/core/RpPtr.h
+ src/core/RpSimpleBuffer.h
+ src/core/RpUnits.h
+ src/core/RpUnitsCInterface.h
+ src/core/RpUnitsFInterface.h
+ src/core/RpUnitsFStubs.h
+ src/core/RpUnitsStd.h
+ src/core/RpUtils.h
+ src/core/RpUtilsCInterface.h
+ src/core/RpUtilsFInterface.h
+ src/core/RpUtilsFStubs.h
+ src/core/scew_extras.h
+
+)
+
+add_library(rappture ${SRC_RAPPTURE_CORE} ${HEADERS})
+
+set_property(TARGET rappture PROPERTY CXX_STANDARD 11)
+
+target_include_directories(rappture PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/core/>
+ $<INSTALL_INTERFACE:include>
+)
+
+find_package(expat CONFIG REQUIRED)
+find_package(ZLIB REQUIRED)
+
+target_compile_definitions(rappture PUBLIC
+ -D_CRT_SECURE_NO_WARNINGS
+ -DRAPPTURE_VERSION=1.9
+ -DSVN_VERSION=6713
+ -D_USE_MATH_DEFINES
+)
+
+target_link_libraries(rappture PRIVATE
+ expat::expat
+ ZLIB::ZLIB
+)
+
+install(TARGETS rappture EXPORT rappture-config
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ )
+
+install(FILES ${HEADERS} DESTINATION include/rappture)
+install(EXPORT rappture-config NAMESPACE unofficial::rappture:: DESTINATION share/rappture)
diff --git a/vcpkg/ports/rappture/include_functional.patch b/vcpkg/ports/rappture/include_functional.patch new file mode 100644 index 0000000..b3606d2 --- /dev/null +++ b/vcpkg/ports/rappture/include_functional.patch @@ -0,0 +1,12 @@ +diff --git a/src/core/RpUnits.h b/src/core/RpUnits.h +index a640205..e697424 100644 +--- a/src/core/RpUnits.h ++++ b/src/core/RpUnits.h +@@ -59,6 +59,7 @@ enum RP_UNITS_CONSTS { + #include <stdlib.h> + #include <errno.h> + #include <math.h> ++#include <functional> + + #include "RpDict.h" + #include "RpUnitsStd.h" diff --git a/vcpkg/ports/rappture/portfile.cmake b/vcpkg/ports/rappture/portfile.cmake new file mode 100644 index 0000000..7451fff --- /dev/null +++ b/vcpkg/ports/rappture/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://nanohub.org/app/site/downloads/rappture/rappture-src-20130903.tar.gz"
+ FILENAME "rappture-src-20130903.tar.gz"
+ SHA512 3b42569d056c5e80762eada3aff23d230d4ba8f6f0078de44d8571a713dde91e31e66fe3c37ceb66e934a1410b338fb481aeb5a29ef56b53da4ad2e8a2a2ae59
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES
+ rappture.patch
+ include_functional.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup()
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.terms")
diff --git a/vcpkg/ports/rappture/rappture.patch b/vcpkg/ports/rappture/rappture.patch new file mode 100644 index 0000000..d8c7ff6 --- /dev/null +++ b/vcpkg/ports/rappture/rappture.patch @@ -0,0 +1,89 @@ +diff --git a/src/core/RpBuffer.cc b/src/core/RpBuffer.cc +index 6d439fe..ec45405 100644 +--- a/src/core/RpBuffer.cc ++++ b/src/core/RpBuffer.cc +@@ -16,7 +16,6 @@ + #include <stdio.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <unistd.h> + #include <fstream> + #include <zlib.h> + #include "b64/encode.h" +@@ -24,6 +23,11 @@ + #include "RpBuffer.h" + #include "RpEncode.h" + ++#if defined(_MSC_VER) ++#include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif ++ + namespace Rappture { + + /** +@@ -109,6 +113,9 @@ Buffer::operator+=(const Buffer& b) + Buffer::~Buffer() + {} + ++#ifndef _WIN32 ++# define _fileno fileno ++#endif + + bool + Buffer::load (Outcome &status, const char *path) +@@ -123,7 +130,7 @@ Buffer::load (Outcome &status, const char *path) + } + + struct stat stat; +- if (fstat(fileno(f), &stat) < 0) { ++ if (fstat(_fileno(f), &stat) < 0) { + status.addError("can't stat \"%s\": %s", path, strerror(errno)); + return false; + } +diff --git a/src/core/RpDXWriter.cc b/src/core/RpDXWriter.cc +index e4748b3..8990c0f 100644 +--- a/src/core/RpDXWriter.cc ++++ b/src/core/RpDXWriter.cc +@@ -18,6 +18,12 @@ + #include <cfloat> + #include <RpDXWriter.h> + #include <assert.h> ++ ++#if defined(_MSC_VER) ++#include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif ++ + using namespace Rappture; + + DXWriter::DXWriter() : +diff --git a/src/core/RpLibrary.cc b/src/core/RpLibrary.cc +index 2b9a540..4da787b 100644 +--- a/src/core/RpLibrary.cc ++++ b/src/core/RpLibrary.cc +@@ -11,7 +11,6 @@ + * ====================================================================== + */ + +-#include "config.h" + #include "scew/scew.h" + #include "scew_extras.h" + #include "RpLibrary.h" +diff --git a/src/core/scew/scew.h b/src/core/scew/scew.h +index 9741ed5..e335c2d 100644 +--- a/src/core/scew/scew.h ++++ b/src/core/scew/scew.h +@@ -61,12 +61,6 @@ + # define SCEW_LIB_D + # endif /* _DEBUG */ + +-# if defined(SCEW_LIB_U) || defined(SCEW_LIB_S) || defined(SCEW_LIB_D) +-# pragma comment( lib, "scew_" SCEW_LIB_U SCEW_LIB_S SCEW_LIB_D ".lib" ) +-# else +-# pragma comment( lib, "scew.lib" ) +-# endif +- + #endif /* _WIN32 */ + + #endif /* SCEW_H_ALEIX0211250134 */ diff --git a/vcpkg/ports/rappture/vcpkg.json b/vcpkg/ports/rappture/vcpkg.json new file mode 100644 index 0000000..ab94b10 --- /dev/null +++ b/vcpkg/ports/rappture/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "rappture", + "version": "1.9", + "port-version": 4, + "description": "Rappture is a toolkit supporting Rapid application infrastructure, making it quick and easy to develop powerful scientific applications.", + "license": null, + "dependencies": [ + "expat", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} |