Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake packaging #1431

Merged
merged 28 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
587f88a
modify CMakeLists.txt to be able to build packages for MacOS and Linux
midwan Sep 19, 2024
5643026
Moved pull request template to .github dir
midwan Sep 19, 2024
1c6d789
Moved code of conduct file under .github directory
midwan Sep 19, 2024
380bb40
Removed gitmodules file
midwan Sep 19, 2024
2ef2da3
Moved install extra dirs to only if we're not building an Apple bundle
midwan Sep 19, 2024
9d20601
Added first version of a Deb package option to CPack
midwan Sep 19, 2024
a0d7842
Merge branch 'preview' into cmake-packaging
midwan Sep 20, 2024
aa94059
Fixed double directory creation during installation/packaging
midwan Sep 20, 2024
2c36d51
Remove debian directory
midwan Sep 20, 2024
d7bb7d0
Fixed package version
midwan Sep 20, 2024
d3eb994
Clean up contents of packages
midwan Sep 20, 2024
eaea021
Fix dependencies and filename of .deb package
midwan Sep 20, 2024
8673360
Bump version to 6.3.5
midwan Sep 20, 2024
0092b31
Add desktop file for Deb package
midwan Sep 20, 2024
886c409
Remove archive generator, the DEB one is good enough
midwan Sep 20, 2024
a093133
Change pipeline to use CMake for Linux targets
midwan Sep 20, 2024
293b98a
Fix incorrect architecture names in cross-compiler
midwan Sep 20, 2024
3c03eea
Fix 32-bit arm package architecture
midwan Sep 20, 2024
082c1d5
ci: Allow 32-bit arm builds
midwan Sep 20, 2024
a9dadba
ci: disable the bullseye builds for now
midwan Sep 20, 2024
72f766e
ci: fix expected targets
midwan Sep 20, 2024
1a1646a
Merge remote-tracking branch 'origin/preview' into cmake-packaging
midwan Sep 21, 2024
6c0c38a
ci: bring back bullseye builds
midwan Sep 21, 2024
cd13b38
Remove path from desktop shortcut
midwan Sep 22, 2024
8bcff72
Fixed typo in comment
midwan Sep 22, 2024
59d6f2b
Set the version in the Project, use that for CPack
midwan Sep 22, 2024
6f86eb8
Updated compiled and linker flags with no-pie properly
midwan Sep 23, 2024
e4bed1b
Include bullseye build targets again
midwan Sep 23, 2024
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
File renamed without changes.
File renamed without changes.
548 changes: 40 additions & 508 deletions .github/workflows/c-cpp.yml

Large diffs are not rendered by default.

Empty file removed .gitmodules
Empty file.
884 changes: 463 additions & 421 deletions CMakeLists.txt

Large diffs are not rendered by default.

91 changes: 61 additions & 30 deletions cmake/Findmpg123.cmake
Original file line number Diff line number Diff line change
@@ -1,31 +1,58 @@
# - Find mpg123
# Find the native mpg123 includes and libraries
#
# MPG123_INCLUDE_DIRS - where to find mpg123.h, etc.
# MPG123_LIBRARIES - List of libraries when using mpg123.
# MPG123_FOUND - True if Mpg123 found.

if (MPG123_INCLUDE_DIR)
#[=======================================================================[.rst:
Findmpg123
-------

Finds the mpg123 library.

Imported Targets
^^^^^^^^^^^^^^^^

This module provides the following imported targets, if found:

``MPG123::libmpg123``
The mpg123 library

Result Variables
^^^^^^^^^^^^^^^^

This will define the following variables:

``mpg123_FOUND``
True if the system has the mpg123 package.
``mpg123_VERSION``
The version of mpg123 that was found on the system.

Cache Variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``mpg123_INCLUDE_DIR``
The directory containing ``mpg123.h``.
``mpg123_LIBRARY``
The path to the mpg123 library.

#]=======================================================================]

if (mpg123_INCLUDE_DIR)
# Already in cache, be silent
set(MPG123_FIND_QUIETLY TRUE)
set(mpg123_FIND_QUIETLY TRUE)
endif ()

find_package (PkgConfig QUIET)
pkg_check_modules(PC_MPG123 QUIET libmpg123>=1.25.10)

set (MPG123_VERSION ${PC_MPG123_VERSION})

