1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,6 +35,7 @@ packaging/conda/meta.yaml
|
|||||||
|
|
||||||
#nix
|
#nix
|
||||||
.direnv/
|
.direnv/
|
||||||
|
result
|
||||||
|
|
||||||
# CLion
|
# CLion
|
||||||
|
|
||||||
|
|||||||
39
flake.lock
generated
39
flake.lock
generated
@@ -2,7 +2,9 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712014858,
|
"lastModified": 1712014858,
|
||||||
@@ -20,36 +22,15 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712512205,
|
"lastModified": 1712163089,
|
||||||
"narHash": "sha256-CrKKps0h7FoagRcE2LT3h/72Z64D0Oh83UF1XZVhCLQ=",
|
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
|
||||||
"owner": "NixOS",
|
"path": "/nix/store/n2g5cqwv8qf5p6vjxny6pg3blbdij12k-source",
|
||||||
"repo": "nixpkgs",
|
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
|
||||||
"rev": "3c1b6f75344e207a67536d834886ee9b4577ebe7",
|
"type": "path"
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"id": "nixpkgs",
|
||||||
"ref": "nixpkgs-unstable",
|
"type": "indirect"
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"dir": "lib",
|
|
||||||
"lastModified": 1711703276,
|
|
||||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"dir": "lib",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|||||||
39
flake.nix
39
flake.nix
@@ -1,33 +1,34 @@
|
|||||||
{
|
{
|
||||||
description = "Description for the project";
|
description = "C++ UML diagram generator based on Clang";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
nixpkgs.url = "nixpkgs";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
||||||
|
flake-parts = {
|
||||||
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ flake-parts, ... }:
|
outputs = {flake-parts, ...} @ inputs:
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
imports = [];
|
|
||||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
|
||||||
|
|
||||||
packages.default = config.packages.clang-uml;
|
perSystem = {
|
||||||
packages.clang-uml = pkgs.callPackage packaging/nix/default.nix { };
|
self',
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
packages = {
|
||||||
|
default = self'.packages.clang-uml;
|
||||||
|
clang-uml = pkgs.callPackage ./packaging/nix {};
|
||||||
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
inputsFrom = [self'.packages.clang-uml];
|
||||||
# C++ Compiler is already part of stdenv
|
|
||||||
cmake
|
|
||||||
llvmPackages_latest.libllvm
|
|
||||||
yaml-cpp
|
|
||||||
ccache
|
|
||||||
elfutils
|
|
||||||
pkg-config
|
|
||||||
clang
|
|
||||||
libclang
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,30 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} }:
|
{
|
||||||
|
stdenv,
|
||||||
|
cmake,
|
||||||
# Nix derivation for basic C++ project using clang
|
pkg-config,
|
||||||
with pkgs; stdenv.mkDerivation {
|
installShellFiles,
|
||||||
|
libclang,
|
||||||
|
libllvm,
|
||||||
|
yaml-cpp,
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
name = "clang-uml";
|
name = "clang-uml";
|
||||||
src = ../..;
|
src = ../..;
|
||||||
|
|
||||||
buildInputs = [
|
nativeBuildInputs = [
|
||||||
clang
|
|
||||||
libclang
|
|
||||||
cmake
|
cmake
|
||||||
llvmPackages_latest.libllvm
|
|
||||||
yaml-cpp
|
|
||||||
ccache
|
|
||||||
elfutils
|
|
||||||
pkg-config
|
pkg-config
|
||||||
|
installShellFiles
|
||||||
];
|
];
|
||||||
|
|
||||||
dontUseCmakeConfigure = true;
|
buildInputs = [
|
||||||
|
libclang
|
||||||
|
libllvm
|
||||||
|
yaml-cpp
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = "CCACHE_DIR=/build/.ccache make release";
|
postInstall = ''
|
||||||
|
installShellCompletion --bash $src/packaging/autocomplete/clang-uml
|
||||||
installPhase = ''
|
installShellCompletion --zsh $src/packaging/autocomplete/_clang-uml
|
||||||
mkdir -p $out/bin
|
|
||||||
cp release/src/clang-uml $out/bin/clang-uml
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = "
|
|
||||||
installShellCompletion --cmd clang-uml \
|
|
||||||
--zsh packaging/autocomplete/_clang-uml
|
|
||||||
--bach packaging/autocomplete/clang-uml
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user