Skip to content

Commit 774987b

Browse files
committed
workflow: add build-macos-gui and fix cmake.yml
1 parent 5b93dc9 commit 774987b

File tree

2 files changed

+71
-18
lines changed

2 files changed

+71
-18
lines changed

.github/workflows/cmake.yml

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CMake CI (Test customfetch)
22

33
on:
44
push:
5-
branches: [ "main", "plugins" ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ "main", "plugins" ]
7+
branches: [ "main" ]
88

99
jobs:
1010
build-ubuntu_22-04:
@@ -20,15 +20,15 @@ jobs:
2020
sudo apt-get purge firefox # Slows down the installation alot, fuck snap
2121
sudo apt-get update && sudo apt upgrade -y
2222
sudo apt-get install neofetch tree build-essential cmake g++-11 libwayland-dev gettext libdconf-dev libglib2.0-dev libarchive-tools -y
23-
23+
2424
- name: Clean
2525
run: make distclean
2626

2727
- name: Compile and install
2828
run: |
2929
export CXX=x86_64-linux-gnu-g++-11
3030
mkdir build && cd build
31-
cmake .. -DCMAKE_BUILD_TYPE=Debug
31+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr
3232
make
3333
sudo make install
3434
@@ -43,9 +43,9 @@ jobs:
4343
tree /sys/devices/system/cpu/cpu0/
4444
printf "/etc/os-release\n" && cat /etc/os-release
4545
printf "getting 0x5353 hexcode\n" && grep -nri "5353" /sys/class/ || true
46-
46+
4747
- name: Test customfetch
48-
run: LD_LIBRARY_PATH="./build:$LD_LIBRARY_PATH" customfetch --wrap-lines
48+
run: customfetch --wrap-lines
4949

5050
- name: Upload to github artifacts
5151
uses: actions/upload-artifact@v4
@@ -75,15 +75,15 @@ jobs:
7575
run: |
7676
export CXX=x86_64-linux-gnu-g++-11
7777
mkdir build && cd build
78-
cmake .. -DCMAKE_BUILD_TYPE=Debug -DGUI_APP=1
78+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DGUI_APP=1 -DCMAKE_INSTALL_PREFIX=/usr
7979
make
8080
sudo make install
8181
8282
- name: Test neofetch
8383
run: neofetch
84-
84+
8585
- name: Test customfetch
86-
run: LD_LIBRARY_PATH="./build:$LD_LIBRARY_PATH" customfetch-gui --version
86+
run: customfetch-gui --version
8787

8888
- name: Upload to github artifacts
8989
uses: actions/upload-artifact@v4
@@ -104,7 +104,7 @@ jobs:
104104

105105
- name: Install the packages
106106
run: pacman -Syyu git sudo binutils cmake gdb base-devel fakeroot pkgconf tree fastfetch --noconfirm --needed
107-
107+
108108
- name: get /etc/sudoers
109109
run: |
110110
sed -i "s#root ALL=(ALL:ALL) ALL#root ALL=(ALL:ALL) NOPASSWD: ALL\nnobody ALL=(ALL:ALL) NOPASSWD: ALL#g" /etc/sudoers
@@ -120,7 +120,7 @@ jobs:
120120
- name: Compile and install
121121
run: |
122122
mkdir build && cd build
123-
cmake .. -DCMAKE_BUILD_TYPE=Debug
123+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr
124124
make
125125
make install
126126
@@ -136,7 +136,7 @@ jobs:
136136
printf "/etc/os-release\n" && cat /etc/os-release
137137
138138
- name: Test customfetch
139-
run: LD_LIBRARY_PATH="./build:$LD_LIBRARY_PATH" customfetch --wrap-lines
139+
run: customfetch --wrap-lines
140140

141141
build-macos:
142142
runs-on: macos-latest
@@ -147,19 +147,23 @@ jobs:
147147
- uses: actions/checkout@v4
148148

149149
- name: Install the packages
150-
run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite fastfetch neofetch tree llvm@19
150+
run: brew install --overwrite fastfetch neofetch tree llvm
151151

152152
- name: uname -a && clang++ --version
153-
run: uname -a && echo "\n" && $(brew --prefix llvm@19)/bin/clang++ --version
154-
153+
run: |
154+
printf 'export CXX=/opt/homebrew/opt/llvm/bin/clang++' >> /Users/runner/.bash_profile
155+
printf 'export CC=/opt/homebrew/opt/llvm/bin/clang' >> /Users/runner/.bash_profile
156+
printf 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"' >> /Users/runner/.bash_profile
157+
printf 'export CXXFLAGS="-isystem/opt/homebrew/opt/llvm/include"' >> /Users/runner/.bash_profile
158+
uname -a && clang++ --version
159+
155160
- name: Clean
156161
run: make distclean
157162

158163
- name: Compile and install
159164
run: |
160-
export CXX=$(brew --prefix llvm@19)/bin/clang++
161165
mkdir build && cd build
162-
cmake .. -DCMAKE_BUILD_TYPE=Debug
166+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr
163167
make
164168
165169
- name: Test neofetch
@@ -169,11 +173,55 @@ jobs:
169173
run: fastfetch
170174

171175
- name: Test customfetch
172-
run: LD_LIBRARY_PATH="./build:$LD_LIBRARY_PATH" ./build/customfetch -D assets
176+
run: ./build/customfetch -D assets
173177

174178
- name: Upload to github artifacts
175179
uses: actions/upload-artifact@v4
176180
with:
177181
if-no-files-found: error
178182
name: customfetch-macos
179183
path: ./build/customfetch
184+
185+
build-macos-GUI:
186+
runs-on: macos-latest
187+
permissions:
188+
contents: read
189+
190+
steps:
191+
- uses: actions/checkout@v4
192+
193+
- name: Install the packages
194+
run: brew install --overwrite fastfetch neofetch tree llvm gtkmm3
195+
196+
- name: uname -a && clang++ --version
197+
run: |
198+
printf 'export CXX=/opt/homebrew/opt/llvm/bin/clang++' >> /Users/runner/.bash_profile
199+
printf 'export CC=/opt/homebrew/opt/llvm/bin/clang' >> /Users/runner/.bash_profile
200+
printf 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"' >> /Users/runner/.bash_profile
201+
printf 'export CXXFLAGS="-isystem/opt/homebrew/opt/llvm/include"' >> /Users/runner/.bash_profile
202+
uname -a && clang++ --version
203+
204+
- name: Clean
205+
run: make distclean
206+
207+
- name: Compile and install
208+
run: |
209+
mkdir build && cd build
210+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DGUI_APP=1 -DCMAKE_INSTALL_PREFIX=/usr
211+
make
212+
213+
- name: Test neofetch
214+
run: neofetch
215+
216+
- name: Test fastfetch
217+
run: fastfetch
218+
219+
- name: Test customfetch
220+
run: ./build/customfetch-gui --version
221+
222+
- name: Upload to github artifacts
223+
uses: actions/upload-artifact@v4
224+
with:
225+
if-no-files-found: error
226+
name: customfetch-macos-gui
227+
path: ./build/customfetch-gui

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ endif()
6060
add_executable(${TARGET_NAME} ${SRC})
6161
enable_lto(${TARGET_NAME})
6262

63+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
64+
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,${ORIGIN}/")
65+
endif()
66+
6367
# Get git info hash and branch
6468
execute_process(COMMAND ./scripts/generateVersion.sh
6569
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
@@ -88,6 +92,7 @@ if(GUI_APP)
8892
find_package(PkgConfig REQUIRED)
8993
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0 gdkmm-3.0)
9094
target_link_libraries(${TARGET_NAME} PUBLIC ${GTKMM_LIBRARIES})
95+
target_link_libraries(${TARGET_NAME} PUBLIC ${GTKMM_LINK_LIBRARIES})
9196
target_include_directories(${TARGET_NAME} PUBLIC ${GTKMM_INCLUDE_DIRS})
9297
target_compile_options(${TARGET_NAME} PUBLIC ${GTKMM_CFLAGS_OTHER})
9398
endif()

0 commit comments

Comments
 (0)