aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/fribidi
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/fribidi')
-rw-r--r--vcpkg/ports/fribidi/meson-crosscompile.patch36
-rw-r--r--vcpkg/ports/fribidi/portfile.cmake54
-rw-r--r--vcpkg/ports/fribidi/vcpkg.json18
3 files changed, 108 insertions, 0 deletions
diff --git a/vcpkg/ports/fribidi/meson-crosscompile.patch b/vcpkg/ports/fribidi/meson-crosscompile.patch
new file mode 100644
index 0000000..07368a0
--- /dev/null
+++ b/vcpkg/ports/fribidi/meson-crosscompile.patch
@@ -0,0 +1,36 @@
+diff --git a/gen.tab/meson.build b/gen.tab/meson.build
+index 8c21e98..1cd9960 100644
+--- a/gen.tab/meson.build
++++ b/gen.tab/meson.build
+@@ -1,5 +1,10 @@
+ # gen.tab
+
++if get_option('pregenerated_tab') != ''
++ generated_tab_include_files = []
++ fribidi_unicode_version_h = files()
++ add_project_arguments('-I' + get_option('pregenerated_tab'), language: 'c')
++else
+ native_cc = meson.get_compiler('c')
+
+ # Don't pick up top-level config.h, as that has defines for the cross-compiler
+@@ -75,7 +80,10 @@ foreach tab : tabs
+ input: gen_prog_inputs,
+ output: gen_prog_out,
+ command: [gen_exe, COMPRESSION, '@INPUT@', gen_prog_name],
++ install: true,
++ install_dir: 'share/fribidi/gen.tab',
+ capture: true)
+
+ generated_tab_include_files += [tab_inc_file]
+ endforeach
++endif
+diff --git a/meson_options.txt b/meson_options.txt
+index f54a639..8f60205 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -8,3 +8,5 @@ option('tests', type : 'boolean', value : true,
+ description: 'Build tests')
+ option('fuzzer_ldflags', type : 'string',
+ description: 'Extra LDFLAGS used during linking of fuzzing binaries')
++option('pregenerated_tab', type: 'string',
++ description: 'Path to pregenerated table sources')
diff --git a/vcpkg/ports/fribidi/portfile.cmake b/vcpkg/ports/fribidi/portfile.cmake
new file mode 100644
index 0000000..a53ca14
--- /dev/null
+++ b/vcpkg/ports/fribidi/portfile.cmake
@@ -0,0 +1,54 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO fribidi/fribidi
+ REF v${VERSION}
+ SHA512 13d7104f80e1b480d65a4c47fd694f5930222f3db843b8b6c1b6af58c43ee74b08635ce6166d005451498d060e549e4c666aa30c46d4df003d9ad63dba1d854a
+ HEAD_REF master
+ PATCHES meson-crosscompile.patch
+)
+
+set(gen_tab_subdir "share/${PORT}/gen.tab")
+
+set(options "")
+if(VCPKG_CROSSCOMPILING)
+ set(gen_tab "${CURRENT_HOST_INSTALLED_DIR}/${gen_tab_subdir}")
+ cmake_path(NATIVE_PATH gen_tab gen_tab)
+ set(options "-Dpregenerated_tab=${gen_tab}")
+endif()
+
+vcpkg_configure_meson(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${options}
+ -Ddocs=false
+ -Dbin=false
+ -Dtests=false
+)
+
+vcpkg_install_meson()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+# Define static macro
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h" "# elif defined(_WIN32) && ! defined(FRIBIDI_LIB_STATIC)" "# elif defined(_WIN32) && 0")
+else()
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h" "# elif defined(_WIN32) && ! defined(FRIBIDI_LIB_STATIC)" "# elif defined(_WIN32) && 1")
+endif()
+
+if(VCPKG_CROSSCOMPILING)
+ file(
+ COPY "${gen_tab}/fribidi-unicode-version.h"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/include/fribidi"
+ )
+else()
+ file(
+ COPY "${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-unicode-version.h"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/${gen_tab_subdir}"
+ )
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/fribidi/vcpkg.json b/vcpkg/ports/fribidi/vcpkg.json
new file mode 100644
index 0000000..2d8e02b
--- /dev/null
+++ b/vcpkg/ports/fribidi/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "fribidi",
+ "version": "1.0.16",
+ "description": "GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi)",
+ "homepage": "https://www.gnu.org/software/fribidi",
+ "license": "LGPL-2.1-or-later",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "fribidi",
+ "host": true
+ },
+ {
+ "name": "vcpkg-tool-meson",
+ "host": true
+ }
+ ]
+}