packages.mirism: init

This commit is contained in:
陈浩南 2024-10-20 00:09:25 +08:00
parent a0fd36d690
commit eb886c0c6e
5 changed files with 37 additions and 0 deletions

View File

@ -38,4 +38,10 @@
packages = [ clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
mirism = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.mirism ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
}

View File

@ -103,6 +103,7 @@ inputs: rec
py4vasp = inputs.pkgs.callPackage ./py4vasp.nix { src = inputs.topInputs.py4vasp; };
pocketfft = inputs.pkgs.callPackage ./pocketfft.nix { src = inputs.topInputs.pocketfft; };
spectroscopy = inputs.pkgs.callPackage ./spectroscopy.nix { src = inputs.topInputs.spectroscopy; };
mirism = inputs.pkgs.callPackage ./mirism.nix { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}

1
packages/mirism/.envrc Normal file
View File

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

View File

@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.14)
project(mirism VERSION 0.0.0 LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
find_package(biu REQUIRED)
add_executable(mirism src/main.cpp)
target_compile_features(mirism PUBLIC cxx_std_23)
target_link_libraries(mirism PRIVATE biu::biu)
install(TARGETS mirism RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")

View File

@ -0,0 +1,7 @@
{ stdenv, cmake, pkg-config, biu }: stdenv.mkDerivation
{
name = "mirism";
src = ./.;
buildInputs = [ biu ];
nativeBuildInputs = [ cmake pkg-config ];
}