-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a5af2a
commit 9782af5
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ pkgs, lib, cmake, ninja, sphinx, python3Packages, ... }: | ||
|
||
pkgs.stdenv.mkDerivation { | ||
pname = "ckdl"; | ||
version = "1.0"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "tjol"; | ||
repo = "ckdl"; | ||
tag = "1.0"; | ||
hash = "sha256-qEfRZzoUQZ8umdWgx+N4msjPBbuwDtkN1kNDfZicRjY="; | ||
}; | ||
|
||
outputs = [ "bin" "dev" "lib" "doc" "out" ]; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
ninja | ||
sphinx | ||
python3Packages.furo | ||
]; | ||
|
||
cmakeFlags = [ | ||
(lib.cmakeBool "BUILD_TESTS" true) | ||
]; | ||
|
||
postPatch = '' | ||
cd doc | ||
make singlehtml | ||
mkdir -p $doc/share/doc | ||
mv _build/singlehtml $doc/share/doc/ckdl | ||
cd .. | ||
''; | ||
|
||
postInstall = '' | ||
mkdir -p $bin/bin | ||
# some tools that are important for debugging. | ||
# idk why they are not copied to bin by cmake, but I’m too tired to figure it out | ||
install src/utils/ckdl-tokenize $bin/bin | ||
install src/utils/ckdl-parse-events $bin/bin | ||
install src/utils/ckdl-cat $bin/bin | ||
touch $out | ||
''; | ||
|
||
|
||
meta = { | ||
description = "ckdl is a C (C11) library that implements reading and writing the KDL Document Language."; | ||
license = lib.licenses.mit; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |