diff --git a/nix/blob.nix b/nix/blob.nix deleted file mode 100644 index a2f01c8d5..000000000 --- a/nix/blob.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ stdenv -, lib -, rustPlatform -, fetchFromGitHub -, protobuf_3_15_cmake -, darwin -}: - -rustPlatform.buildRustPackage rec { - pname = "blob"; - version = "0.0.1"; - - src = ../services/blob; - - cargoLock.lockFile = ../services/blob/Cargo.lock; - - prePatch = '' - mkdir ../../shared - cp -r ${../shared/protos} ../../shared/protos - ''; - - nativeBuildInputs = [ - protobuf_3_15_cmake - ]; - - buildInputs = lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration - darwin.libiconv - ]; - - meta = with lib; { - license = licenses.bsd3; - }; -} diff --git a/nix/overlay.nix b/nix/overlay.nix index d41909e35..960402cd7 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,44 +1,42 @@ # An overlay allows for a package set to be extended with new or modified packages # `final` refers to the package set with all overlays applied. # This allows for added or modified packages to be referenced with # all relevant changes final: # `prev` refers to the previous package set before this current overlay is applied. # This is cheaper for nix to evaluate, thus should be prefered over final when possible. prev: { # add packages meant for just this repository amqp-cpp = prev.callPackage ./amqp-cpp.nix { }; arcanist = final.callPackage ./arcanist.nix { }; better-prompt = prev.callPackage ./better-prompt.nix { }; # c-ares is used to bootstrap curl, so cmake is not available in the default # build c-ares_cmake-config = prev.c-ares.overrideAttrs(o: { nativeBuildInputs = (o.nativeBuildInputs or []) ++ [ prev.cmake ]; }); - comm-blob = final.callPackage ./blob.nix { }; - devShells.default = final.callPackage ./dev-shell.nix { }; devShell = final.devShells.default; localstack-down = prev.callPackage ./localstack-down.nix { }; localstack-up = prev.callPackage ./localstack-up.nix { }; mariadb-up = final.callPackage ./mariadb-up-mac.nix { }; mysql-down = prev.callPackage ./mysql-down-linux.nix { }; mysql-up = prev.callPackage ./mysql-up-linux.nix { }; redis-up = prev.callPackage ./redis-up-mac.nix { }; rabbitmq-up = prev.callPackage ./rabbitmq-up-mac.nix { }; } diff --git a/nix/protobuf_3_15.nix b/nix/protobuf_3_15.nix deleted file mode 100644 index 85dbc178d..000000000 --- a/nix/protobuf_3_15.nix +++ /dev/null @@ -1,77 +0,0 @@ -# The cmake version of this build is meant to enable both cmake and .pc being exported -# this is important because grpc exports a .cmake file which also expects for protobuf -# to have been exported through cmake as well. -{ lib, stdenv -, buildPackages -, cmake -, fetchFromGitHub -, fetchpatch -, gtest -, zlib -}: - -stdenv.mkDerivation rec { - pname = "protobuf"; - version = "3.15.8"; - - src = fetchFromGitHub { - owner = "protocolbuffers"; - repo = "protobuf"; - rev = "v${version}"; - sha256 = "sha256-G+fU6YWfpkRDJ9Xf+/zLmd52/1vTtPoZdugZDLtCc+A="; - }; - - # re-create git submodules - postPatch = '' - rm -rf gmock - cp -r ${gtest.src}/googlemock third_party/gmock - cp -r ${gtest.src}/googletest third_party/ - - chmod -R a+w third_party/ - ln -s ../googletest third_party/gmock/gtest - ln -s ../gmock third_party/googletest/googlemock - ln -s $(pwd)/third_party/googletest third_party/googletest/googletest - '' + lib.optionalString stdenv.isDarwin '' - substituteInPlace src/google/protobuf/testing/googletest.cc \ - --replace 'tmpnam(b)' '"'$TMPDIR'/foo"' - ''; - - patches = [ - # This is an adjusted patch for https://github.com/protocolbuffers/protobuf/pull/9822 - ./cmake-install-path.patch - ]; - - # There's a top-level BUILD file which doesn't allow for APFS to create a directory named "build" - dontUseCmakeBuildDir = true; - # Point cmake setup hook to cmake/CMakeLists.txt - cmakeDir = "cmake"; - - nativeBuildInputs = [ - cmake - ]; - - buildInputs = [ - zlib - ]; - - cmakeFlags = lib.optionals (!stdenv.targetPlatform.isStatic) [ - "-Dprotobuf_BUILD_SHARED_LIBS=ON" - ]; - - enableParallelBuilding = true; - - # unfortunately the shared libraries have yet to been patched by nix, thus tests will fail - doCheck = false; - - meta = { - description = "Google's data interchange format"; - longDescription = '' - Protocol Buffers are a way of encoding structured data in an efficient - yet extensible format. Google uses Protocol Buffers for almost all of - its internal RPC protocols and file formats. - ''; - license = lib.licenses.bsd3; - platforms = lib.platforms.unix; - homepage = "https://developers.google.com/protocol-buffers/"; - }; -} diff --git a/scripts/install_protobuf.sh b/scripts/install_protobuf.sh index 041cdba0a..0bd02ac2c 100755 --- a/scripts/install_protobuf.sh +++ b/scripts/install_protobuf.sh @@ -1,26 +1,26 @@ #!/usr/bin/env bash set -euo pipefail git clone \ --recurse-submodules \ --single-branch \ - -b v3.15.8 \ + -b v21.12 \ https://github.com/protocolbuffers/protobuf pushd protobuf || exit mkdir cmake-build pushd cmake-build || exit cmake ../cmake \ -Dprotobuf_BUILD_SHARED_LIBS=ON \ -Dprotobuf_ABSL_PROVIDER=package \ -Dprotobuf_BUILD_TESTS=OFF make install -j "$(nproc || sysctl -n hw.physicalcpu)" popd || exit # cmake-build popd || exit # protobuf rm -rf protobuf