Skip to content

Commit

Permalink
Merge pull request #9987 from hudokkow/cpack_debian
Browse files Browse the repository at this point in the history
[cmake/cpack] Debian packages generation
  • Loading branch information
hudokkow committed Jul 20, 2016
2 parents 29db2f8 + 2d156a7 commit cb5829c
Show file tree
Hide file tree
Showing 35 changed files with 4,361 additions and 127 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -227,7 +227,6 @@ lib/cpluff/stamp-h1

# /project/cmake
/project/cmake/KodiConfig.cmake
/project/cmake/XBMCConfig.cmake
/project/cmake/addons/*.error
/project/cmake/addons/.failure
/project/cmake/addons/.success
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Expand Up @@ -2216,7 +2216,6 @@ OUTPUT_FILES="Makefile \
xbmc/platform/darwin/osx/Info.plist \
xbmc/platform/darwin/ios/Info.plist \
project/cmake/KodiConfig.cmake \
project/cmake/XBMCConfig.cmake \
tools/android/packaging/xbmc/AndroidManifest.xml \
tools/android/packaging/Makefile \
tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java \
Expand Down
24 changes: 12 additions & 12 deletions project/cmake/CMakeLists.txt
Expand Up @@ -53,6 +53,7 @@ if(NOT WIN32)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
option(ENABLE_LIRC "Enable LIRC support?" ON)
option(ENABLE_EVENTCLIENTS "Enable event clients support?" OFF)
endif()

get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE)
Expand Down Expand Up @@ -251,16 +252,6 @@ mark_as_advanced(core_DEPENDS)
mark_as_advanced(test_archives)
mark_as_advanced(test_sources)

file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/addon-bindings.txt bindings)
foreach(binding ${bindings})
list(APPEND addon_bindings ${CORE_SOURCE_DIR}/${binding})
endforeach()

file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/cmake-files.txt cmakefiles)
foreach(cmakefile ${cmakefiles})
list(APPEND cmake_files ${CORE_SOURCE_DIR}/${cmakefile})
endforeach()

add_subdirectory(${CORE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL)

# Subdirs
Expand Down Expand Up @@ -386,6 +377,13 @@ if(CORE_SYSTEM_NAME STREQUAL osx)
add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper)
endif()

# WiiRemote
if(ENABLE_EVENTCLIENTS)
if(CORE_SYSTEM_NAME STREQUAL linux)
add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote)
endif()
endif()

include(scripts/${CORE_SYSTEM_NAME}/Install.cmake)

# Prepare add-on build env
Expand Down Expand Up @@ -428,6 +426,8 @@ if(VERBOSE)
message(STATUS "datarootdir: ${datarootdir}")
message(STATUS "#---------------------------------------------#")
message(STATUS "GIT_REV: ${APP_SCMID}")
message(STATUS "#---------------------------------------------#")
message(STATUS "CPACK_GENERATOR : ${CPACK_GENERATOR}")
message(STATUS "CPACK_SOURCE_GENERATOR: ${CPACK_SOURCE_GENERATOR}")
message(STATUS "#---------------------------------------------#")
endif()
message(STATUS "#---------------------------------------------#")

16 changes: 16 additions & 0 deletions project/cmake/README.md
Expand Up @@ -89,6 +89,22 @@ cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)

`CMAKE_BUILD_TYPE` defaults to `Release`.

#### Debian package generation
The buildsystem is capable of generating Debian packages using CPack. To generate them, `CPACK_GENERATOR` has to be set to *DEB*, i.e. executing CMake's configure step with `-DCPACK_GENERATOR=DEB`.
You should use CMake/CPack 3.6.0 or higher. Lower versions can generate the packages but package names will be mangled.

The following optional variables (which can be passed to buildsystem when executing cmake with the -D`<variable-name>=<value>` format) can be used to manipulate package type, name and version:

- `DEBIAN_PACKAGE_TYPE` controls the name and version of generated packages. Accepted values are `stable`, `unstable` and `nightly` (default is `nightly`).
- `DEBIAN_PACKAGE_EPOCH` controls package epoch (default is `2`)
- `DEBIAN_PACKAGE_VERSION` controls package version (default is `0`)
- `DEBIAN_PACKAGE_REVISION` controls package revision (no default is set)

Packages metadata can be changed simply by editing files present in the `cpack/deb` folder
A lot more variables are available (see cpack/CPackDebian.cmake file) but you shouldn't mess with them unless you know what you're doing.

Generated packages can be found in <BUILD_DIR>/packages.

### Raspberry Pi with GNU Makefiles

```
Expand Down
4 changes: 0 additions & 4 deletions project/cmake/XBMCConfig.cmake.in

This file was deleted.

0 comments on commit cb5829c

Please sign in to comment.