vdf-classgroup 0.2.0

Class groups in Rust using GMP for arithmetic (maintained fork for vdf-rs)
Documentation
// Copyright 2018 POA Networks Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

fn main() {
    // Try to find GMP using pkg-config first
    if pkg_config::Config::new()
        .atleast_version("6.0")
        .probe("gmp")
        .is_ok()
    {
        return;
    }

    // On macOS, try common Homebrew paths
    if cfg!(target_os = "macos") {
        let homebrew_paths = ["/opt/homebrew/lib", "/usr/local/lib"];

        for path in &homebrew_paths {
            if std::path::Path::new(path).exists() {
                println!("cargo:rustc-link-search=native={path}");
            }
        }

        // Link against GMP
        println!("cargo:rustc-link-lib=gmp");
    }
}