find_path (MPG123_INCLUDE_DIR mpg123.h
find_path (mpg123_INCLUDE_DIR mpg123.h
HINTS
${PC_MPG123_INCLUDEDIR}
${PC_MPG123_INCLUDE_DIRS}
${MPG123_ROOT}
${mpg123_ROOT}
)

# MSVC built mpg123 may be named mpg123_static.
# The provided project files name the library with the lib prefix.

find_library (MPG123_LIBRARY
find_library (mpg123_LIBRARY
NAMES
mpg123
mpg123_static
Expand All @@ -34,31 +61,35 @@ find_library (MPG123_LIBRARY
HINTS
${PC_MPG123_LIBDIR}
${PC_MPG123_LIBRARY_DIRS}
${MPG123_ROOT}
${mpg123_ROOT}
)

# Handle the QUIETLY and REQUIRED arguments and set MPG123_FOUND
if (PC_MPG123_FOUND)
set (mpg123_VERSION ${PC_MPG123_VERSION})
elseif (mpg123_INCLUDE_DIR)
file (READ "${mpg123_INCLUDE_DIR}/mpg123.h" _mpg123_h)
string (REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" _mpg123_version_re "${_mpg123_h}")
set (mpg123_VERSION "${_mpg123_version_re}")
endif ()

# Handle the QUIETLY and REQUIRED arguments and set mpg123_FOUND
# to TRUE if all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args (mpg123
REQUIRED_VARS
MPG123_LIBRARY
MPG123_INCLUDE_DIR
mpg123_LIBRARY
mpg123_INCLUDE_DIR
VERSION_VAR
MPG123_VERSION
mpg123_VERSION
)

if (MPG123_FOUND)
set (MPG123_LIBRARIES ${MPG123_LIBRARY})
set (MPG123_INCLUDE_DIRS ${MPG123_INCLUDE_DIR})

if (NOT TARGET MPG123::libmpg123)
add_library (MPG123::libmpg123 UNKNOWN IMPORTED)
set_target_properties (MPG123::libmpg123 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MPG123_INCLUDE_DIRS}"
IMPORTED_LOCATION "${MPG123_LIBRARIES}"
if (mpg123_FOUND AND NOT TARGET MPG123::libmpg123)
add_library (MPG123::libmpg123 UNKNOWN IMPORTED)
set_target_properties (MPG123::libmpg123
PROPERTIES
IMPORTED_LOCATION "${mpg123_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${mpg123_INCLUDE_DIR}"
)
endif ()
endif ()

mark_as_advanced(MPG123_INCLUDE_DIR MPG123_LIBRARY)
mark_as_advanced(mpg123_INCLUDE_DIR mpg123_LIBRARY)
6 changes: 3 additions & 3 deletions cmake/Toolchain-aarch64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_CROSSCOMPILING TRUE)

set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)
6 changes: 3 additions & 3 deletions cmake/Toolchain-arm-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING TRUE)

set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
28 changes: 28 additions & 0 deletions data/Amiberry.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Desktop Entry]

# The type of the Desktop Entry, usually Application
Type = Application

# The version of the Desktop Entry specification to which this file complies
Version = 1.0

# The name of the application
Name = Amiberry

# A comment which can/will be used as a tooltip
Comment = Amiga Emulator

# The executable of the application, possibly with arguments
Exec = /usr/bin/amiberry

# The name of the icon that will be used to display this entry
Icon = /usr/share/amiberry/data/amiberry.png

# Describes whether this application needs to be run in a terminal or not
Terminal = false

# Describes the categories in which this entry should be shown
Categories = Game;Emulator;

# Describes the encoding for the desktop entry
Encoding=UTF-8
5 changes: 0 additions & 5 deletions debian/changelog

This file was deleted.

12 changes: 0 additions & 12 deletions debian/control

This file was deleted.

7 changes: 0 additions & 7 deletions debian/copyright

This file was deleted.

3 changes: 0 additions & 3 deletions debian/rules

This file was deleted.

1 change: 0 additions & 1 deletion debian/source/format

This file was deleted.

6 changes: 3 additions & 3 deletions external/capsimage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ install(TARGETS ${PROJECT_NAME}
FRAMEWORK DESTINATION "/Library/Frameworks"
PUBLIC_HEADER DESTINATION include/caps${INCLUDE_SUFFIX})

