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

Attempt 2 on fixing blurry text on macOS #124

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
f71c8b9
Switch default macOS font, try to fix blur
rohit-px2 Feb 2, 2022
a4460e2
Fix? build for mac, don't package assets
rohit-px2 Feb 5, 2022
b231cbe
Add -r flag to copy .app
rohit-px2 Feb 5, 2022
3e116f1
Add Qt::AA_EnableHighDpiScaling flag
rohit-px2 Feb 12, 2022
9b0bec4
Fix dpi scaling blurriness on Qt (not Windows yet)
rohit-px2 Feb 12, 2022
4e5971b
Scale for DPI on D2D (Windows)
rohit-px2 Feb 13, 2022
baa2043
Set environment on macOS
rohit-px2 Feb 25, 2022
766dacd
Add semicolon
rohit-px2 Feb 25, 2022
839b33b
Merge branch 'main' into blurry_text_fix_mac
rohit-px2 Mar 11, 2022
090bf5b
Re-trigger builds
rohit-px2 Apr 27, 2022
be22b1f
Update vcpkg to latest
rohit-px2 Jun 15, 2022
91dd1af
Update vcpkg, attempt to fix building on Windows
rohit-px2 Nov 13, 2022
0758669
Try removing vcpkg.json and manually installing vcpkg packages
rohit-px2 Nov 15, 2022
764f9b7
Hopefully fix actions
rohit-px2 Nov 17, 2022
fa40560
Remove empty step
rohit-px2 Nov 17, 2022
f2300e8
Remove - in front of run command, fix some formatting
rohit-px2 Nov 17, 2022
6cb57b4
Fix Qt5_Dir setting
rohit-px2 Nov 17, 2022
44ebc17
Fix? install-qt command on Windows
rohit-px2 Jan 17, 2023
2258cb1
Revert "Update vcpkg to latest"
rohit-px2 Jan 17, 2023
8fa4f7d
Install Qt5 manually on Windows
rohit-px2 Jan 18, 2023
689b4bd
Update package list before installing (attempting to fix python not f…
rohit-px2 Jan 18, 2023
eb67fd0
Update vcpkg but keep boost versions the same
rohit-px2 Jan 18, 2023
048cff2
Update vcpkg baseline commit
rohit-px2 Jan 18, 2023
6e05c9d
Once again, try to update vcpkg to latest
rohit-px2 Jan 18, 2023
ad9549a
Attempting to fix builds
rohit-px2 Jan 18, 2023
f234c55
Hopefully fix builds for macos debug & ubuntu
rohit-px2 Jan 19, 2023
e0f4f4e
Remove vcpkg.json
rohit-px2 Jan 19, 2023
746e350
Bootstrap vcpkg before install..
rohit-px2 Jan 19, 2023
1624240
Get rid of caching for now
rohit-px2 Jan 19, 2023
d1af8ca
Revert "Remove vcpkg.json"
rohit-px2 Jan 19, 2023
674f721
Don't install qt5 from vcpkg on windows
rohit-px2 Jan 19, 2023
e50a7c4
Remove catch2 from brew install on Mac
rohit-px2 Jan 19, 2023
5f5eeec
Add more to CMAKE_PREFIX_PATH on Windows
rohit-px2 Jan 19, 2023
7838373
Remove bad brackets
rohit-px2 Jan 19, 2023
511d839
Try another way of adding to env/path
rohit-px2 Jan 19, 2023
aa90731
Use CMAKE_PREFIX_PATH env var in cmake command
rohit-px2 Jan 19, 2023
c9b1e9f
Remove part of CMAKE_PREFIX_PATH
rohit-px2 Jan 19, 2023
54b1acd
Add CMAKE_PREFIX_PATH as env var instead of GITHUB_ENV
rohit-px2 Jan 19, 2023
e048dc5
More dependencies for Ubuntu, try to use Qt5_Dir on Windows
rohit-px2 Jan 19, 2023
74ea048
Hardcode Qt5_DIR (hopefully this works
rohit-px2 Jan 19, 2023
f673541
Bring windows debug & release builds more together
rohit-px2 Jan 19, 2023
b889e03
Fix switching up of Debug & Release for windows actions
rohit-px2 Jan 19, 2023
ce2a433
Fix Qt5 directory (?)
rohit-px2 Jan 19, 2023
6f2e2ca
Back to installing qt5-base through vcpkg on Windows
rohit-px2 Jan 19, 2023
dd2ea8c
Try using C drive on Windows for more space
rohit-px2 Jan 20, 2023
6a9fa2a
Clone repo to C and use working-directory property
rohit-px2 Jan 20, 2023
dc886f3
Remove working-directory for uses steps
rohit-px2 Jan 20, 2023
38ce1cc
Use https github repository url
rohit-px2 Jan 20, 2023
55ec9e9
Bootstrap vcpkg before running cmake
rohit-px2 Jan 20, 2023
46e66bc
Update vcpkg submodule after checkout
rohit-px2 Jan 20, 2023
1ad9286
Fix PR build and Ubuntu (?)
rohit-px2 Jan 20, 2023
425f00a
Remove missing packages, use old way to add to PATH
rohit-px2 Jan 20, 2023
f757f8f
Add back some packages (had a typo)
rohit-px2 Jan 20, 2023
ffaa540
Use specific versions for unix OSes
rohit-px2 Jan 21, 2023
b2e6696
Nevermind use macos 10.15 for now
rohit-px2 Jan 21, 2023
01cb5fc
Install libicu66
rohit-px2 Feb 1, 2023
1599b31
Require boost thread component
rohit-px2 Feb 1, 2023
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
215 changes: 145 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- name: Ubuntu Debug
os: ubuntu-20.04
buildtype: 'Debug'
cc: clang-12
cxx: clang++-12
test: true
upload: false
cmakeflags: '-DBUILD_TESTS=ON'

- os: ubuntu-latest
- name: Ubuntu Release
os: ubuntu-20.04
buildtype: 'Release'
cc: clang-12
cxx: clang++-12
Expand All @@ -24,15 +26,17 @@ jobs:
use_vcpkg: true
cmakeflags: ''

- os: macos-10.15
- name: Macos Debug
os: macos-10.15
buildtype: 'Debug'
cc: clang
cxx: clang++
test: true
upload: false
cmakeflags: '-DBUILD_TESTS=ON'

- os: macos-10.15
- name: Macos Release
os: macos-10.15
buildtype: 'Release'
cc: clang
cxx: clang++
Expand Down Expand Up @@ -76,38 +80,50 @@ jobs:
- name: Ubuntu - Install vcpkg dependencies
if: startsWith(matrix.os, 'ubuntu') && matrix.use_vcpkg
run: >
sudo apt-get install gperf autoconf build-essential libtool
libgl1-mesa-dev libxi-dev libx11-dev libxext-dev
libxkbcommon-x11-dev libglu1-mesa-dev libx11-xcb-dev
'^libxcb.*-dev' libxrender-dev ninja-build curl
zip unzip tar autopoint python
sudo apt-get install git curl zip unzip tar at libxt-dev gperf libxaw7-dev cifs-utils
build-essential g++ gfortran libx11-dev libxkbcommon-x11-dev libxi-dev
libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev libxxf86vm-dev
libxcursor-dev yasm libnuma1 libnuma-dev libtool-bin
flex bison libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev
xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full
libxext-dev libxfixes-dev libxrender-dev
libxcb1-dev libx11-xcb-dev libxcb-glx0-dev meson nasm cmake ninja-build
libxkbcommon-dev libxcb-keysyms1-dev
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev
libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev
libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev
libxcb-cursor-dev libkrb5-dev libxcb-res0-dev libxcb-keysyms1-dev libxcb-xkb-dev libxcb-record0-dev
python3-setuptools python3-mako python3-pip python3-venv nodejs libwayland-dev python2 python-is-python3
guile-2.2-dev libxdamage-dev libdbus-1-dev libxtst-dev haskell-stack libkrb5-3 zlib1g
libxcb-util0-dev pkg-config libicu66
# python-yaml

- name: Mac - Install vcpkg dependencies
if: startsWith(matrix.os, 'macos') && matrix.use_vcpkg
run: |
brew install automake
brew install automake autoconf-archive libtool

- name: Restore vcpkg packages
if: matrix.use_vcpkg
uses: actions/cache@v2
with:
path: |
build/vcpkg_installed
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}-${{ env.CC }}-${{ env.CXX }}
#- name: Restore vcpkg packages
#if: matrix.use_vcpkg
#uses: actions/cache@v2
#with:
#path: |
#build/vcpkg_installed
#key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}-${{ env.CC }}-${{ env.CXX }}

- name: Ubuntu - Install dependencies from system package manager
if: ${{ startsWith(matrix.os, 'ubuntu') && !matrix.use_vcpkg }}
run: >
sudo apt-get install libmsgpack-dev libfmt-dev libboost-all-dev
mesa-common-dev libglu1-mesa-dev

- name: Ubuntu - Install Catch2
if: ${{ startsWith(matrix.os, 'ubuntu') && !matrix.use_vcpkg }}
- name: Ubuntu & MacOS Debug - Build & install Catch2 from source
if: ${{ !matrix.use_vcpkg }}
run: |
git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout v2.x
cmake -B build -H. -DBUILD_TESTING=OFF
git checkout devel
cmake -B build -H. -DBUILD_TESTING=OFF -DCMAKE_CXX_STANDARD=17
cd build
sudo make install

Expand All @@ -130,7 +146,7 @@ jobs:
- name: Mac - Install dependencies
if: ${{ startsWith(matrix.os, 'macos') && !matrix.use_vcpkg }}
run: |
brew install fmt boost qt@5 msgpack-cxx catch2
brew install fmt boost qt@5 msgpack-cxx
sudo ln -s /usr/local/Cellar/qt@5/5.15.2/plugins /usr/local/plugins

- name: Mac - Set environment variables
Expand Down Expand Up @@ -160,13 +176,22 @@ jobs:
if: matrix.test
run: ./build/nvui_test

- name: Package (Ubuntu & Mac)
if: matrix.upload
- name: Package (Ubuntu)
if: matrix.upload && startsWith(matrix.os, 'ubuntu')
run: |
ls build
chmod +x ./scripts/linux/package.sh
./scripts/linux/package.sh

- name: Package (macOS)
if: matrix.upload && startsWith(matrix.os, 'macos')
run: |
cd build
mkdir packaged
mkdir packaged/bin
cp -r nvui.app packaged/bin
cp -r ../vim packaged

- name: Ubuntu - Upload artifact
uses: actions/upload-artifact@v2
if: matrix.upload && startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -216,78 +241,128 @@ jobs:
tag: ${{ github.ref }}
overwrite: false
body: "Automated release by Github Actions."
windows-debug:
runs-on: windows-latest
windows:
strategy:
fail-fast: false
matrix:
include:
- name: Windows Release
os: windows-latest
buildtype: 'Release'
debug: false
upload: true
cmakeflags: ''
c: clang
cpp: clang++
gen: Ninja

- name: Windows Debug
os: windows-latest
buildtype: 'Debug'
debug: true
upload: false
cmakeflags: '-DBUILD_TESTS=ON'
c: clang
cpp: clang++
gen: Ninja
runs-on: ${{ matrix.os }}
timeout-minutes: 500
env:
buildDir: '${{ github.workspace }}/build'
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set last commit hash as environment variable (push)
if: ${{ github.event_name == 'push' }}
run: |
"COMMIT_SHA=${{ github.sha }}" >> $env:GITHUB_ENV
- name: Set last commit hash as environment variable (pull request)
if: ${{ github.event_name == 'pull_request' }}
run: |
"COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $env:GITHUB_ENV

- name: Clone repo to C drive
run: |
git clone --recurse-submodules https://github.com/rohit-px2/nvui.git C:\nvui
cd C:\nvui
git checkout $env:COMMIT_SHA
git submodule init
git submodule update

- uses: ilammy/msvc-dev-cmd@v1
with:
sdk: 10.0.19041.0

- name: Install Neovim Stable
if: matrix.debug
run: choco install -y neovim

- name: Add Neovim to PATH
run: echo "C:\tools\neovim\Neovim\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Restore deps from cache if they exist
uses: actions/cache@v2
with:
path: |
build/vcpkg_installed
key: ${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-build-debug-${{ hashFiles('vcpkg.json') }}
- name: Build nvui and nvui_test
run: .\scripts\windows\build-debug.ps1
if: matrix.debug
run: |
echo "C:\tools\neovim\nvim-win64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
#- name: Restore deps from cache if they exist
#uses: actions/cache@v2
#with:
#path: |
#build/vcpkg_installed
#key: ${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
#restore-keys: |
#${{ runner.os }}-build-release-${{ hashFiles('vcpkg.json') }}

# Step was taken from Neovim-Qt's github actions workflow file
# at https://github.com/equalsraf/neovim-qt/blob/master/.github/workflows/build-test.yml
#- name: Install Qt5
#env:
#QT_DIR: ${{ github.workspace }}\Qt\5.15.2\msvc2019_64
#run: |
#python -m pip install aqtinstall
#python -m aqt install-qt -O ./Qt windows desktop 5.15.2 win64_msvc2019_64
#"Qt5_DIR=$env:QT_DIR\lib\cmake\Qt5" >> $env:GITHUB_ENV
#"${{ env.qt_dir }}" >> $env:GITHUB_PATH
#"${{ env.qt_dir }}" >> $env:GITHUB_PATH

- name: Bootstrap vcpkg before build
working-directory: C:/nvui
run: .\vcpkg\bootstrap-vcpkg.bat -disableMetrics

- name: Build nvui (& nvui_test in Debug mode)
working-directory: C:/nvui
run: |
cmake -B build . -DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} ${{ matrix.cmakeflags }} -DCMAKE_C_COMPILER=${{ matrix.c }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp }} -G ${{ matrix.gen }}
cmake --build build --config ${{ matrix.buildtype }}
shell: cmd

