aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/gklib
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/gklib')
-rw-r--r--vcpkg/ports/gklib/build-fixes.patch84
-rw-r--r--vcpkg/ports/gklib/portfile.cmake29
-rw-r--r--vcpkg/ports/gklib/vcpkg.json17
3 files changed, 130 insertions, 0 deletions
diff --git a/vcpkg/ports/gklib/build-fixes.patch b/vcpkg/ports/gklib/build-fixes.patch
new file mode 100644
index 0000000..3f8c26e
--- /dev/null
+++ b/vcpkg/ports/gklib/build-fixes.patch
@@ -0,0 +1,84 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6a9a694..fd3705e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -163,11 +163,6 @@ target_compile_definitions(${PROJECT_NAME}
+ target_compile_options(${PROJECT_NAME}
+ PUBLIC $<$<AND:$<BOOL:${GPROF}>,$<BOOL:${HAVE_GPROF_SUPPORT}>>:-pg>)
+
+-target_compile_options(${PROJECT_NAME}
+- PUBLIC $<$<AND:$<OR:$<BOOL:${DEBUG}>,$<BOOL:${GDB}>>,$<BOOL:${HAVE_GDB_SUPPORT}>>:-g>)
+-
+-target_compile_options(${PROJECT_NAME}
+- PUBLIC $<$<NOT:$<OR:$<BOOL:${DEBUG}>,$<BOOL:${GDB}>>>:-O3>)
+
+ target_link_libraries(${PROJECT_NAME}
+ PUBLIC $<$<BOOL:${OpenMP_C_FOUND}>:OpenMP::OpenMP_C>)
+diff --git a/cmake/GKlibSystem.cmake b/cmake/GKlibSystem.cmake
+index 249d424..94d9fd6 100644
+--- a/cmake/GKlibSystem.cmake
++++ b/cmake/GKlibSystem.cmake
+@@ -2,7 +2,6 @@
+
+ # Add compiler flags.
+ if(MSVC)
+- set(GKlib_COPTS "/Ox")
+ set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX")
+ elseif(MINGW)
+ set(GKlib_COPTS "-DUSE_GKREGEX")
+@@ -20,6 +19,8 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+
+ if(VALGRIND)
+ set(GKlib_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic")
++ elseif(1)
++ # Use flags from toolchain and triplet
+ else()
+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native")
+ endif(VALGRIND)
+@@ -30,6 +31,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+
+ # GCC warnings.
+ set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label")
++ string(REPLACE " -Werror " " " GKlib_COPTIONS "${GKlib_COPTIONS}")
+ endif()
+
+ if(${CMAKE_C_COMPILER_ID} MATCHES "Sun")
+diff --git a/include/gk_ms_inttypes.h b/include/gk_ms_inttypes.h
+index b89fc10..7247c38 100644
+--- a/include/gk_ms_inttypes.h
++++ b/include/gk_ms_inttypes.h
+@@ -35,6 +35,8 @@
+
+ #ifndef _MSC_INTTYPES_H_ // [
+ #define _MSC_INTTYPES_H_
++#include <inttypes.h>
++#elif 0
+
+ #if _MSC_VER > 1000
+ #pragma once
+diff --git a/include/gk_ms_stdint.h b/include/gk_ms_stdint.h
+index 7e200dc..1c51958 100644
+--- a/include/gk_ms_stdint.h
++++ b/include/gk_ms_stdint.h
+@@ -35,6 +35,8 @@
+
+ #ifndef _MSC_STDINT_H_ // [
+ #define _MSC_STDINT_H_
++#include <stdint.h>
++#elif 0
+
+ #if _MSC_VER > 1000
+ #pragma once
+diff --git a/src/win32/adapt.c b/src/win32/adapt.c
+index 546857c..d56f767 100644
+--- a/src/win32/adapt.c
++++ b/src/win32/adapt.c
+@@ -3,7 +3,7 @@
+ \brief Implementation of Win32 adaptation of libc functions
+ */
+
+-#include "adapt.h"
++#include "win32/adapt.h"
+
+ pid_t getpid(void)
+ {
diff --git a/vcpkg/ports/gklib/portfile.cmake b/vcpkg/ports/gklib/portfile.cmake
new file mode 100644
index 0000000..7e17797
--- /dev/null
+++ b/vcpkg/ports/gklib/portfile.cmake
@@ -0,0 +1,29 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO KarypisLab/GKlib
+ REF 6e7951358fd896e2abed7887196b6871aac9f2f8
+ SHA512 54ba87f2c47e025ada0fe6fe608d9d144df5cd13e97e71892dbba4d50cd96409add309937a540cdf8bd2632cbfbc0e22e080a32d114ba6037008c8676aa8d88d
+ PATCHES
+ build-fixes.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCMAKE_INSTALL_INCLUDEDIR=include/GKlib
+ -DGKLIB_BUILD_APPS=OFF
+ -DSHARED=${SHARED}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/GKlib")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/gklib/vcpkg.json b/vcpkg/ports/gklib/vcpkg.json
new file mode 100644
index 0000000..32ff41e
--- /dev/null
+++ b/vcpkg/ports/gklib/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "gklib",
+ "version-date": "2025-07-06",
+ "description": "General helper libraries for KarypisLab.",
+ "homepage": "https://github.com/KarypisLab/GKlib/",
+ "license": "Apache-2.0",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}