Compare commits

...

10 Commits

Author SHA1 Message Date
Bartek Kryza
57d24da0df Reverted codecov to v3 2024-04-17 21:09:08 +02:00
Bartek Kryza
7317761670 Updated checkout GitHub action version 2024-04-17 19:57:12 +02:00
Bartek Kryza
87a1e876cc Updated codecov GitHub action version 2024-04-17 18:36:21 +02:00
Bartek Kryza
449729d54e Merge pull request #258 from hatch01/master
enable building with nix
2024-04-17 18:04:56 +02:00
eymeric
a61d719a69 doc: update build instruction for nix 2024-04-17 18:02:08 +02:00
eymeric
42c9fa4579 update build command to work without flake
Co-authored-by: uku <hi@uku.moe>
2024-04-17 09:52:38 +02:00
hatch01
0da2585c3f fix nix run link
Co-authored-by: Thomas Lepoix <thomas.lepoix@protonmail.ch>
2024-04-10 09:50:58 +02:00
eymeric
8e24a2cb63 cleanup nix
Co-authored-by: uku <hi@uku.moe>
2024-04-09 18:21:40 +02:00
eymeric
e3fd1382e9 enable building with nix 2024-04-08 22:47:59 +02:00
Bartek Kryza
31d8f4d773 Fixed MSVC build with LLVM 18 2024-03-12 23:10:22 +01:00
9 changed files with 141 additions and 2 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake .

View File

@@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Update package database
run: sudo apt -y update
- name: Install deps
@@ -51,5 +51,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: coverage-src.info
disable_search: true
name: clang-uml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

4
.gitignore vendored
View File

@@ -33,6 +33,10 @@ coverage*.info
packaging/_BUILD
packaging/conda/meta.yaml
#nix
.direnv/
result
# CLion
.idea/

View File

@@ -107,6 +107,7 @@ if(APPLE)
set(YAML_CPP_LIBRARY_DIR ${HOMEBREW_PREFIX}/lib)
endif(PKG_CONFIG_FOUND)
elseif(MSVC)
find_package(yaml-cpp REQUIRED)
set(YAML_CPP_LIBRARIES "yaml-cpp")
else()
find_package(yaml-cpp REQUIRED)

View File

@@ -81,6 +81,11 @@ else(LINK_LLVM_SHARED)
if(${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "16.0")
list(APPEND LIBTOOLING_LIBS clangASTMatchers)
endif()
if(MSVC)
if(${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "18.1")
list(APPEND LIBTOOLING_LIBS clangAPINotes)
endif()
endif(MSVC)
endif(LINK_LLVM_SHARED)
if("${LIBTOOLING_LIBS}" STREQUAL "")

View File

@@ -53,6 +53,23 @@ conda config --set channel_priority strict
conda install -c bkryza/label/clang-uml clang-uml
```
#### nix
```bash
git clone https://github.com/bkryza/clang-uml
# To build using nix flakes
nix --extra-experimental-features 'nix-command flakes' build
# or without nix flakes
nix-build -E 'with import <nixpkgs> { }; callPackage ./packaging/nix { }'
```
Or if you have flake enabled, you can also directly run
```bash
nix run github:bkryza/clang-uml
```
#### Windows
Download and run the latest Windows installer from

45
flake.lock generated Normal file
View File

@@ -0,0 +1,45 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1712163089,
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
"path": "/nix/store/n2g5cqwv8qf5p6vjxny6pg3blbdij12k-source",
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

34
flake.nix Normal file
View File

@@ -0,0 +1,34 @@
{
description = "C++ UML diagram generator based on Clang";
inputs = {
nixpkgs.url = "nixpkgs";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs = {flake-parts, ...} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
self',
pkgs,
...
}: {
packages = {
default = self'.packages.clang-uml;
clang-uml = pkgs.callPackage ./packaging/nix {};
};
devShells.default = pkgs.mkShell {
inputsFrom = [self'.packages.clang-uml];
};
formatter = pkgs.alejandra;
};
};
}

30
packaging/nix/default.nix Normal file
View File

@@ -0,0 +1,30 @@
{
stdenv,
cmake,
pkg-config,
installShellFiles,
libclang,
libllvm,
yaml-cpp,
}:
stdenv.mkDerivation {
name = "clang-uml";
src = ../..;
nativeBuildInputs = [
cmake
pkg-config
installShellFiles
];
buildInputs = [
libclang
libllvm
yaml-cpp
];
postInstall = ''
installShellCompletion --bash $src/packaging/autocomplete/clang-uml
installShellCompletion --zsh $src/packaging/autocomplete/_clang-uml
'';
}