Advertisement
Guest User

Reverting hyprland-0.43.0 to C++23

a guest
Sep 24th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index d8424d9..9fabba1 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -64,7 +64,7 @@ else()
  6. endif()
  7.  
  8. include_directories(. "src/" "subprojects/udis86/" "protocols/")
  9. -set(CMAKE_CXX_STANDARD 26)
  10. +set(CMAKE_CXX_STANDARD 23)
  11. add_compile_options(
  12. -Wall
  13. -Wextra
  14. diff --git a/flake.nix b/flake.nix
  15. index 9e1e3ab..9c20b3f 100644
  16. --- a/flake.nix
  17. +++ b/flake.nix
  18. @@ -95,7 +95,7 @@
  19. devShells = eachSystem (system: {
  20. default =
  21. pkgsFor.${system}.mkShell.override {
  22. - stdenv = pkgsFor.${system}.gcc14Stdenv;
  23. + stdenv = pkgsFor.${system}.gcc13Stdenv;
  24. } {
  25. name = "hyprland-shell";
  26. nativeBuildInputs = with pkgsFor.${system}; [
  27. diff --git a/meson.build b/meson.build
  28. index 9a30f31..075139f 100644
  29. --- a/meson.build
  30. +++ b/meson.build
  31. @@ -6,7 +6,7 @@ project('Hyprland', 'cpp', 'c',
  32. 'optimization=3',
  33. 'buildtype=release',
  34. 'debug=false',
  35. - 'cpp_std=c++26',
  36. + 'cpp_std=c++23',
  37. ])
  38.  
  39. datarootdir = '-DDATAROOTDIR="' + get_option('prefix') / get_option('datadir') + '"'
  40. diff --git a/nix/default.nix b/nix/default.nix
  41. index 1c6a011..d7f1087 100644
  42. --- a/nix/default.nix
  43. +++ b/nix/default.nix
  44. @@ -61,11 +61,6 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
  45. src = lib.cleanSource ../.;
  46. };
  47.  
  48. - patches = [
  49. - # forces GCC to use -std=c++26
  50. - ./stdcxx.patch
  51. - ];
  52. -
  53. postPatch = ''
  54. # Fix hardcoded paths to /usr installation
  55. sed -i "s#/usr#$out#" src/render/OpenGL.cpp
  56. diff --git a/nix/overlays.nix b/nix/overlays.nix
  57. index d6e078f..d231518 100644
  58. --- a/nix/overlays.nix
  59. +++ b/nix/overlays.nix
  60. @@ -31,7 +31,7 @@ in {
  61. date = mkDate (self.lastModifiedDate or "19700101");
  62. in {
  63. hyprland = final.callPackage ./default.nix {
  64. - stdenv = final.gcc14Stdenv;
  65. + stdenv = final.gcc13Stdenv;
  66. version = "${version}+date=${date}_${self.shortRev or "dirty"}";
  67. commit = self.rev or "";
  68. revCount = self.sourceInfo.revCount or "";
  69. diff --git a/nix/stdcxx.patch b/nix/stdcxx.patch
  70. deleted file mode 100644
  71. index 032e494..0000000
  72. --- a/nix/stdcxx.patch
  73. +++ /dev/null
  74. @@ -1,12 +0,0 @@
  75. -diff --git a/CMakeLists.txt b/CMakeLists.txt
  76. -index cfbd431f..73e8e0c2 100644
  77. ---- a/CMakeLists.txt
  78. -+++ b/CMakeLists.txt
  79. -@@ -64,6 +64,7 @@ endif()
  80. - include_directories(. "src/" "subprojects/udis86/" "protocols/")
  81. - set(CMAKE_CXX_STANDARD 26)
  82. - add_compile_options(
  83. -+ -std=c++26
  84. - -Wall
  85. - -Wextra
  86. - -Wno-unused-parameter
  87. diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp
  88. index a4c5b08..0def77c 100644
  89. --- a/src/debug/Log.cpp
  90. +++ b/src/debug/Log.cpp
  91. @@ -5,13 +5,10 @@
  92.  
  93. #include <fstream>
  94. #include <iostream>
  95. -#include <fcntl.h>
  96.  
  97. void Debug::init(const std::string& IS) {
  98. logFile = IS + (ISDEBUG ? "/hyprlandd.log" : "/hyprland.log");
  99. logOfs.open(logFile, std::ios::out | std::ios::app);
  100. - auto handle = logOfs.native_handle();
  101. - fcntl(handle, F_SETFD, FD_CLOEXEC);
  102. }
  103.  
  104. void Debug::close() {
  105.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement