Merge branch '46-package-macos-binary' into 'master'

Prepare futher macOS packaging

See merge request libreweb/browser!26
master
Melroy van den Berg 2022-02-19 16:32:55 +00:00
commit b55503231e
15094 changed files with 207 additions and 61 deletions

View File

@ -12,13 +12,13 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Install dependencies
run: |
brew install \
cmake \
curl \
gtkmm3 \
gtk-mac-integration \
ninja
# Workaround for now, we create our own features.h file (macos image either is missing this file, or some include folder is missing during the build)
@ -33,19 +33,10 @@ jobs:
EOF
- name: Build
run: |
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDOXYGEN:BOOL=FALSE ..
ninja
run: ./scripts/build-macos-prod.sh
- uses: actions/upload-artifact@v2
with:
name: macOS-binary
path: build/src/libreweb-browser
# TODO: Packaging using CPack and PackageMaker
name: macOS-dmg-package
path: build_prod_macos/libreweb-browser-v*.dmg
#xcodebuild \
# -project "libreweb-browser.xcodeproj" \
# -scheme libreweb-browser \
# -configuration Debug

3
.gitignore vendored
View File

@ -70,8 +70,9 @@ Thumbs.db
# --------
*.dll
*.exe
# Allow ipfs.exe and the binaries in the packaging folder
!go-ipfs/ipfs.exe
!packaging_win/*
!misc/packaging_win/bin/*
# Build folders
build/

View File

@ -65,10 +65,16 @@ endif()
# Additional install files
if(WIN32)
# Windows specific
install(DIRECTORY packaging_win/ DESTINATION .)
# Microsoft Windows specific
install(DIRECTORY misc/packaging_generic/ DESTINATION .)
install(DIRECTORY misc/packaging_win/ DESTINATION .)
install(PROGRAMS go-ipfs/ipfs.exe DESTINATION bin)
else()
elseif(APPLE)
# Apple macOS specific
install(DIRECTORY misc/packaging_generic/ DESTINATION .)
install(DIRECTORY misc/packaging_macos/ DESTINATION .)
install(PROGRAMS go-ipfs/ipfs-darwin DESTINATION bin)
elseif(UNIX)
# UNIX specific
install(FILES misc/libreweb-browser.desktop DESTINATION share/applications)
install(PROGRAMS go-ipfs/ipfs DESTINATION bin)

View File

@ -218,7 +218,8 @@ For more info, see also: [Windows readme file](windows.md).
* Brew (`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`)
* CMake (brew: `cmake`)
* Libcurl (brew: `curl`)
* Gtk3/Gtkmm3 (brew: `gtkmm3`)
* Gtk3/Gtkmm3 (brew: `gtkmm3`)
* GTK Mac Integration (brew: `gtk-mac-integration`)
* Ninja (brew: `ninja`)
#### MacOS Build

View File

@ -1,6 +1,6 @@
# Example 1: https://github.com/MariaDB/server/tree/10.8/cmake
# Example 2: https://gitlab.com/inkscape/inkscape/blob/master/CMakeScripts/ConfigCPack.cmake
#set(CPACK_PACKAGE_NAME "LibreWeb Browser")
# Example 3: https://github.com/rcaelers/workrave/blob/main/ui/app/toolkits/gtkmm/dist/macos/CMakeLists.txt
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LibreWeb Browser - Decentralized Web-Browser")
set(CPACK_PACKAGE_VENDOR "Melroy van den Berg")
set(CPACK_PACKAGE_CONTACT "Melroy van den Berg <info@libreweb.org>")
@ -12,6 +12,10 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_TARGET}-${CPACK_PACKAGE_VERSION}")
set(CPACK_DEBIAN_PACKAGE_SECTION "web")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-v${CPACK_PACKAGE_VERSION}") # Without '-Linux' or '-Win' suffix
# macOS specific options - Used for DragNDrop bundle generator
set(CPACK_BUNDLE_NAME "${PROJECT_NAME}-v${CPACK_PACKAGE_VERSION}")
set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/misc/Info.plist")
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/images/icons/libreweb-browser.icns")
# Windows specific options - GUI Installer (NSIS generator)
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/images/browser_logo_small.bmp")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "LibreWeb")
@ -41,8 +45,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND EXISTS "/etc/os-release")
)
if (NOT ${DIFINE_LINUX_DISTRO_RESULT} EQUAL 0)
message (FATAL_ERROR "Linux distro identification error")
endif ()
endif ()
endif()
endif()
# RPM section
if(${LINUX_DISTRO} MATCHES "openSUSE")

Binary file not shown.

View File

@ -5,14 +5,6 @@ set(LIBARY_NAME ${PROJECT_NAME})
# Create static library
add_library(${LIBARY_NAME} STATIC whereami.c whereami.h)
# Add X/Open definition for realpath
target_compile_definitions(${LIBARY_NAME} PUBLIC _XOPEN_SOURCE=500)
# MacOS specific compile flag
if(APPLE)
target_compile_definitions(${LIBARY_NAME} PUBLIC _DARWIN_C_SOURCE)
endif()
# Use PUBLIC iso INTERFACE, so the library itself also finds it's own header file
target_include_directories(
${LIBARY_NAME}

View File

@ -12,6 +12,15 @@
extern "C" {
#endif
#if defined(__linux__) || defined(__CYGWIN__)
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#elif defined(__APPLE__)
#undef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#define _DARWIN_BETTER_REALPATH
#endif
#if !defined(WAI_MALLOC) || !defined(WAI_FREE) || !defined(WAI_REALLOC)
#include <stdlib.h>
#endif
@ -360,7 +369,6 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
#elif defined(__APPLE__)
#define _DARWIN_BETTER_REALPATH
#include <mach-o/dyld.h>
#include <limits.h>
#include <stdlib.h>

10
misc/Info.plist Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>libreweb-browser</string>
<key>CFBundleIconFile</key>
<string>libreweb-browser.icns</string>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More