Merge branch 'master' into 'master'

Import NMU, new upstream release, fix RC bugs

See merge request NyxTrail/hyprpaper!1
This commit is contained in:
Loong Jin Chow 2025-10-13 03:34:55 +00:00
commit e117a58ade
11 changed files with 124 additions and 40 deletions

View File

@ -10,17 +10,41 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install nix
uses: cachix/install-nix-action@v20
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v31
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
nix_conf: |
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until the Nix store size (in bytes) is at most this number
# before trying to save a new cache
# 1G = 1073741824
gc-max-store-size-linux: 1G
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: nix-${{ runner.os }}-
# created more than this number of seconds ago
purge-created: 0
# or, last accessed more than this number of seconds ago
# relative to the start of the `Post Restore and save Nix store` phase
purge-last-accessed: 0
# except any version with the key that is the same as the `primary-key`
purge-primary-key: never
- uses: cachix/cachix-action@v12
with:
name: hyprland
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build Hyprpaper with default settings
run: nix build --print-build-logs --accept-flake-config

View File

@ -28,7 +28,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND bash -c "git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -s 's/\#//g'"
COMMAND bash -c "git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -s 's/\#//g; s/^[[:space:]]*//'"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_MESSAGE
OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -54,7 +54,7 @@ pkg_check_modules(
REQUIRED
IMPORTED_TARGET
wayland-client
wayland-protocols
wayland-protocols>=1.35
cairo
pango
pangocairo
@ -107,11 +107,12 @@ protocolnew("stable/xdg-shell" "xdg-shell" false)
protocolnew("staging/cursor-shape" "cursor-shape-v1" false)
protocolnew("stable/tablet" "tablet-v2" false)
string(REPLACE "\"" " " GIT_COMMIT_MESSAGE_ESCAPED "${GIT_COMMIT_MESSAGE}")
target_compile_definitions(hyprpaper
PRIVATE "-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
target_compile_definitions(hyprpaper PRIVATE "-DGIT_BRANCH=\"${GIT_BRANCH}\"")
target_compile_definitions(
hyprpaper PRIVATE "-DGIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE}\"")
target_compile_definitions(hyprpaper
PRIVATE "-DGIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE_ESCAPED}\"")
target_compile_definitions(hyprpaper PRIVATE "-DGIT_DIRTY=\"${GIT_DIRTY}\"")
target_link_libraries(hyprpaper rt)
@ -142,4 +143,4 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
include(GNUInstallDirs)
install(TARGETS hyprpaper)
install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprpaper.service DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/user)
install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprpaper.service DESTINATION "lib/systemd/user")

View File

@ -1 +1 @@
0.7.4
0.7.6

22
debian/changelog vendored
View File

@ -1,15 +1,31 @@
hyprpaper (0.7.4-1) unstable; urgency=medium
hyprpaper (0.7.6-0.1) unstable; urgency=medium
* New upstream version 0.7.4
* Non-maintainer upload
* New upstream release 0.7.6 (Closes: #1106522)
- Also fixes FTBFS with cmake 4 (Closes: #1112999)
* Switch libjpeg64-turbo-dev build-dep to libjpeg-dev (Closes: #1090808)
-- Chow Loong Jin <hyperair@debian.org> Mon, 13 Oct 2025 11:17:06 +0800
hyprpaper (0.7.4-1) UNRELEASED; urgency=medium
* New upstream version 0.7.4
-- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 02 Mar 2025 10:32:11 +0000
hyprpaper (0.7.1-1) unstable; urgency=medium
hyprpaper (0.7.1-1) UNRELEASED; urgency=medium
* New upstream version 0.7.1
-- Alan M Varghese (NyxTrail) <alan@digistorm.in> Sun, 22 Sep 2024 09:37:04 +0000
hyprpaper (0.7.0-1.1) unstable; urgency=medium
* Non-maintainer upload.
* Upgrade to wlroots-0.18. Closes: #1092436
-- Bastian Germann <bage@debian.org> Thu, 17 Apr 2025 16:35:16 +0200
hyprpaper (0.7.0-1) unstable; urgency=low
* Initial release. Closes: #1065699

4
debian/control vendored
View File

@ -10,12 +10,12 @@ Build-Depends: cmake,
libhyprlang-dev,
libhyprgraphics-dev (>= 0.1.1),
libhyprutils-dev (>= 0.2.2),
libjpeg62-turbo-dev,
libjpeg-dev,
libmagic-dev,
libpango1.0-dev,
libwayland-dev,
libwebp-dev,
libwlroots-dev,
libwlroots-0.18-dev,
ninja-build,
pandoc
Standards-Version: 4.7.0

View File

@ -1,4 +0,0 @@
#
# ### gbp-buildpackage(1) user may like this. ###
#abort-on-upstream-changes
#unapply-patches

View File

@ -13,11 +13,11 @@
]
},
"locked": {
"lastModified": 1737634889,
"narHash": "sha256-9JZE3KxcXOqZH9zs3UeadngDiK/yIACTiAR8HSA/TNI=",
"lastModified": 1750621377,
"narHash": "sha256-8u6b5oAdX0rCuoR8wFenajBRmI+mzbpNig6hSCuWUzE=",
"owner": "hyprwm",
"repo": "hyprgraphics",
"rev": "0d77b4895ad5f1bb3b0ee43103a5246c58b65591",
"rev": "b3d628d01693fb9bb0a6690cd4e7b80abda04310",
"type": "github"
},
"original": {
@ -39,11 +39,11 @@
]
},
"locked": {
"lastModified": 1737634606,
"narHash": "sha256-W7W87Cv6wqZ9PHegI6rH1+ve3zJPiyevMFf0/HwdbCQ=",
"lastModified": 1750371198,
"narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "f41271d35cc0f370d300413d756c2677f386af9d",
"rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b",
"type": "github"
},
"original": {
@ -62,11 +62,11 @@
]
},
"locked": {
"lastModified": 1737632363,
"narHash": "sha256-X9I8POSlHxBVjD0fiX1O2j7U9Zi1+4rIkrsyHP0uHXY=",
"lastModified": 1750371096,
"narHash": "sha256-JB1IeJ41y7kWc/dPGV6RMcCUM0Xj2NEK26A2Ap7EM9c=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "006620eb29d54ea9086538891404c78563d1bae1",
"rev": "38f3a211657ce82a1123bf19402199b67a410f08",
"type": "github"
},
"original": {
@ -85,11 +85,11 @@
]
},
"locked": {
"lastModified": 1735493474,
"narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=",
"lastModified": 1750371869,
"narHash": "sha256-lGk4gLjgZQ/rndUkzmPYcgbHr8gKU5u71vyrjnwfpB4=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b",
"rev": "aa38edd6e3e277ae6a97ea83a69261a5c3aab9fd",
"type": "github"
},
"original": {
@ -100,11 +100,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1737469691,
"narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=",
"lastModified": 1750365781,
"narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab",
"rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54",
"type": "github"
},
"original": {

View File

@ -62,7 +62,7 @@
inputs.hyprwayland-scanner.overlays.default
(final: prev: rec {
hyprpaper = final.callPackage ./nix/default.nix {
stdenv = final.gcc14Stdenv;
stdenv = final.gcc15Stdenv;
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
commit = self.rev or "";
};

View File

@ -3,8 +3,22 @@
#include <fstream>
#include <signal.h>
#include <sys/types.h>
#include <malloc.h>
#include <unistd.h>
CHyprpaper::CHyprpaper() = default;
static void setMallocThreshold() {
#ifdef M_TRIM_THRESHOLD
// The default is 128 pages,
// which is very large and can lead to a lot of memory used for no reason
// because trimming hasn't happened
static const int PAGESIZE = sysconf(_SC_PAGESIZE);
mallopt(M_TRIM_THRESHOLD, 6 * PAGESIZE);
#endif
}
CHyprpaper::CHyprpaper() {
setMallocThreshold();
}
static void handleGlobal(CCWlRegistry* registry, uint32_t name, const char* interface, uint32_t version) {
if (strcmp(interface, wl_compositor_interface.name) == 0) {

View File

@ -176,6 +176,22 @@ static Hyprlang::CParseResult handleReload(const char* C, const char* V) {
return Hyprlang::CParseResult{};
}
static Hyprlang::CParseResult handleSource(const char* C, const char* V) {
Hyprlang::CParseResult result;
const std::string path = g_pConfigManager->absolutePath(V);
std::error_code ec;
if (!std::filesystem::exists(path, ec)) {
result.setError((ec ? ec.message() : "no such file").c_str());
return result;
}
g_pConfigManager->config->parseFile(path.c_str());
return result;
}
CConfigManager::CConfigManager() {
// Initialize the configuration
// Read file from default location
@ -195,6 +211,7 @@ CConfigManager::CConfigManager() {
config->registerHandler(&handlePreload, "preload", {.allowFlags = false});
config->registerHandler(&handleUnloadAll, "unloadAll", {.allowFlags = false});
config->registerHandler(&handleReload, "reload", {.allowFlags = false});
config->registerHandler(&handleSource, "source", {.allowFlags = false});
config->commence();
}
@ -214,7 +231,7 @@ std::string CConfigManager::getMainConfigPath() {
if (paths.first.has_value())
return paths.first.value();
else
throw std::runtime_error("Could not find config in HOME, XDG_CONFIG_HOME, XDG_CONFIG_DIRS or /etc/hypr.");
return "";
}
// trim from both ends
@ -227,3 +244,18 @@ std::string CConfigManager::trimPath(std::string path) {
size_t pathEndIndex = path.find_last_not_of(" \t\r\n");
return path.substr(pathStartIndex, pathEndIndex - pathStartIndex + 1);
}
std::string CConfigManager::absolutePath(const std::string& path) {
if (path.empty())
return "";
std::string result = path;
if (result[0] == '~') {
const char* home = getenv("HOME");
if (home)
result = std::string(home) + result.substr(1);
}
return std::filesystem::absolute(result).string();
}

View File

@ -13,6 +13,7 @@ class CConfigManager {
std::deque<std::string> m_dRequestedPreloads;
std::string getMainConfigPath();
std::string trimPath(std::string path);
std::string absolutePath(const std::string& path);
std::unique_ptr<Hyprlang::CConfig> config;