Skip to content
Closed
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
34 changes: 31 additions & 3 deletions docs/maintainers/vcpkg_build_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,36 @@ Build a linux makefile project.

## Usage:
```cmake
vcpkg_build_make([TARGET <target>])
vcpkg_build_make(
[MAKE_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[MAKE_INSTALL_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_INSTALL_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_INSTALL_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[TARGET <target>]
)
```

## Parameters:
### MAKE_OPTIONS
Additional options passed to make during the generation.

### MAKE_OPTIONS_RELEASE
Additional options passed to make during the Release generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_OPTIONS_DEBUG
Additional options passed to make during the Debug generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_INSTALL_OPTIONS
Additional options passed to make during the installation.

### MAKE_INSTALL_OPTIONS_RELEASE
Additional options passed to make during the Release installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

### MAKE_INSTALL_OPTIONS_DEBUG
Additional options passed to make during the Debug installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

### TARGET
The target passed to the configure/make build command (`./configure/make/make install`). If not specified, no target will
be passed.
Expand All @@ -16,15 +43,16 @@ Adds the appropriate Release and Debug `bin\` directories to the path during the

## Notes:
This command should be preceeded by a call to [`vcpkg_configure_make()`](vcpkg_configure_make.md).
You can use the alias [`vcpkg_install_make()`](vcpkg_configure_make.md) function if your CMake script supports the
You can use the alias [`vcpkg_install_make()`](vcpkg_install_make.md) function if your CMake script supports the
"install" target

## Examples

* [luajit](https://github.com/Microsoft/vcpkg/blob/master/ports/luajit/portfile.cmake)
* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)

## Source
[scripts/cmake/vcpkg_build_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_make.cmake)
[scripts/cmake/vcpkg_build_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_make.cmake)
9 changes: 5 additions & 4 deletions docs/maintainers/vcpkg_configure_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ vcpkg_configure_make(
[SKIP_CONFIGURE]
[PROJECT_SUBPATH <${PROJ_SUBPATH}>]
[PRERUN_SHELL <${SHELL_PATH}>]
[OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[OPTIONS <--use-this-in-all-builds>...]
[OPTIONS_RELEASE <--optimize>...]
[OPTIONS_DEBUG <--debuggable>...]
)
```

Expand Down Expand Up @@ -69,10 +69,11 @@ This command supplies many common arguments to configure. To see the full list,

## Examples

* [luajit](https://github.com/Microsoft/vcpkg/blob/master/ports/luajit/portfile.cmake)
* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)

## Source
[scripts/cmake/vcpkg_configure_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake)
[scripts/cmake/vcpkg_configure_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake)
30 changes: 27 additions & 3 deletions docs/maintainers/vcpkg_install_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,45 @@ Build and install a make project.

## Usage:
```cmake
vcpkg_install_make(...)
vcpkg_install_make(
[MAKE_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[MAKE_INSTALL_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_INSTALL_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_INSTALL_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
)
```

## Parameters:
See [`vcpkg_build_make()`](vcpkg_build_make.md).
### MAKE_OPTIONS
Additional options passed to make during the generation.

### MAKE_OPTIONS_RELEASE
Additional options passed to make during the Release generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_OPTIONS_DEBUG
Additional options passed to make during the Debug generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_INSTALL_OPTIONS
Additional options passed to make during the installation.

### MAKE_INSTALL_OPTIONS_RELEASE
Additional options passed to make during the Release installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

### MAKE_INSTALL_OPTIONS_DEBUG
Additional options passed to make during the Debug installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

## Notes:
This command transparently forwards to [`vcpkg_build_make()`](vcpkg_build_make.md), adding `ENABLE_INSTALL`

## Examples

* [luajit](https://github.com/Microsoft/vcpkg/blob/master/ports/luajit/portfile.cmake)
* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)

## Source
[scripts/cmake/vcpkg_install_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_make.cmake)
[scripts/cmake/vcpkg_install_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_make.cmake)
13 changes: 1 addition & 12 deletions ports/freexl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(FREEXL_VERSION_STR "1.0.4")

