aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/guetzli
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/guetzli
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/guetzli')
-rw-r--r--vcpkg/ports/guetzli/CMakeLists.txt44
-rw-r--r--vcpkg/ports/guetzli/butteraugli.patch13
-rw-r--r--vcpkg/ports/guetzli/portfile.cmake24
-rw-r--r--vcpkg/ports/guetzli/vcpkg.json15
4 files changed, 96 insertions, 0 deletions
diff --git a/vcpkg/ports/guetzli/CMakeLists.txt b/vcpkg/ports/guetzli/CMakeLists.txt
new file mode 100644
index 0000000..af5eea6
--- /dev/null
+++ b/vcpkg/ports/guetzli/CMakeLists.txt
@@ -0,0 +1,44 @@
+cmake_minimum_required(VERSION 3.8.0)
+project(guetzli)
+
+if(MSVC)
+ add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX)
+endif()
+
+find_path(butteraugli_include butteraugli/butteraugli.h)
+find_library(butteraugli_library NAMES butteraugli_lib)
+find_package(PNG REQUIRED)
+
+include_directories("." ${PNG_INCLUDE_DIRS} ${butteraugli_include})
+
+file(GLOB guetzli_srcs "guetzli/*.cc")
+file(GLOB guetzli_includes "guetzli/*.h")
+list(REMOVE_ITEM guetzli_srcs "guetzli/guetzli.cc")
+
+add_library(guetzli_lib ${guetzli_srcs})
+
+target_compile_features(guetzli_lib PUBLIC cxx_std_11)
+
+add_executable(guetzli guetzli/guetzli.cc)
+
+target_link_libraries(guetzli_lib ${butteraugli_library} ${PNG_LIBRARIES})
+target_link_libraries(guetzli guetzli_lib ${butteraugli_library} ${PNG_LIBRARIES})
+
+
+install(
+ TARGETS guetzli_lib
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+if(NOT DISABLE_INSTALL_TOOLS)
+ install (
+ TARGETS guetzli
+ RUNTIME DESTINATION tools/guetzli
+ )
+endif()
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES ${guetzli_includes} DESTINATION include/guetzli)
+endif()
diff --git a/vcpkg/ports/guetzli/butteraugli.patch b/vcpkg/ports/guetzli/butteraugli.patch
new file mode 100644
index 0000000..ac124ca
--- /dev/null
+++ b/vcpkg/ports/guetzli/butteraugli.patch
@@ -0,0 +1,13 @@
+diff --git a/guetzli/butteraugli_comparator.cc b/guetzli/butteraugli_comparator.cc
+index 142c203..f4e710d 100644
+--- a/guetzli/butteraugli_comparator.cc
++++ b/guetzli/butteraugli_comparator.cc
+@@ -56,7 +56,7 @@ ButteraugliComparator::ButteraugliComparator(const int width, const int height,
+ height_(height),
+ target_distance_(target_distance),
+ rgb_orig_(*rgb),
+- comparator_(LinearRgb(width_, height_, *rgb)),
++ comparator_(LinearRgb(width_, height_, *rgb), 1.0f),
+ distance_(0.0),
+ stats_(stats) {}
+
diff --git a/vcpkg/ports/guetzli/portfile.cmake b/vcpkg/ports/guetzli/portfile.cmake
new file mode 100644
index 0000000..8287307
--- /dev/null
+++ b/vcpkg/ports/guetzli/portfile.cmake
@@ -0,0 +1,24 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/guetzli
+ REF 214f2bb42abf5a577c079d00add5d6cc470620d3 # accessed on 2020-09-14
+ SHA512 841cb14df4d27d3227e0ef8ecff6bd8a222d791abfc8fb593bf68996ed8861a9cc483f1a9b140023a247a5b1a350197601ca75a990507aaafa1b2dd03f8577d0
+ HEAD_REF master
+ PATCHES butteraugli.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/guetzli")
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/guetzli" RENAME copyright)
diff --git a/vcpkg/ports/guetzli/vcpkg.json b/vcpkg/ports/guetzli/vcpkg.json
new file mode 100644
index 0000000..05da33a
--- /dev/null
+++ b/vcpkg/ports/guetzli/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "guetzli",
+ "version-date": "2020-09-14",
+ "port-version": 2,
+ "description": "Perceptual JPEG encoder",
+ "homepage": "https://github.com/google/guetzli",
+ "dependencies": [
+ "butteraugli",
+ "libpng",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}