From c2f0f893502384f5fa5957bbe8f2e5f464c0410a Mon Sep 17 00:00:00 2001 From: ygrek Date: Mon, 26 Aug 2024 10:49:49 -0400 Subject: [PATCH] ci: install crypto++ --- .github/workflows/workflow.yml | 27 ++++++++++++++++++++++++++- mldonkey.opam | 7 +++++-- src/utils/lib/CryptoPP.cc | 8 ++++---- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e7b9ad49..a3bc8304 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,6 +49,31 @@ jobs: with: ocaml-compiler: ${{ matrix.ocaml-version }} + - run: sudo apt install libcrypto++-dev libminiupnpc-dev libnatpmp-dev libgd-dev + if: matrix.os == 'ubuntu-latest' + + - run: brew install cryptopp miniupnpc libnatpmp gd + if: matrix.os == 'macos-latest' + + - run: | + echo "C_INCLUDE_PATH=$HOMEBREW_PREFIX/include:$C_INCLUDE_PATH" >> $GITHUB_ENV + echo "LIBRARY_PATH=$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" >> $GITHUB_ENV + if: matrix.os == 'macos-latest' + + # https://cygwin.com/packages/ doesn't have cryptopp and many other packages + # I guess should build with mingw? + - run: D:\\cygwin\\setup-x86_64.exe "--root" "D:\\cygwin" "--quiet-mode" "unattended" "--no-shortcuts" "--no-startmenu" "--no-desktop" "--no-admin" "--no-version-check" "--no-write-registry" "--packages" "mingw64-x86_64-gd" + if: matrix.os == 'windows-latest' + + - run: | + echo $CPATH + echo $C_INCLUDE_PATH + echo $LIBRARY_PATH + pkg-config --cflags libcrypto++ + pkg-config --libs libcrypto++ + echo "" | cpp -v || true + continue-on-error: true + - run: opam pin add mldonkey.dev . --no-action # not needed, opam install will do it automatically @@ -59,7 +84,7 @@ jobs: # https://github.com/ocaml/setup-ocaml/issues/815#issuecomment-2204838759 # SHELLOPTS workaround for windows # setting SHELLOPTS via GITHUB_ENV didn't work for some reason - - run: opam exec -- env SHELLOPTS=igncr sh ./configure --enable-debug + - run: opam exec -- env SHELLOPTS=igncr sh ./configure --enable-debug --enable-upnp-natpmp - run: opam exec -- make diff --git a/mldonkey.opam b/mldonkey.opam index bbdec157..11da0452 100644 --- a/mldonkey.opam +++ b/mldonkey.opam @@ -9,18 +9,21 @@ Supported networks include: * HTTP/FTP MLdonkey core runs as a background daemon and provides several control interfaces : telnet, web, and binary protocol for third party GUIs.""" -maintainer: "ygrek@autistici.org" +maintainer: "root@ygrek.org" authors: "mldonkey team" license: "GPL-2.0-only" homepage: "http://github.com/ygrek/mldonkey" dev-repo: "git+https://github.com/ygrek/mldonkey.git" bug-reports: "https://github.com/ygrek/mldonkey/issues" +# mldonkey has many optional components (most of which depend on system libraries), +# this set of dependencies here represents one arbitrary selection depends: [ "ocaml" {>= "4.03.0"} "camlp4" + "conf-gd" {optional} # graphical stats "conf-m4" "conf-zlib" - "num" + "num" # technically optional, enables bittorrent ] build: [ ["./configure" "--enable-debug" "--prefix" prefix] diff --git a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc index 0a8d7383..58e04445 100644 --- a/src/utils/lib/CryptoPP.cc +++ b/src/utils/lib/CryptoPP.cc @@ -1,7 +1,7 @@ -#include -#include -#include -#include +#include +#include +#include +#include // Standard stuff from other gpl clients, external for mldonkey.