- name: Run tests
working-directory: C:/nvui
if: matrix.debug
run: |
cd build
.\nvui_test
shell: cmd
windows-release:
runs-on: windows-latest
strategy:
fail-fast: false
timeout-minutes: 500
env:
buildDir: '${{ github.workspace }}/build'
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: ilammy/msvc-dev-cmd@v1
with:
sdk: 10.0.19041.0
- name: Restore deps from cache if they exist
uses: actions/cache@v2
with:
path: |
build/vcpkg_installed
key: ${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-build-release-${{ hashFiles('vcpkg.json') }}
- name: Package into a zip
run: .\scripts\windows\package.ps1

- name: Package nvui (Release)
working-directory: C:/nvui
if: ${{ !matrix.debug }}
run: |
.\scripts\windows\package.ps1

- name: Upload artifact
if: matrix.upload
uses: actions/upload-artifact@v2
with:
name: nvui-win64
if-no-files-found: ignore
path: build/nvui

- name: Rename nvui.zip to nvui-win64.zip for release upload
if: startsWith(github.ref, 'refs/tags/')
run: ren nvui.zip nvui-win64.zip
working-directory: C:/nvui
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.upload }}
run: |
ren nvui.zip nvui-win64.zip

- name: Upload Release asset
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.upload }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: nvui-win64.zip
file: C:\nvui\nvui-win64.zip
tag: ${{ github.ref }}
overwrite: false
body: "Automated release by Github Actions."
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ CMakeLists.txt.user
.ccls-cache/
CMakeSettings.json
.ignore
vcpkg_installed/
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ endif()
target_link_libraries(nvui PRIVATE
${Boost_LIBRARIES}
)
if(APPLE)
set_target_properties(nvui PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/assets/resources/macos/Info.plist
)
endif()
include(CheckIPOSupported)
check_ipo_supported(RESULT LTOAvailable)
if(LTOAvailable)
Expand Down Expand Up @@ -160,8 +166,7 @@ if(BUILD_TESTS)
target_include_directories(nvui_test PRIVATE ${Boost_INCLUDE_DIR})
endif()
target_link_libraries(nvui_test PRIVATE
Boost::thread
Boost::filesystem
${Boost_LIBRARIES}
)
include(CTest)
include(Catch)
Expand Down
10 changes: 10 additions & 0 deletions assets/resources/macos/Info.plist
Original file line number Diff line number Diff line change
@@ -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>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
2 changes: 0 additions & 2 deletions scripts/linux/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ cd build
mkdir packaged
mkdir packaged/bin
cp nvui packaged/bin
cp -r ../assets packaged
rm -rf packaged/assets/display
cp -r ../vim packaged
2 changes: 1 addition & 1 deletion scripts/windows/build-debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ param(
[string]$gen = "Ninja"
)
$generator = '"{0}"' -f $gen
$cmd = Write-Output "cmake . -B build -DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$cc -DCMAKE_CXX_COMPILER=$cxx -G $generator -DBUILD_TESTS=ON"
$cmd = Write-Output "cmake . -B build -DQt5_DIR=$env:Qt5_DIR -DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$cc -DCMAKE_CXX_COMPILER=$cxx -G $generator -DBUILD_TESTS=ON"
cmd /C $cmd
cmake --build build --config Debug
2 changes: 1 addition & 1 deletion scripts/windows/build-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ param(
[string]$gen = "Ninja"
)
$generator = '"{0}"' -f $gen
$cmd = Write-Output "cmake . -B build -DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$cc -DCMAKE_CXX_COMPILER=$cxx -G $generator"
$cmd = Write-Output "cmake . -B build -DQt5_DIR=$env:Qt5_DIR -DCMAKE_TOOLCHAIN_FILE=.\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$cc -DCMAKE_CXX_COMPILER=$cxx -G $generator"
cmd /C $cmd
cmake --build build --config Release
3 changes: 0 additions & 3 deletions scripts/windows/package.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
./scripts/windows/build-release.ps1
cd build
mkdir nvui
cd nvui
mkdir bin
cd ..
(gci -Path ./* -Include nvui.exe, *.dll, *.conf).fullname | foreach {Copy-Item -Force -Path $_ -Destination nvui/bin}
Copy-Item -Force -Recurse -Path plugins -Destination nvui/bin
Copy-Item -Force -Recurse -Path ../assets -Destination nvui
Copy-Item -Force -Recurse -Path ../vim -Destination nvui
Remove-Item -Force -Recurse -Path nvui/assets/display
Compress-Archive -Force -Path nvui -DestinationPath nvui.zip
Move-Item -Force -Path nvui.zip -Destination ../
cd ..
Loading