aboutsummaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorRoelf-Jilling <r-j.wolthuis@live.com>2018-11-20 19:45:21 +0100
committerRoelf-Jilling <r-j.wolthuis@live.com>2018-11-20 19:45:21 +0100
commit370984d139c0799446e45706b45c8cb8eb77db44 (patch)
tree571d28239f4015588db65f91eb5c77531eb9d4d3 /docs/examples
parent381e4c94af038bd0ff364ddec918ea077c405ecf (diff)
parent2a283bd5224b5335a90539faa1b0ac7260411465 (diff)
downloadvcpkg-370984d139c0799446e45706b45c8cb8eb77db44.tar.gz
vcpkg-370984d139c0799446e45706b45c8cb8eb77db44.zip
Merge branch 'master' into documentation
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/installing-and-using-packages.md (renamed from docs/examples/using-sqlite.md)6
-rw-r--r--docs/examples/packaging-github-repos.md59
-rw-r--r--docs/examples/packaging-zipfiles.md (renamed from docs/examples/packaging-zlib.md)2
-rw-r--r--docs/examples/patching.md (renamed from docs/examples/patching-libpng.md)2
4 files changed, 64 insertions, 5 deletions
diff --git a/docs/examples/using-sqlite.md b/docs/examples/installing-and-using-packages.md
index eb03d57d2..73f9d29a9 100644
--- a/docs/examples/using-sqlite.md
+++ b/docs/examples/installing-and-using-packages.md
@@ -1,4 +1,4 @@
-# Example: Using Sqlite
+## Installing and Using Packages Example: SQLite
- [Step 1: Install](#install)
- [Step 2: Use](#use)
@@ -10,7 +10,7 @@
<a name="install"></a>
## Step 1: Install
-First, we need to know what name [Sqlite](https://sqlite.org) goes by in the ports tree. To do that, we'll run the `search` command and inspect the output:
+First, we need to know what name [SQLite](https://sqlite.org) goes by in the ports tree. To do that, we'll run the `search` command and inspect the output:
```no-highlight
PS D:\src\vcpkg> .\vcpkg search sqlite
libodb-sqlite 2.4.0 Sqlite support for the ODB ORM library
@@ -82,7 +82,7 @@ Installing new libraries will make them instantly available.
```
*Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.*
-You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio 2017 and the library will be automatically available. For Sqlite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html).
+You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio 2017 and the library will be automatically available. For SQLite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html).
To remove the integration for your user, you can use `.\vcpkg integrate remove`.
diff --git a/docs/examples/packaging-github-repos.md b/docs/examples/packaging-github-repos.md
new file mode 100644
index 000000000..af2e6141a
--- /dev/null
+++ b/docs/examples/packaging-github-repos.md
@@ -0,0 +1,59 @@
+## Packaging Github Repos Example: libogg
+### Create the CONTROL file
+The `CONTROL` file is a simple set of fields describing the package's metadata.
+
+*For libogg, we'll create the file `ports\libogg\CONTROL` with the following contents:*
+```no-highlight
+Source: libogg
+Version: 1.3.3
+Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs.
+```
+
+### Create the portfile
+`portfile.cmake` describes how to build and install the package. First we include `vcpkg_common_functions` to give us utilities for carrying this out:
+
+```no-highlight
+include(vcpkg_common_functions)
+```
+
+Now we download the project from Github with [`vcpkg_from_github`](../maintainers/vcpkg_from_github.md):
+
+```no-highlight
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xiph/ogg
+ REF v1.3.3
+ SHA512 0bd6095d647530d4cb1f509eb5e99965a25cc3dd9b8125b93abd6b248255c890cf20710154bdec40568478eb5c4cde724abfb2eff1f3a04e63acef0fbbc9799b
+ HEAD_REF master
+)
+```
+
+The important parts to update are `REPO` for the GitHub repository path, `REF` for a stable tag/commit to use, and `SHA512` with the checksum of the downloaded zipfile (you can get this easily by setting it to `1`, trying to install the package, and copying the checksum).
+
+Finally, we configure the project with CMake, install the package, and copy over the license file:
+
+```no-highlight
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+vcpkg_install_cmake()
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libogg RENAME copyright)
+```
+
+Check the documentation for [`vcpkg_configure_cmake`](../maintainers/vcpkg_configure_cmake.md) and [`vcpkg_install_cmake`](../maintainers/vcpkg_install_cmake.md) if your package needs additional options.
+
+Now you can run `vcpkg install libogg` to build and install the package.
+
+### Suggested example portfiles
+In the `ports\` directory are many libraries that can be used as examples, including many that are not based on CMake.
+
+- Header only libraries
+ - rapidjson
+ - range-v3
+- MSBuild-based
+ - cppunit
+ - mpg123
+- Non-CMake, custom buildsystem
+ - openssl
+ - ffmpeg
diff --git a/docs/examples/packaging-zlib.md b/docs/examples/packaging-zipfiles.md
index 1d61cfee1..ed63637fd 100644
--- a/docs/examples/packaging-zlib.md
+++ b/docs/examples/packaging-zipfiles.md
@@ -1,4 +1,4 @@
-## Example 2: Packaging zlib
+## Packaging Zipfiles Example: zlib
### Bootstrap with `create`
First, locate a globally accessible archive of the library's sources. Zip, gzip, and bzip are all supported. Strongly prefer official sources or mirrors over unofficial mirrors.
diff --git a/docs/examples/patching-libpng.md b/docs/examples/patching.md
index 2337b73da..98115400e 100644
--- a/docs/examples/patching-libpng.md
+++ b/docs/examples/patching.md
@@ -1,4 +1,4 @@
-## Example 3: Patching libpng to work for x86-uwp
+## Patching Example: Patching libpng to work for x86-uwp
### Initial error logs
First, try building: