Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![CI](https://github.com/Amsozzer1/PlusWeb/actions/workflows/ci.yml/badge.svg)](https://github.com/Amsozzer1/PlusWeb/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![C++17](https://img.shields.io/badge/C%2B%2B-17-blue.svg)](https://en.cppreference.com/w/cpp/17)
[![vcpkg](https://img.shields.io/vcpkg/v/amsozzer1-plusweb?label=vcpkg)](https://github.com/microsoft/vcpkg/tree/master/ports/amsozzer1-plusweb)

An Express-style HTTP framework for C++, built on a libuv event loop, the llhttp
parser, and a routing trie.
Expand Down Expand Up @@ -125,18 +126,25 @@ find_package(PlusWeb CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE PlusWeb::PlusWeb)
```

Install it from source with `cmake --install build`, or from a package manager. PlusWeb is
not in the vcpkg or Conan registries yet, so both come from this repo for now:
It is in the [vcpkg registry](https://github.com/microsoft/vcpkg/tree/master/ports/amsozzer1-plusweb),
so on most projects that is the whole install:

```bash
# vcpkg, as an overlay port
vcpkg install plusweb --overlay-ports=PlusWeb/packaging/vcpkg
vcpkg install amsozzer1-plusweb
```

The port is `amsozzer1-plusweb` rather than `plusweb` because vcpkg falls back to
`Owner-Project` when a name is already taken upstream.

# Conan, from the recipe in the repo
conan create PlusWeb/packaging/conan --build=missing
Conan is not upstream yet, so that recipe still comes from this repo, and installing from
source works too:

```bash
cmake --install build # from source
conan create PlusWeb/packaging/conan --build=missing # Conan, from the recipe here
```

[`packaging/`](packaging/) has the details, including what changes when these go upstream.
[`packaging/`](packaging/) has the details, including what is left for Conan.
Windows is not supported yet: nothing in the library is POSIX-bound, but it has never been
built there.

Expand Down
33 changes: 20 additions & 13 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Packaging

PlusWeb is not in the vcpkg or Conan registries yet. These files let you install it from
here today, and they are the same files that go upstream when it is.
PlusWeb is in the vcpkg registry as
[`amsozzer1-plusweb`](https://github.com/microsoft/vcpkg/tree/master/ports/amsozzer1-plusweb),
so nothing here is needed to install it:

## vcpkg, as an overlay port
```bash
vcpkg install amsozzer1-plusweb
```

The files in `vcpkg/amsozzer1-plusweb/` are byte-identical to the ones upstream. They stay
here so a port change can be tested as an overlay before it is submitted:

```bash
git clone https://github.com/Amsozzer1/PlusWeb.git

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: When the command is run from the repository root, PlusWeb/packaging/vcpkg resolves to a nonexistent nested path rather than this checkout's packaging/vcpkg directory, so the documented overlay test does not use the local port files.

Triggers: When a user follows packaging/README.md from the cloned repository's root.

Suggested fix: Use --overlay-ports=packaging/vcpkg, or explicitly instruct users to run the command from the directory containing the PlusWeb checkout.

vcpkg install plusweb --overlay-ports=PlusWeb/packaging/vcpkg
vcpkg install amsozzer1-plusweb --overlay-ports=PlusWeb/packaging/vcpkg
```

Then, as usual:
Expand All @@ -20,8 +25,13 @@ target_link_libraries(my_app PRIVATE PlusWeb::PlusWeb)
`portfile.cmake` pins the release tarball by SHA512. If you point `REF` at a different tag,
`vcpkg install` will print the hash it actually got, and you paste that in.

The port is `amsozzer1-plusweb` rather than `plusweb` because vcpkg falls back to
`Owner-Project` when a name is already taken upstream.

## Conan, from a local recipe

Conan is not upstream, so this one really does come from here:

```bash
git clone https://github.com/Amsozzer1/PlusWeb.git
conan create PlusWeb/packaging/conan --build=missing
Expand All @@ -32,7 +42,7 @@ def requirements(self):
self.requires("plusweb/0.1.2")
```

This recipe builds from the checkout it lives in. The conan-center-index version fetches a
This recipe builds from the checkout it lives in. A conan-center-index version would fetch a
release tarball through `conandata.yml` instead; that is the only difference.

## Not Windows yet
Expand All @@ -42,11 +52,8 @@ POSIX-bound — every socket goes through libuv — but it has never been built
there, and saying so is better than shipping a port that fails in somebody's CI. Lifting it
is a matter of building it on Windows once and finding out.

## Going upstream
## Still to do

- vcpkg: copy `vcpkg/plusweb/` into `ports/plusweb/` in a fork of
[microsoft/vcpkg](https://github.com/microsoft/vcpkg), run
`vcpkg x-add-version plusweb`, and open the PR.
- Conan: restructure `conan/conanfile.py` around `conandata.yml` and open a PR against
[conan-io/conan-center-index](https://github.com/conan-io/conan-center-index) under
`recipes/plusweb/`.
Conan: restructure `conan/conanfile.py` around `conandata.yml` and open a PR against
[conan-io/conan-center-index](https://github.com/conan-io/conan-center-index) under
`recipes/plusweb/`.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "plusweb",
"name": "amsozzer1-plusweb",
"version": "0.1.2",
"description": "Express-style HTTP framework for C++17 built on libuv and llhttp, with a segment-trie router and a middleware chain",
"homepage": "https://github.com/Amsozzer1/PlusWeb",
Expand Down
Loading