-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[workflow][Nix] initial packaging & flake #5059
base: master
Are you sure you want to change the base?
Changes from all commits
a993b27
86913f6
e51daca
1708b79
a03a458
6c3bfb7
bd261b5
6489fd1
f9cfcd0
8808d24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "CI - Nix" | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
nix: | ||
runs-on: "${{ matrix.os }}-latest" | ||
strategy: | ||
matrix: | ||
os: [ubuntu, macos] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v27 | ||
# TODO: the "sofa" account on cachix does not exist yet | ||
#- uses: cachix/cachix-action@v15 | ||
#with: | ||
#name: sofa | ||
#authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: nix build -L |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
description = "Real-time multi-physics simulation with an emphasis on medical simulation."; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hugtalbot you may want to suggest another description here |
||
|
||
inputs = { | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
# ref. https://github.com/NixOS/nixpkgs/pull/348549 | ||
nixpkgs.url = "github:nim65s/nixpkgs/qt6-libqglviewer"; | ||
}; | ||
|
||
outputs = | ||
inputs@{ flake-parts, nixpkgs, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = nixpkgs.lib.systems.flakeExposed; | ||
perSystem = | ||
{ pkgs, self', ... }: | ||
{ | ||
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; | ||
packages = { | ||
default = self'.packages.sofa; | ||
sofa = pkgs.callPackage ./package.nix { }; | ||
}; | ||
}; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
boost, | ||
cmake, | ||
cxxopts, | ||
eigen, | ||
#fetchFromGitHub, | ||
glew, | ||
gtest, | ||
lib, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is "Nixpkgs lib", ref. https://github.com/NixOS/nixpkgs/blob/master/lib/README.md |
||
qt6Packages, | ||
libGL, | ||
metis, | ||
stdenv, | ||
tinyxml-2, | ||
zlib, | ||
}: | ||
|
||
stdenv.mkDerivation { | ||
pname = "sofa"; | ||
version = "24.06.00"; | ||
|
||
src = lib.fileset.toSource { | ||
root = ./.; | ||
fileset = lib.fileset.unions [ | ||
./applications | ||
./Authors.txt | ||
./cmake | ||
./CHANGELOG.md | ||
./CMakeLists.txt | ||
./CMakePresets.json | ||
./examples | ||
./extlibs | ||
./LICENSE-LGPL.md | ||
./package.cmake | ||
./README.md | ||
./scripts | ||
./share | ||
./Sofa | ||
./tools | ||
]; | ||
}; | ||
|
||
propagatedNativeBuildInputs = [ | ||
cmake | ||
qt6Packages.wrapQtAppsHook | ||
]; | ||
propagatedBuildInputs = [ | ||
boost | ||
cxxopts | ||
eigen | ||
glew | ||
gtest | ||
qt6Packages.libqglviewer | ||
qt6Packages.qtbase | ||
libGL | ||
metis | ||
tinyxml-2 | ||
zlib | ||
]; | ||
|
||
cmakeFlags = [ | ||
(lib.cmakeBool "SOFA_ALLOW_FETCH_DEPENDENCIES" false) | ||
]; | ||
|
||
doCheck = true; | ||
|
||
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' | ||
install_name_tool -change \ | ||
$out/lib/libSceneChecking.24.12.99.dylib \ | ||
$out/plugins/SceneChecking/lib/libSceneChecking.24.12.99.dylib \ | ||
$out/bin/.runSofa-24.12.99-wrapped | ||
''; | ||
|
||
meta = { | ||
description = "Real-time multi-physics simulation with an emphasis on medical simulation"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
homepage = "https://github.com/sofa-framework/sofa"; | ||
license = lib.licenses.lgpl21Only; | ||
maintainers = with lib.maintainers; [ nim65s ]; | ||
mainProgram = "runSofa"; | ||
platforms = lib.platforms.unix ++ lib.platforms.windows; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not very familiar with Qt components. Can you give more details on the changes here? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with those neither, but as a matter of fact, the
Qt6GuiToolsConfig.cmake
file does not define aQt6::GuiTools
CMake target. Therefore we can not rely on the presence of aQt6::GuiTools
CMake target to know how should we defineSOFA_GUI_QT_HAVE_QT6
.But I don't know why we are looking for those CMake targets to define if
SOFA_GUI_QT_HAVE_QT6
or not. My guess is thatQt6_FOUND
should be enough.