vcpkg_download_distfile(ARCHIVE
Expand Down Expand Up @@ -66,17 +65,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
)

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
"LINK_FLAGS=/debug"
"CL_FLAGS=${CL_FLAGS_DBG}"
"LIBS_ALL=${LIBS_ALL_DBG}"
OPTIONS_RELEASE
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
"LINK_FLAGS="
"CL_FLAGS=${CL_FLAGS_REL}"
"LIBS_ALL=${LIBS_ALL_REL}"
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_install_make()
Expand Down
4 changes: 4 additions & 0 deletions ports/libdeflate/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Source: libdeflate
Version: 1.5
Homepage: https://github.com/ebiggers/libdeflate
Description: Heavily optimized library for DEFLATE/zlib/gzip compression and decompression
31 changes: 31 additions & 0 deletions ports/libdeflate/makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/Makefile.msc b/Makefile.msc
index 901131d..00f0568 100644
--- a/Makefile.msc
+++ b/Makefile.msc
@@ -10,7 +10,7 @@
CC = cl
LD = link
AR = lib
-CFLAGS = /MD /O2 -I. -Icommon
+CFLAGS = $(CL_FLAGS) -I. -Icommon
LDFLAGS =

STATIC_LIB = libdeflatestatic.lib
@@ -60,6 +60,14 @@ gunzip.exe:gzip.exe
copy $** $@

clean:
- -del *.dll *.exe *.exp libdeflate.lib libdeflatestatic.lib gzip.lib \
- lib\*.obj lib\*\*.obj lib\*.dllobj lib\*\*.dllobj \
- programs\*.obj 2>nul
+ -del /s /q *.dll *.exe *.exp libdeflate.lib libdeflatestatic.lib gzip.lib \
+ lib\*.obj lib\*.dllobj \
+ programs\*.obj
+
+install: all
+ -xcopy /i /y "gzip.exe" "$(INSTALLDIR)/bin\"
+ -xcopy /i /y "gunzip.exe" "$(INSTALLDIR)/bin\"
+ -xcopy /i /y "$(SHARED_LIB)" "$(INSTALLDIR)/bin\"
+ -xcopy /i /y "$(STATIC_LIB)" "$(INSTALLDIR)/lib\"
+ -xcopy /i /y "$(IMPORT_LIB)" "$(INSTALLDIR)/lib\"
+ -xcopy /i /y "libdeflate.h" "$(INSTALLDIR)/include\"
74 changes: 74 additions & 0 deletions ports/libdeflate/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
vcpkg_fail_port_install(ON_TARGET "Linux" "UWP")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ebiggers/libdeflate
REF v1.5
SHA512 8e86e87733bb1b2b2d4dda6ce0be96b57a125776c1f81804d5fc6f51516dd52796d9bb800ca4044c637963136ae390cfaf5cd804e9ae8b5d93d36853d0e807f6
HEAD_REF master
PATCHES
makefile.patch
)

if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_install_nmake(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_NAME Makefile.msc
)

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(COPY ${CURRENT_PACKAGES_DIR}/debug/bin/gzip.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})
file(COPY ${CURRENT_PACKAGES_DIR}/debug/bin/gunzip.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})

file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/gzip.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/gunzip.exe)

if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libdeflatestatic.lib)
elseif (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libdeflate.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libdeflatestatic.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libdeflate.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/libdeflate.dll)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(COPY ${CURRENT_PACKAGES_DIR}/bin/gzip.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(COPY ${CURRENT_PACKAGES_DIR}/bin/gunzip.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})

file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/gzip.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/gunzip.exe)

if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libdeflatestatic.lib)
elseif (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libdeflate.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libdeflatestatic.lib ${CURRENT_PACKAGES_DIR}/lib/libdeflate.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/libdeflate.dll)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()
endif()
else()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
SKIP_CONFIGURE
)

vcpkg_install_make(
MAKE_INSTALL_OPTIONS_DEBUG
"PREFIX=${CURRENT_PACKAGES_DIR}/debug"
"BINDIR=${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}"
MAKE_INSTALL_OPTIONS_RELEASE
"PREFIX=${CURRENT_PACKAGES_DIR}"
"BINDIR=${CURRENT_PACKAGES_DIR}/tools/${PORT}"
)

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
endif()
endif()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
Loading