aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/awlib
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/awlib')
-rw-r--r--vcpkg/ports/awlib/fix-mac-build.patch75
-rw-r--r--vcpkg/ports/awlib/portfile.cmake35
-rw-r--r--vcpkg/ports/awlib/vcpkg.json39
3 files changed, 149 insertions, 0 deletions
diff --git a/vcpkg/ports/awlib/fix-mac-build.patch b/vcpkg/ports/awlib/fix-mac-build.patch
new file mode 100644
index 0000000..33eabd6
--- /dev/null
+++ b/vcpkg/ports/awlib/fix-mac-build.patch
@@ -0,0 +1,75 @@
+diff --git a/io/include/aw/io/mmap_file.h b/io/include/aw/io/mmap_file.h
+index 9846973..65e82aa 100644
+--- a/io/include/aw/io/mmap_file.h
++++ b/io/include/aw/io/mmap_file.h
+@@ -83,18 +83,18 @@ using win32::file_mapping;
+ inline file_mode get_file_mode(map_perms perms)
+ {
+ using mp = map_perms;
+- switch (perms) {
+- case mp::none:
+- case mp::none|mp::exec:
++ switch (static_cast<unsigned>(perms)) {
++ case static_cast<unsigned>(mp::none):
++ case static_cast<unsigned>(mp::none|mp::exec):
+ return file_mode::none;
+- case mp::read:
+- case mp::read|mp::exec:
++ case static_cast<unsigned>(mp::read):
++ case static_cast<unsigned>(mp::read|mp::exec):
+ return file_mode::read;
+- case mp::write:
++ case static_cast<unsigned>(mp::write):
+ return file_mode::write;
+- case mp::write|mp::exec:
+- case mp::rdwr:
+- case mp::rdwr|mp::exec:
++ case static_cast<unsigned>(mp::write|mp::exec):
++ case static_cast<unsigned>(mp::rdwr):
++ case static_cast<unsigned>(mp::rdwr|mp::exec):
+ return file_mode::read|file_mode::write;
+ }
+
+diff --git a/types/include/aw/types/bits/variant_dispatch.h b/types/include/aw/types/bits/variant_dispatch.h
+index 9d5dc3b..95a9394 100644
+--- a/types/include/aw/types/bits/variant_dispatch.h
++++ b/types/include/aw/types/bits/variant_dispatch.h
+@@ -71,11 +71,11 @@ struct vh_recursive {
+ if constexpr (Length_left > 0)
+ {
+ if (index < Mid)
+- return vh_recursive<Start,Mid,Ts...>::template dispatch(index, storage, f);
++ return vh_recursive<Start,Mid,Ts...>::dispatch(index, storage, f);
+ }
+
+ if constexpr (Length_right > 1)
+- return vh_recursive<Mid+1,End,Ts...>::template dispatch(index, storage, f);
++ return vh_recursive<Mid+1,End,Ts...>::dispatch(index, storage, f);
+
+ _unreachable();
+ }
+diff --git a/types/include/aw/types/byte_buffer.h b/types/include/aw/types/byte_buffer.h
+index 82f4693..b38c46a 100644
+--- a/types/include/aw/types/byte_buffer.h
++++ b/types/include/aw/types/byte_buffer.h
+@@ -8,6 +8,7 @@
+ */
+ #ifndef aw_types_byte_buffer_h
+ #define aw_types_byte_buffer_h
++#include <cstdlib>
+ #include <memory>
+ namespace aw {
+ /**
+diff --git a/types/include/aw/types/containers/queue.h b/types/include/aw/types/containers/queue.h
+index af8f13b..8398e8c 100644
+--- a/types/include/aw/types/containers/queue.h
++++ b/types/include/aw/types/containers/queue.h
+@@ -96,7 +96,7 @@ protected:
+ queue_base(queue_base&& other, Allocator const& alloc) noexcept
+ : impl(alloc)
+ {
+- if (alloc == other.alloc)
++ if (alloc == static_cast<Allocator&>(other.impl))
+ impl.swap(other.impl);
+ else
+ create_storage(other.allocated_size());
diff --git a/vcpkg/ports/awlib/portfile.cmake b/vcpkg/ports/awlib/portfile.cmake
new file mode 100644
index 0000000..637f229
--- /dev/null
+++ b/vcpkg/ports/awlib/portfile.cmake
@@ -0,0 +1,35 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO absurdworlds/awlib
+ REF ${VERSION}
+ SHA512 bfb4668abc3db176744bb674a20bf770c6406db522a14191069b8d833414285ca784f042c3ad50404f7f8bc76afe69627dfcf540080e12316abbbfe420955526
+ HEAD_REF master
+ PATCHES
+ fix-mac-build.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ hudf AW_ENABLE_HUDF
+ graphics AW_ENABLE_GRAPHICS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME ${PORT} CONFIG_PATH lib/cmake/${PORT})
+
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_copy_pdbs()
diff --git a/vcpkg/ports/awlib/vcpkg.json b/vcpkg/ports/awlib/vcpkg.json
new file mode 100644
index 0000000..ab6afb6
--- /dev/null
+++ b/vcpkg/ports/awlib/vcpkg.json
@@ -0,0 +1,39 @@
+{
+ "name": "awlib",
+ "version-date": "2024-04-06",
+ "port-version": 2,
+ "description": "Cross-platform utility library",
+ "homepage": "https://github.com/absurdworlds/awlib",
+ "license": "LGPL-3.0-or-later",
+ "supports": "!uwp & !android",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "graphics": {
+ "description": "Build graphics library",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "awlib",
+ "default-features": false,
+ "features": [
+ "hudf"
+ ]
+ },
+ "glfw3",
+ "libpng"
+ ]
+ },
+ "hudf": {
+ "description": "Build HuDF support"
+ }
+ }
+}