if (NOT APPLE OR NOT BUILD_FRAMEWORK)
install(FILES ${API_HEADERS} DESTINATION include/caps${INCLUDE_SUFFIX})
endif()
#if (NOT APPLE OR NOT BUILD_FRAMEWORK)
# install(FILES ${API_HEADERS} DESTINATION include/caps${INCLUDE_SUFFIX})
#endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_FRAMEWORK)
message(STATUS "macOS platform detected")
Expand Down
5 changes: 0 additions & 5 deletions external/libguisan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,3 @@ add_library(guisan STATIC
target_include_directories(${PROJECT_NAME} PRIVATE include)
target_link_libraries(${PROJECT_NAME} SDL2 SDL2_ttf SDL2_image)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
109 changes: 55 additions & 54 deletions external/mt32emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,63 +323,64 @@ target_include_directories(mt32emu
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Runtime)
set(libmt32emu_COMPONENT_DEVEL COMPONENT Devel)

install(TARGETS mt32emu EXPORT MT32EmuTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# TODO: Use NAMELINK_COMPONENT with CMake 3.12 instead.
if(libmt32emu_SHARED)
install(TARGETS mt32emu EXPORT MT32EmuTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} NAMELINK_ONLY
)
endif()
install(TARGETS mt32emu EXPORT MT32EmuTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# TODO: Use NAMELINK_COMPONENT with CMake 3.12 instead.

install(DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/mt32emu.pc
DESTINATION ${libmt32emu_PKGCONFIG_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(EXPORT MT32EmuTargets
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
NAMESPACE MT32Emu::
${libmt32emu_COMPONENT_DEVEL}
)
configure_file(cmake/MT32EmuConfig.cmake.in cmake/MT32EmuConfig.cmake @ONLY)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(cmake/MT32EmuConfigVersion.cmake
VERSION ${libmt32emu_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfigVersion.cmake
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
if(libmt32emu_EXT_MODULE)
install(FILES
cmake/CheckDependencies.cmake
cmake/${libmt32emu_EXT_MODULE}
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
endif()
install(TARGETS mt32emu EXPORT MT32EmuTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ${libmt32emu_COMPONENT_DEVEL} NAMELINK_ONLY
)

install(FILES
AUTHORS.txt COPYING.txt COPYING.LESSER.txt NEWS.txt README.md TODO.txt
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/munt/${PROJECT_NAME}
)
install(DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/include/mt32emu.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/mt32emu.pc
DESTINATION ${libmt32emu_PKGCONFIG_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
install(EXPORT MT32EmuTargets
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
NAMESPACE MT32Emu::
${libmt32emu_COMPONENT_DEVEL}
)
configure_file(cmake/MT32EmuConfig.cmake.in cmake/MT32EmuConfig.cmake @ONLY)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(cmake/MT32EmuConfigVersion.cmake
VERSION ${libmt32emu_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/MT32EmuConfigVersion.cmake
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
if(libmt32emu_EXT_MODULE)
install(FILES
cmake/CheckDependencies.cmake
cmake/${libmt32emu_EXT_MODULE}
DESTINATION ${libmt32emu_CMAKE_PACKAGE_INSTALL_DIR}
${libmt32emu_COMPONENT_DEVEL}
)
endif()

install(FILES
AUTHORS.txt COPYING.txt COPYING.LESSER.txt NEWS.txt README.md TODO.txt
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/munt/${PROJECT_NAME}
)
endif()

# Facilitates usage of the library in another project either through
# an imported target or directly from the build tree.
Expand Down
2 changes: 1 addition & 1 deletion src/include/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define UAEMAJOR 6
#define UAEMINOR 3
#define UAESUBREV 4
#define UAESUBREV 5

#define MAX_AMIGADISPLAYS 1

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include "fsdb_host.h"
#include "keyboard.h"

static const char __ver[40] = "$VER: Amiberry v6.3.4 (2024-09-01)";
static const char __ver[40] = "$VER: Amiberry v6.3.5 (2024-09-20)";
long int version = 256 * 65536L * UAEMAJOR + 65536L * UAEMINOR + UAESUBREV;

extern int console_logging;
Expand Down
2 changes: 1 addition & 1 deletion src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4350,7 +4350,7 @@ int main(int argc, char* argv[])

init_amiberry_paths(data_directory, home_directory, config_directory);

// Parse command line to get possibly set amiberry_config.
// Parse command line to possibly set amiberry_config.
// Do not remove used args yet.
if (!parse_amiberry_cmd_line(&argc, argv, 0))
{
Expand Down
4 changes: 2 additions & 2 deletions src/osdep/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#define GETBDM(x) (((x) - (((x) / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)

#define AMIBERRYVERSION _T("Amiberry v6.3.4 preview (2024-09-01)")
#define AMIBERRYDATE MAKEBD(2024, 9, 1)
#define AMIBERRYVERSION _T("Amiberry v6.3.5 (2024-09-20)")
#define AMIBERRYDATE MAKEBD(2024, 9, 20)
#define COPYRIGHT _T("Copyright (C) 2016-2024 Dimitris Panokostas")

#define IHF_WINDOWHIDDEN 6
Expand Down