Read monado rev from file

This commit is contained in:
Sapphire
2025-05-21 20:52:40 +02:00
committed by xytovl
parent ac3003ef54
commit aa86ee7212
5 changed files with 8 additions and 14 deletions
+1 -1
View File
@@ -474,7 +474,7 @@ jobs:
- name: Download monado
run: |
MONADO_COMMIT=$(grep -zo "FetchContent_Declare(monado[^)]*)" wivrn/CMakeLists.txt | sed -ze "s/^.*GIT_TAG *\([^ )]*\).*$/\1/" | tr -d '\0')
MONADO_COMMIT=$(cat wivrn/monado-rev)
wget https://gitlab.freedesktop.org/monado/monado/-/archive/$MONADO_COMMIT/monado-$MONADO_COMMIT.tar.gz
mkdir wivrn/monado-src
+2 -1
View File
@@ -284,11 +284,12 @@ FetchContent_Declare(uni-algo EXCLUDE_FROM_ALL SYSTEM URL https://github.co
URL_HASH SHA256=f2a1539cd8635bc6088d05144a73ecfe7b4d74ee0361fabed6f87f9f19e74ca9)
file(GLOB MONADO_PATCHES CONFIGURE_DEPENDS patches/monado/*)
file(READ monado-rev MONADO_REV)
# Server dependencies
FetchContent_Declare(monado
GIT_REPOSITORY https://gitlab.freedesktop.org/monado/monado
# The flatpak manifest is updated automatically
GIT_TAG 2a6932d46dad9aa957205e8a47ec2baa33041076
GIT_TAG ${MONADO_REV}
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${MONADO_PATCHES}
EXCLUDE_FROM_ALL
)
+3 -11
View File
@@ -22,17 +22,8 @@
version = "next";
# Because src is just a folder path and not a set from a fetcher, it doesn't need to be unpacked, so having a postUnpack throws an error.
# We also don't need the check since we read the revision from the monado-rev file.
postUnpack = null;
prePatch = ''
ourMonadoRev="${finalAttrs.monado.src.rev}"
theirMonadoRev=$(sed -n '/FetchContent_Declare(monado/,/)/p' CMakeLists.txt | grep "GIT_TAG" | awk '{print $2}')
if [ ! "$theirMonadoRev" == "$ourMonadoRev" ]; then
echo "Our Monado source revision doesn't match CMakeLists.txt." >&2
echo " theirs: $theirMonadoRev" >&2
echo " ours: $ourMonadoRev" >&2
return 1
fi
'';
monado = pkgs.applyPatches {
inherit (oldAttrs.monado) patches postPatch;
@@ -40,7 +31,8 @@
inherit (oldAttrs.monado.src) owner repo;
domain = "gitlab.freedesktop.org";
# Keep in sync with CMakeLists.txt monado rev
rev = "2a6932d46dad9aa957205e8a47ec2baa33041076";
rev = builtins.readFile ./monado-rev;
# Nix will output the correct hash when it doesn't match
hash = "sha256-Bus9GTNC4+nOSwN8pUsMaFsiXjlpHYioQfBLxbQEF+0=";
};
};
+1
View File
@@ -0,0 +1 @@
2a6932d46dad9aa957205e8a47ec2baa33041076
+1 -1
View File
@@ -58,7 +58,7 @@ if __name__ == "__main__":
json.dump(gen_src, f, indent=4, sort_keys=False)
monado_commit = cmake.get("monado", "GIT_TAG")
monado_commit = open(os.path.join(root, "monado-rev")).read()
boostpfr_url = cmake.get("boostpfr", "URL")
boostpfr_sha256 = cmake.get("boostpfr", "URL_HASH").split("=")[-1]