Skip to content

Commit

Permalink
Add recipe for ada-url
Browse files Browse the repository at this point in the history
  • Loading branch information
rHermes committed Nov 18, 2024
1 parent 95ac4eb commit 8d63ed2
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
25 changes: 25 additions & 0 deletions recipes/ada-url/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is for testing
cmake_minimum_required(VERSION 3.15)

project(test_ada_install VERSION 0.1.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(ada REQUIRED)

# You can provide your own code, this is just an example:
file(WRITE main.cpp "
#include \"ada.h\"
#include <iostream>
int main(int , char *[]) {
ada::result<ada::url_aggregator> url = ada::parse<ada::url_aggregator>(\"https://www.google.com\");
url->set_protocol(\"http\");
std::cout << url->get_protocol() << std::endl;
std::cout << url->get_host() << std::endl;
return EXIT_SUCCESS;
}")

add_executable(main main.cpp)
target_link_libraries(main PUBLIC ada::ada)
80 changes: 80 additions & 0 deletions recipes/ada-url/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
context:
version: "2.9.2"

package:
name: ada-url
version: ${{ version }}

source:
url: "https://github.com/ada-url/ada/archive/refs/tags/v${{ version }}.tar.gz"
sha256: f41575ad7eec833afd9f6a0d6101ee7dc2f947fdf19ae8f1b54a71d59f4ba5ec

build:
number: 0
script:
- if: win
then: |
cmake -G Ninja ^
%CMAKE_ARGS% ^
-DADA_TESTING=OFF ^
-DADA_TOOLS=OFF ^
-DADA_BENCHMARKS=OFF ^
-B build -S %SRC_DIR%
cmake --build build --target install
else: |
cmake -G Ninja \
$CMAKE_ARGS \
-DADA_TESTING=OFF \
-DADA_TOOLS=OFF \
-DADA_BENCHMARKS=OFF \
-S $SRC_DIR -B build
cmake --build build --target install
requirements:
build:
- "${{ compiler('cxx') }}"
- "${{ stdlib('c') }}"
- cmake
- ninja

tests:
- script:
- if: win
then: |
cmake -GNinja %CMAKE_ARGS% -B build -S .
cmake --build build
\\build\main.exe
else: |
cmake -GNinja $CMAKE_ARGS -B build -S .
cmake --build build
./build/main
requirements:
build:
- "${{ compiler('cxx') }}"
- "${{ stdlib('c') }}"
- cmake
- ninja
files:
recipe:
- CMakeLists.txt

- package_contents:
include:
- ada.h

about:
homepage: "https://ada-url.com/"
summary: 'WHATWG-compliant and fast URL parser written in modern C++'
description: |
WHATWG-compliant and fast URL parser written in modern C++, part of
Node.js, Clickhouse, Redpanda, Kong, Telegram and Cloudflare Workers.
license: "MIT OR Apache-2.0"
license_file:
- LICENSE-APACHE
- LICENSE-MIT
documentation: https://ada-url.com/introduction/
repository: https://github.com/ada-url/ada

extra:
recipe-maintainers:
- rHermes

0 comments on commit 8d63ed2

Please sign in to comment.