nix fuckery

This commit is contained in:
raf 2024-10-11 21:05:14 +03:00
commit 017aadcf35
Signed by: NotAShelf
GPG key ID: AF26552424E53993
7 changed files with 159 additions and 79 deletions

View file

@ -0,0 +1,64 @@
{
self,
sdl3, # from self.packages
lib,
fetchurl,
cmake,
ninja,
llvmPackages_19,
...
}: let
pname = "gooey";
version = "0.0.1";
in
llvmPackages_19.libcxxStdenv.mkDerivation {
inherit pname version;
src = builtins.path {
# reproducible source path
path = self;
name = "${pname}-${version}";
};
enableParallelBuilding = true;
strictDeps = true;
nativeBuildInputs = [
ninja
(cmake.overrideAttrs {
version = "3.30.4";
src = let
cmake-version = "3.30.4";
in
fetchurl {
url = "https://cmake.org/files/v${lib.versions.majorMinor cmake-version}/cmake-${cmake-version}.tar.gz";
hash = "sha256-x1nJcnTx56qq/LHw0mH53pvzpdbst+LfYWMkpG/nBLI=";
};
})
];
buildInputs = [
sdl3
llvmPackages_19.clang-tools
];
configurePhase = ''
runHook preConfigure
cmake -GNinja .
runHook postConfiguree
'';
buildPhase = ''
runHook preBuild
ninja
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv gooey $out/bin
runHook postInstall
'';
}