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

chore: Fix background and icon of macOS dmg. #259

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- name: Fetch build scripts
run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles"
- name: Cache compiler output
uses: actions/cache@v4
with:
Expand All @@ -351,12 +353,10 @@ jobs:
path: |
.ci-scripts/dockerfiles/local-deps/qt
key: ${{ runner.os }}-${{ matrix.arch }}-qt
- name: Set up ccache
run: brew install ccache && ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Fetch build scripts
run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles"
- name: Homebrew dependencies to build dependencies
run: brew bundle --file ./macos/Brewfile-DepBuildDeps
- name: Set up ccache
run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Build dependencies (except Qt)
if: steps.cache-deps.outputs.cache-hit != 'true'
run: ./.ci-scripts/build-macos-deps.sh ${{ matrix.arch }}
Expand Down Expand Up @@ -434,17 +434,17 @@ jobs:
runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
steps:
- uses: actions/checkout@v4
- name: Fetch build scripts
run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles"
- name: Cache compiler output
uses: actions/cache@v4
with:
path: ".cache/ccache"
key: ${{ github.job }}-${{ matrix.arch }}-ccache
- name: Set up ccache
run: brew install ccache && ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Fetch build scripts
run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles"
- name: Homebrew
run: brew bundle --file ./macos/Brewfile
- name: Set up ccache
run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Install toxcore
run: .ci-scripts/dockerfiles/qtox/build_toxcore_linux.sh sudo
- name: Build qTox
Expand Down
12 changes: 0 additions & 12 deletions cmake/Installation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,8 @@ if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/macos/info.plist")

find_path(MACDEPLOYQT_PATH macdeployqt PATH_SUFFIXES bin)
if(NOT MACDEPLOYQT_PATH)
message(FATAL_ERROR "Could not find macdeployqt for macOS bundling. You can point MACDEPLOYQT_PATH to it's path.")
endif()

set(BUNDLE_PATH "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app")

install(CODE "
message(STATUS \"Creating app bundle\")
execute_process(COMMAND ln -sf /opt/homebrew/lib ${CMAKE_BINARY_DIR}/lib)
execute_process(COMMAND ${MACDEPLOYQT_PATH}/macdeployqt ${BUNDLE_PATH} -no-strip)
" COMPONENT Runtime
)

install(FILES img/icons/qtox.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/)
install(FILES img/icons/qtox_profile.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/)

Expand Down
1 change: 1 addition & 0 deletions macos/Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
brew "cmake"
brew "coreutils"
brew "create-dmg"
brew "ffmpeg"
brew "git"
brew "libexif"
Expand Down
3 changes: 3 additions & 0 deletions macos/Brewfile-DepBuildDeps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# just compiling for their own machine.
brew "cmake"
brew "coreutils"
brew "create-dmg"
brew "git"
brew "libtool"
brew "ninja"
brew "yasm"
# accelerate builds with ccache
brew "ccache"
Binary file removed macos/DS_Store-DMG
Binary file not shown.
File renamed without changes.
40 changes: 18 additions & 22 deletions macos/createdmg
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,30 @@ set -eu -o pipefail

QTOX_DIR="$1"

cd "$2"
BUNDLE_PATH="$PWD"
cd -
BUNDLE_PATH="$(realpath "$2")"
BUILD_DIR="$(realpath "$BUNDLE_PATH/..")"

cd "$BUNDLE_PATH/../"
BUILD_DIR="$PWD"
cd -

DMG_DIR="$BUILD_DIR/dmg.tmp"
APP_VER=$(defaults read "$BUNDLE_PATH/Contents/Info.plist" CFBundleVersion)

if [ ! -d "$BUNDLE_PATH" ]; then
echo "Please pass path to qTox.app as an argument!"
exit 1
fi

rm -rf "$DMG_DIR"
rm -f "$BUILD_DIR/qTox.dmg"
mkdir "$DMG_DIR"
cp -r "$BUNDLE_PATH" "$DMG_DIR/"

cd "$DMG_DIR"
ln -s /Applications "./Install to Applications"
mkdir .background
cp -f "$QTOX_DIR"/macos/background-DMG/qTox-DMG-bak.tiff .background/backgroundImage.tiff
cp -f "$QTOX_DIR"/macos/DS_Store-DMG ./.DS_Store
cp -f "$QTOX_DIR"/LICENSE ./LICENSE
cp -f "$QTOX_DIR"/README.md ./README.md
cd -

hdiutil create -volname "qTox $APP_VER" -srcfolder "$DMG_DIR/" -format UDZO "$BUILD_DIR/qTox.dmg"

create-dmg \
--filesystem APFS \
--no-internet-enable \
--volname "qTox $APP_VER" \
--volicon "$QTOX_DIR/img/icons/qtox.icns" \
--background "$QTOX_DIR/macos/backgroundImage.tiff" \
--eula "$QTOX_DIR/macos/gplv3.rtf" \
--window-pos 200 120 \
--window-size 640 480 \
--icon-size 128 \
--hide-extension "qTox.app" \
--icon "qTox.app" 0 300 \
--app-drop-link 400 300 \
"$BUILD_DIR/qTox.dmg" \
"$BUNDLE_PATH"
43 changes: 0 additions & 43 deletions macos/makedist.sh

This file was deleted.

12 changes: 0 additions & 12 deletions macos/welcome.txt

This file was deleted.

5 changes: 2 additions & 3 deletions src/persistence/db/rawdatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ void RawDatabase::process()
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
// SQLITE_STATIC uses old-style cast and 0 as null pointer butcomes from system
// headers, so can't be fixed by us
// SQLITE_STATIC uses old-style cast and 0 as null pointer but comes from
// system headers, so can't be fixed by us.
auto sqliteDataType = SQLITE_STATIC;
#pragma GCC diagnostic pop
if (sqlite3_bind_blob(stmt, i + 1, blob.data(), blob.size(), sqliteDataType)
Expand All @@ -804,7 +804,6 @@ void RawDatabase::process()
curParam += nParams;
} while (compileTail != query.query.data() + query.query.size());


// Execute each statement of each query of our transaction
for (sqlite3_stmt* stmt : query.statements) {
int column_count = sqlite3_column_count(stmt);
Expand Down
Loading