aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libcrafter
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libcrafter')
-rw-r--r--vcpkg/ports/libcrafter/fix-build-error.patch20
-rw-r--r--vcpkg/ports/libcrafter/portfile.cmake26
-rw-r--r--vcpkg/ports/libcrafter/vcpkg.json11
3 files changed, 57 insertions, 0 deletions
diff --git a/vcpkg/ports/libcrafter/fix-build-error.patch b/vcpkg/ports/libcrafter/fix-build-error.patch
new file mode 100644
index 0000000..cc97b4a
--- /dev/null
+++ b/vcpkg/ports/libcrafter/fix-build-error.patch
@@ -0,0 +1,20 @@
+diff --git a/libcrafter/configure.ac b/libcrafter/configure.ac
+index 860d98b..b04ccce 100644
+--- a/libcrafter/configure.ac
++++ b/libcrafter/configure.ac
+@@ -35,14 +35,13 @@ AC_ARG_WITH(libpcap,
+ PCAPINC="-I$withval -I$withval/bpf"
+ PCAPLIB="-L$withval -lpcap"
+ elif test -f $withval/include/pcap.h -a \
+- -f $withval/include/net/bpf.h -a \
+ -f $withval/lib/libpcap.a; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ PCAPINC="-I$withval/include"
+ PCAPLIB="-L$withval/lib -lpcap"
+ else
+- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
++ AC_ERROR(pcap.h, or libpcap.a not found in $withval)
+ fi
+ ;;
+ esac ],
diff --git a/vcpkg/ports/libcrafter/portfile.cmake b/vcpkg/ports/libcrafter/portfile.cmake
new file mode 100644
index 0000000..b72759a
--- /dev/null
+++ b/vcpkg/ports/libcrafter/portfile.cmake
@@ -0,0 +1,26 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO pellegre/libcrafter
+ REF 86f81f101b5e3051ed04563b3ad3dd7a823afb21 #version-1.0
+ SHA512 bd0eac06896df63f0fff0ed3cf7ca5176e56615476c8134bd26f035692ab9e583f58f1f57daa7673771a710d6921c0c6a6473ab181982ad57727584f2cde56d0
+ HEAD_REF master
+ PATCHES fix-build-error.patch
+)
+
+vcpkg_configure_make(
+ AUTOCONFIG
+ SOURCE_PATH "${SOURCE_PATH}"
+ PROJECT_SUBPATH libcrafter
+ OPTIONS
+ "--with-libpcap=${CURRENT_INSTALLED_DIR}"
+)
+
+vcpkg_install_make()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/libcrafter/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/libcrafter/vcpkg.json b/vcpkg/ports/libcrafter/vcpkg.json
new file mode 100644
index 0000000..8f8dfd0
--- /dev/null
+++ b/vcpkg/ports/libcrafter/vcpkg.json
@@ -0,0 +1,11 @@
+{
+ "name": "libcrafter",
+ "version": "1.0",
+ "port-version": 2,
+ "description": "Libcrafter is a high level library for C++ designed to create and decode network packets.",
+ "homepage": "https://github.com/pellegre/libcrafter",
+ "supports": "!windows",
+ "dependencies": [
+ "libpcap"
+ ]
+}