api docs: Use mkMesonDerivation

This commit is contained in:
Robert Hensing 2024-07-06 17:41:05 +02:00
parent b7e5446b81
commit 4d0c55ae55
2 changed files with 37 additions and 45 deletions

View file

@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation
, meson
, ninja
@ -14,27 +14,27 @@ let
inherit (lib) fileset;
in
stdenv.mkDerivation (finalAttrs: {
mkMesonDerivation (finalAttrs: {
pname = "nix-external-api-docs";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ../..;
fileset =
let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "h");
in
fileset.unions [
./meson.build
./doxygen.cfg.in
./README.md
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../libexpr-c)
(cpp ../libstore-c)
(cpp ../libutil-c)
];
};
workDir = ./.;
fileset =
let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "h");
in
fileset.unions [
./.version
../../.version
./meson.build
./doxygen.cfg.in
./README.md
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../libexpr-c)
(cpp ../libstore-c)
(cpp ../libutil-c)
];
nativeBuildInputs = [
meson
@ -42,14 +42,10 @@ stdenv.mkDerivation (finalAttrs: {
doxygen
];
postUnpack = ''
sourceRoot=$sourceRoot/src/external-api-docs
'';
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
''
echo ${finalAttrs.version} > .version
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''

View file

@ -1,5 +1,5 @@
{ lib
, stdenv
, mkMesonDerivation
, meson
, ninja
@ -14,22 +14,22 @@ let
inherit (lib) fileset;
in
stdenv.mkDerivation (finalAttrs: {
mkMesonDerivation (finalAttrs: {
pname = "nix-internal-api-docs";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ../..;
fileset = let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "hh");
in fileset.unions [
./meson.build
./doxygen.cfg.in
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../.)
];
};
workDir = ./.;
fileset = let
cpp = fileset.fileFilter (file: file.hasExt "cc" || file.hasExt "hh");
in fileset.unions [
./.version
../../.version
./meson.build
./doxygen.cfg.in
# Source is not compiled, but still must be available for Doxygen
# to gather comments.
(cpp ../.)
];
nativeBuildInputs = [
meson
@ -37,14 +37,10 @@ stdenv.mkDerivation (finalAttrs: {
doxygen
];
postUnpack = ''
sourceRoot=$sourceRoot/src/internal-api-docs
'';
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix
''
echo ${finalAttrs.version} > .version
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''