nix derivations seem easy except for the part where i can't figure out why this cmake include from a submodule ain't working

fussing about nixos and cmake, responses welcome 

i'm trying to set up a derivation for
github.com/Xaymar/obs-StreamFX

in a package array (obs plugins in home manager, this is inside my larger system nix config, shouldn't matter between this and systemPackages), i have:

(pkgs.callPackage ./internal-stuff/obs/streamfx.nix {})

the contents of streamfx.nix is

{
fetchFromGitHub, stdenv, obs-studio, cmake, lib, qtbase ? qt6.qtbase, qt6, ffmpeg }: stdenv.mkDerivation rec {
pname = "obs-streamfx";
version = "0.12.0b164";

src = fetchFromGitHub {
owner = "Xaymar";
repo = "obs-StreamFX";
rev = version;
sha256 = "0lf99y636pp0w0swwrg960z1gpl7v9r8vfyinbajnwrcaawcfnsj";
fetchSubmodules = true;
};

#patches = [
# ./streamfx-cmake.patch
#];

cmakeFlags = [
"-DSTRUCTURE_PACKAGEMANAGER=ON"
"-DDOWNLOAD_QT=OFF"
"-DVERSION=${version}"
"-DENABLE_UPDATER=OFF"
];

nativeBuildInputs = [ cmake ];
buildInputs = [ obs-studio qtbase ffmpeg ];
dontWrapQtApps = true;

meta.broken = lib.versionOlder obs-studio.version "28";
}

the error i'm getting out of this, per nix log:

@nix { "action": "setPhase", "phase": "qtPreHook" }
qtPreHook
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/71g0iqn2nvz2rbkr0sdp1hvgdd0lmvhq-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/share/doc/obs-streamfx -DCMAKE_INSTALL_INFODIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/include -DCMAKE_INSTALL_SBINDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0/bin/ranlib -DCMAKE_AR=/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/sgdiwz4w55bnccxpywn71nmlah55zshv-obs-streamfx-0.12.0b164 -DSTRUCTURE_PACKAGEMANAGER=ON -DDOWNLOAD_QT=OFF -DVERSION=0.12.0b164 -DENABLE_UPDATER=OFF
CMake Error at CMakeLists.txt:49 (include):
include could not find requested file:

version


-- [StreamFX] This is a standalone build, please make sure you've followed the instructions.
CMake Error at CMakeLists.txt:83 (version):
Unknown CMake command "version".


-- Configuring incomplete, errors occurred!

#nixOS

edit to note:

the relevant section of cmakelists.txt is:

# Search Paths
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/version"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)

# Include
include("util") # CacheClear, CacheSet
include("version") # version()
include("CheckIPOSupported") # check_ipo_supported

the cmake/version directory of the git repo exists in a submodule, but fetchSubmodules is true (it was false for a bit but i've tried it both ways to the same result, so i think i'm just still not getting the submodules??)

re: fussing about nixos and cmake, responses welcome 

gonna try fetchgit instead of fetchfromgithub just in case it works

re: fussing about nixos and cmake, responses welcome 

fetchgit is named fetchgit in the docs but is fetchGit in nix

and this gives me
error: unsupported Git input attribute 'sha256'

re: fussing about nixos and cmake, responses welcome 

cackling little gremlin noises

i try to ls the output of the whole thing and cmake/version/ is EMPTY

it is NOT fetching the submodules correctly

i was RIGHT

re: fussing about nixos and cmake, responses welcome 

NEW ERROR!!! woooo!!!

re: fussing about nixos and cmake, responses welcome 

my mistake was

nix prefetch git gave me a sha256 hash based on no submodules

this... meant that... fsr instead of fetching submodules as per fetchSubmodules = true and then erroring when the hashes didn't match

it just chose to fetch no submodules ANYWAY so that the hash matched????

Follow

re: fussing about nixos and cmake, responses welcome 

@manifold lmao

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.