Skip to content

Commit

Permalink
miracle-wm: 0.4.0 -> 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 committed Jan 22, 2025
1 parent 9ab2bf3 commit 49a2869
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions pkgs/by-name/mi/miracle-wm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
nixosTests,
boost,
cmake,
coreutils,
dbus,
glib,
glm,
gtest,
Expand All @@ -16,29 +18,31 @@
libuuid,
libxkbcommon,
libgbm,
makeWrapper,
mir,
nlohmann_json,
pcre2,
pkg-config,
systemd,
wayland,
yaml-cpp,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "miracle-wm";
version = "0.4.0";
version = "0.4.1";

src = fetchFromGitHub {
owner = "miracle-wm-org";
repo = "miracle-wm";
rev = "v${finalAttrs.version}";
hash = "sha256-IuYRgQm3DM6ZgsfRt37GCXC3hb1vGIrqw7WxYN+Bets=";
tag = "v${finalAttrs.version}";
hash = "sha256-LPcVLpskpmHc8EzdNqMT6BnbY8Le/BVojpXPIqy6tGI=";
};

postPatch =
''
substituteInPlace session/usr/local/share/wayland-sessions/miracle-wm.desktop.in \
--replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/miracle-wm' 'miracle-wm'
substituteInPlace CMakeLists.txt \
--replace-fail 'DESTINATION /usr/lib' 'DESTINATION ''${CMAKE_INSTALL_LIBDIR}'
''
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
substituteInPlace CMakeLists.txt \
Expand All @@ -52,6 +56,7 @@ stdenv.mkDerivation (finalAttrs: {

nativeBuildInputs = [
cmake
makeWrapper
pkg-config
];

Expand All @@ -75,6 +80,10 @@ stdenv.mkDerivation (finalAttrs: {

checkInputs = [ gtest ];

cmakeFlags = [
(lib.cmakeBool "SYSTEMD_INTEGRATION" true)
];

doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

checkPhase = ''
Expand All @@ -85,6 +94,18 @@ stdenv.mkDerivation (finalAttrs: {
runHook postCheck
'';

postFixup = ''
patchShebangs $out/libexec/miracle-wm-session-setup
wrapProgram $out/libexec/miracle-wm-session-setup \
--prefix PATH : "$out/bin:${
lib.makeBinPath [
coreutils # cat
dbus # dbus-update-activation-environment
systemd # systemctl
]
}"
'';

passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
providedSessions = [ "miracle-wm" ];
Expand Down

0 comments on commit 49a2869

Please sign in to comment.