diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..f8f228ac --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,33 @@ +name: CMake + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Add PPA + run: sudo apt-add-repository ppa:mir-team/release + + - name: Install dependencies + run: sudo apt-get install libmiral-dev + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} diff --git a/.gitignore b/.gitignore index d7399a3c..60411f63 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,6 @@ mir-builder.* build Technical_Test_-_Software_Engineer_-_Mir_-_Google_Docs.pdf .cache -temp-build \ No newline at end of file +temp-build + +*.snap diff --git a/.idea/.name b/.idea/.name index c4f1134d..65d6ca06 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -MirCompositor \ No newline at end of file +MiracleWM \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index d6c629cc..6f7ec365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.5) +cmake_policy(SET CMP0015 NEW) +cmake_policy(SET CMP0022 NEW) + +project(miracle-wm) -project(MiracleWM) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -13,7 +16,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) find_package(PkgConfig) pkg_check_modules(MIRAL miral REQUIRED) -find_package(OpenGL REQUIRED) add_executable(miracle-wm src/display_listener.cpp @@ -25,4 +27,8 @@ add_executable(miracle-wm ) target_include_directories(miracle-wm PUBLIC SYSTEM ${MIRAL_INCLUDE_DIRS}) -target_link_libraries( miracle-wm ${MIRAL_LDFLAGS} -lwayland-client) +target_link_libraries( miracle-wm ${MIRAL_LDFLAGS}) + +install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/miracle-wm + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin +) \ No newline at end of file diff --git a/README.md b/README.md index fc843422..c5ee8cb7 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,9 @@ Features: - [x] Moving window with keyboard - [ ] Gaps in windows - [ ] Account for minimum sizes on windows (e.g. gedit) -- [ ] Disabling many of the Floating Window Manager features +- [x] Disabling many of the Floating Window Manager features - [ ] Handle exclusion zones - [ ] Handle output creation, updating, and deletion -- [ ] ## Tiling Advanced + Initial Shell (Due: February 1st) Version: 0.2 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000..881230a5 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,101 @@ +name: miracle-wm +adopt-info: miracle-wm +summary: "miracle-wm: a tiling window manager built on Mir" +description: | + miracle-wm is a tiling window manager based off the Mir library. + + It is intended to provide an i3/sway-like experience. +confinement: classic +base: core22 + +architectures: + - build-on: amd64 + - build-on: arm64 + - build-on: armhf + +package-repositories: + - type: apt + ppa: mir-team/release + +apps: + miracle-wm: + command: &_command usr/local/bin/miracle-wm + environment: &_environment + # Prep for Mir + MIR_SERVER_PLATFORM_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/mir/server-platform + __EGL_VENDOR_LIBRARY_DIRS: $SNAP/etc/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d + LIBGL_DRIVERS_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri + LIBINPUT_QUIRKS_DIR: ${SNAP}/usr/share/libinput + PATH: ${SNAP}/usr/local/bin/:${PATH} + # For "reasons" this is being set despite this being a classic snap. This overwrites the nonsense + LD_LIBRARY_PATH: "" + +parts: + miracle-wm: + build-attributes: + - enable-patchelf + override-pull: | + craftctl default + # work around https://github.com/diddlesnaps/snapcraft-multiarch-action/issues/22 + git config --global --add safe.directory ${CRAFT_PART_SRC} + server_version=`git rev-list --count HEAD` + mir_version=`LANG=C apt-cache policy mir-graphics-drivers-desktop | sed -rne 's/^\s+Candidate:\s+([^-]*)-.+$/\1/p'` + craftctl set version=$server_version-mir$mir_version + if echo $mir_version | grep -e '+dev' -e '~rc' -q; then craftctl set grade=devel; else craftctl set grade=stable; fi + plugin: cmake + source: . + build-packages: + - pkg-config + - libmiral-dev + - libboost-filesystem-dev + - libfreetype6-dev + - libwayland-dev + - libxkbcommon-dev + - g++ + - make + stage-packages: + - libmiral6 + - mir-graphics-drivers-desktop + - libfreetype6 + prime: + - -lib/udev + - -usr/doc + - -usr/doc-base + - -usr/share/applications + - -usr/share/apport + - -usr/share/bug + - -usr/share/doc + - -usr/share/doc-base + - -usr/share/icons + - -usr/share/libdrm + - -usr/share/libwacom + - -usr/share/lintian + - -usr/share/man + - -usr/share/pkgconfig + + mesa-patchelf: + build-attributes: + - enable-patchelf + plugin: nil + stage-packages: + - libgl1-mesa-dri + - libtinfo5 + # included in this part because it tries to pull in mesa bits + - gvncviewer + - swaybg + - synapse + - xvfb + - xwayland + stage: + # The libraries in .../dri need no-patchelf, so they come from the mesa-unpatched part + - -usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri + + mesa-no-patchelf: + plugin: nil + stage-packages: + - libgl1-mesa-dri + build-attributes: + - no-patchelf # Otherwise snapcraft may strip the build ID and cause the driver to crash + stage: + # Only the libraries in .../dri need to not be patched, the rest come from the mesa part + - usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri