From bba5f7c574f9872a396fe69c1f0f044dd44aa149 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Mon, 11 Dec 2023 08:43:56 -0800 Subject: [PATCH 1/4] meson_options: default to nss --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 0abdf34fb..66e4ad79c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,4 +24,4 @@ option('WITH_JPG', description: 'Build JPG thumbnailer output support (WIP)', ty option('WITH_SANITY', description: 'Enable MistOutSanityCheck output for testing purposes', type: 'boolean', value: false) option('LSP_MINIFY', description: 'Try to minify LSP JS via java closure-compiler, generally not needed unless changing JS code as a minified version is part of the repository already', type: 'boolean', value: false) option('LOCAL_GENERATORS', description: 'Attempts to find a locally-installed version of sourcery and make_html, instead of compiling it', type: 'boolean', value: false) -option('SRTP_CRYPTO_LIBRARY', type: 'combo', choices : ['none', 'openssl', 'nss', 'mbedtls'], value : 'mbedtls', description : 'What external crypto library to leverage for libsrtp2, if any (OpenSSL, NSS, or mbedtls)') +option('SRTP_CRYPTO_LIBRARY', type: 'combo', choices : ['none', 'openssl', 'nss', 'mbedtls'], value : 'nss', description : 'What external crypto library to leverage for libsrtp2, if any (OpenSSL, NSS, or mbedtls)') From d964e24e1bf74c2385137ccd22cf8d0c1100cbf0 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Mon, 11 Dec 2023 08:59:37 -0800 Subject: [PATCH 2/4] Dockerfile: add libnss3-dev libssl-dev --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8db88b2e6..88c3af648 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /src RUN apt update -yq \ - && apt install -yqq build-essential cmake git python3-pip \ + && apt install -yqq build-essential cmake git python3-pip libnss3-dev libssl-dev \ && pip3 install -U meson ninja COPY . . From f4bcf1399282851e1289b8ff5cbafab2bc9b661c Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Mon, 11 Dec 2023 09:03:57 -0800 Subject: [PATCH 3/4] Dockerfile: add pkg-config --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 88c3af648..4d6b13af3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /src RUN apt update -yq \ - && apt install -yqq build-essential cmake git python3-pip libnss3-dev libssl-dev \ + && apt install -yqq build-essential cmake git python3-pip libnss3-dev libssl-dev pkg-config \ && pip3 install -U meson ninja COPY . . From 1ce48fe5cb92de38c9fd013c3795016affaaa696 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Mon, 11 Dec 2023 09:46:07 -0800 Subject: [PATCH 4/4] drone: add library dependencies also hardcode macos to mbedtls because it's hard to get the others and presumably we don't care about peak webrtc performance there --- .drone.star | 83 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 33 deletions(-) diff --git a/.drone.star b/.drone.star index dbc5df327..33d0dc030 100644 --- a/.drone.star +++ b/.drone.star @@ -176,6 +176,55 @@ def binaries_pipeline(context, platform): context.build.event == "tag" and context.build.ref ) or context.build.commit + steps = [] + crypto_library = "" + + if platform["os"] == "linux": + steps.append({ + "name": "libraries", + "commands": [ + 'apt -o DPkg::Lock::Timeout=60 install -y libnss3-dev libssl-dev pkg-config', + ], + }) + + if platform["os"] == "darwin": + # difficult to get the other options compiling on darwin at the moment + crypto_library = " -D SRTP_CRYPTO_LIBRARY=mbedtls " + + steps.extend([ + { + "name": "binaries", + "commands": [ + 'export CI_PATH="$(realpath ..)"', + "echo {} | tee BUILD_VERSION".format(version), + "meson setup -DLOAD_BALANCE=true -DNORIST=true -DNORIST=true -Dprefix=$CI_PATH --default-library static build " + crypto_library, + "cd build/", + "ninja && ninja install", + ], + }, + { + "name": "compress", + "commands": [ + 'export CI_PATH="$(realpath ..)"', + "cd $CI_PATH/bin/", + "tar -czvf livepeer-mistserver-%s-%s.tar.gz ./*" + % (platform["os"], platform["arch"]), + ], + }, + { + "name": "upload", + "commands": [ + 'scripts/upload_build.sh -d "$(realpath ..)/bin" "livepeer-mistserver-%s-%s.tar.gz"' + % (platform["os"], platform["arch"]), + ], + "environment": get_environment( + "GCLOUD_KEY", + "GCLOUD_SECRET", + "GCLOUD_BUCKET", + ), + }, + ]) + return { "kind": "pipeline", "name": "build-%s-%s" % (platform["os"], platform["arch"]), @@ -191,39 +240,7 @@ def binaries_pipeline(context, platform): }, "workspace": {"path": "drone/mistserver"}, "clone": {"depth": 0}, - "steps": [ - { - "name": "binaries", - "commands": [ - 'export CI_PATH="$(realpath ..)"', - "echo {} | tee BUILD_VERSION".format(version), - "meson setup -DLOAD_BALANCE=true -DNORIST=true -DNORIST=true -Dprefix=$CI_PATH --default-library static build", - "cd build/", - "ninja && ninja install", - ], - }, - { - "name": "compress", - "commands": [ - 'export CI_PATH="$(realpath ..)"', - "cd $CI_PATH/bin/", - "tar -czvf livepeer-mistserver-%s-%s.tar.gz ./*" - % (platform["os"], platform["arch"]), - ], - }, - { - "name": "upload", - "commands": [ - 'scripts/upload_build.sh -d "$(realpath ..)/bin" "livepeer-mistserver-%s-%s.tar.gz"' - % (platform["os"], platform["arch"]), - ], - "environment": get_environment( - "GCLOUD_KEY", - "GCLOUD_SECRET", - "GCLOUD_BUCKET", - ), - }, - ], + "steps": steps, }