Skip to content

Commit

Permalink
feature: exposing headers for libmirsever-internal-dev (#3288)
Browse files Browse the repository at this point in the history
## What's new?
Exposing a new package called `libmirserver-internal-dev`

## How to use
```CMake
pkg_check_modules(MIRSERVER_INTERNAL mirserver-internal REQUIRED)
...
target_include_directories(${BINARY_NAME} PUBLIC SYSTEM ... ${MIRSERVER_INTERNAL_INCLUDE_DIRS})
```
  • Loading branch information
mattkae authored Apr 25, 2024
2 parents c87413d + 1652ceb commit 50e3924
Show file tree
Hide file tree
Showing 12 changed files with 757 additions and 288 deletions.
1 change: 1 addition & 0 deletions .github/workflows/symbols-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ jobs:
RET=0
cmake --build build --target check-miral-symbols-map || RET=$?
cmake --build build --target check-miroil-symbols-map || RET=$?
cmake --build build --target check-mirserver-symbols-map || RET=$?
exit $RET
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

set(MIR_VERSION_MAJOR 2)
set(MIR_VERSION_MINOR 16)
set(MIR_VERSION_PATCH 4)
set(MIR_VERSION_MINOR 17)
set(MIR_VERSION_PATCH 0)

add_compile_definitions(MIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
add_compile_definitions(MIR_VERSION_MINOR=${MIR_VERSION_MINOR})
Expand Down
24 changes: 22 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Vcs-Git: https://github.com/MirServer/mir

#TODO: Packaging infrastructure for better dependency generation,
# ala pkg-xorg's xviddriver:Provides and ABI detection.
Package: libmirserver60
Package: libmirserver61
Section: libs
Architecture: linux-any
Multi-Arch: same
Expand Down Expand Up @@ -142,7 +142,7 @@ Section: libdevel
Architecture: linux-any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: libmirserver60 (= ${binary:Version}),
Depends: libmirserver61 (= ${binary:Version}),
libmirplatform-dev (= ${binary:Version}),
libmircommon-dev (= ${binary:Version}),
libglm-dev,
Expand All @@ -154,6 +154,26 @@ Description: Display server for Ubuntu - development headers
.
Contains header files required to build Mir servers.

Package: libmirserver-internal-dev
Section: libdevel
Architecture: linux-any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: libmirserver61 (= ${binary:Version}),
libmirplatform-dev (= ${binary:Version}),
libmircommon-dev (= ${binary:Version}),
libmircore-dev (= ${binary:Version}),
libmirserver-dev (= ${binary:Version}),
libglm-dev,
uuid-dev,
${misc:Depends},
Description: Display server for Ubuntu - internal development headers
Mir is a display server running on linux systems, with a focus on efficiency,
robust operation and a well-defined driver model.
.
This package contains internal headers with no stability guarantee, for servers
that wish to use functionality for which no public API exists yet.

Package: mirtest-dev
Section: libdevel
Architecture: linux-any
Expand Down
2 changes: 2 additions & 0 deletions debian/libmirserver-internal-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/include/mirserver-internal
usr/lib/*/pkgconfig/mirserver-internal.pc
1 change: 0 additions & 1 deletion debian/libmirserver60.install

This file was deleted.

1 change: 1 addition & 0 deletions debian/libmirserver61.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libmirserver.so.61
36 changes: 0 additions & 36 deletions src/include/server/mir/input/legacy_input_dispatchable.h

This file was deleted.

Empty file.
41 changes: 40 additions & 1 deletion src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ configure_file(
@ONLY
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mirserver-internal.pc.in
${CMAKE_CURRENT_BINARY_DIR}/mirserver-internal.pc
@ONLY
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${PROJECT_SOURCE_DIR}/include/server/mir/version.h
Expand Down Expand Up @@ -154,8 +160,11 @@ install(DIRECTORY
install(DIRECTORY
${CMAKE_SOURCE_DIR}/include/server/mir DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/mirserver"
)
install(DIRECTORY
${CMAKE_SOURCE_DIR}/src/include/server/mir DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/mirserver-internal"
)

set(MIRSERVER_ABI 60) # Be sure to increment MIR_VERSION_MINOR at the same time
set(MIRSERVER_ABI 61) # Be sure to increment MIR_VERSION_MINOR at the same time
set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)

set_target_properties(
Expand All @@ -170,3 +179,33 @@ set_target_properties(
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mirserver.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mirserver-internal.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

add_custom_target(
generate-mirserver-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name mir_server
--version ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--internal-headers-directory="${PROJECT_SOURCE_DIR}/src/include/server"
--include-dirs="$<JOIN:$<TARGET_PROPERTY:mirserver,INCLUDE_DIRECTORIES>,:>"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

add_custom_target(
check-mirserver-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name mir_server
--version ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--internal-headers-directory="${PROJECT_SOURCE_DIR}/src/include/server"
--include-dirs "$<JOIN:$<TARGET_PROPERTY:mirserver,INCLUDE_DIRECTORIES>,:>"
--diff
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

add_custom_target(regenerate-mirserver-internal-debian-symbols
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/run.sh --library mir_server_internal --version ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR} --output_symbols
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
VERBATIM)
8 changes: 8 additions & 0 deletions src/server/mirserver-internal.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=@PKGCONFIG_INCLUDEDIR@/mirserver-internal

Name: mirserver-internal
Description: Mir server internal headers
Version: @MIR_VERSION@
Requires: mirserver mircommon mirplatform mircore
Cflags: -I${includedir}
Loading

0 comments on commit 50e3924

Please sign in to comment.