diff --git a/.nixignore b/.nixignore new file mode 100644 index 0000000000..367fb8dafd --- /dev/null +++ b/.nixignore @@ -0,0 +1,12 @@ +*.nix +.clang-format +.git* +.nixignore +.vscode +appveyor.yml +ChangeLog.txt +ci +codecov.yml +CONTRIBUTING.md +INSTALL.txt +README.md diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000..6d8feb17f3 --- /dev/null +++ b/default.nix @@ -0,0 +1,87 @@ +# TODO: +# visp> In file included from /nix/store/g6lpg2p890jn3hkv63jjkk2f7k66y6hk-ogre-14.2.5/include/OGRE/Ogre.h:52, +# visp> from /build/source/modules/ar/include/visp3/ar/vpAROgre.h:66: +# visp> /nix/store/g6lpg2p890jn3hkv63jjkk2f7k66y6hk-ogre-14.2.5/include/OGRE/OgreConfigFile.h:94:41: note: declared here +# visp> 94 | OGRE_DEPRECATED SectionIterator getSectionIterator(void); +# visp> | ^~~~~~~~~~~~~~~~~~ +# visp> /build/source/modules/ar/src/ogre-simulator/vpAROgre.cpp:315:33: error: no matching function for call to 'Ogre::Root::showConfigDialog()' +# visp> 315 | if (!mRoot->showConfigDialog()) { +# visp> | ~~~~~~~~~~~~~~~~~~~~~~~^~ +{ + cmake, + coin3d, + doxygen, + eigen, + #fetchFromGitHub, + lapack, + lib, + libdc1394, + libdmtx, + libglvnd, + libpng, + libxml2, + libX11, + nix-gitignore, + nlohmann_json, + #ogre, + openblas, + opencv, + python3, + stdenv, + texliveSmall, + v4l-utils, + xorg, + zbar, + zlib, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "visp"; + version = "3.6.0"; + + /* + src = fetchFromGitHub { + owner = "lagadic"; + repo = "visp"; + rev = "v${finalAttrs.version}"; + hash = "sha256-m5Tmr+cZab7eSjmbXb8HpJpFHb0UYFTyimY+CkfBIAo="; + }; + */ + src = nix-gitignore.gitignoreSource [ ./.nixignore ] ./.; + + nativeBuildInputs = [ + cmake + doxygen + texliveSmall + ]; + + doCheck = true; + + buildInputs = [ + coin3d + eigen + lapack + libdmtx + libxml2 + libdc1394 + libX11 + libglvnd + libpng + nlohmann_json + #ogre + openblas + opencv + (python3.withPackages (p: [ p.numpy ])) + v4l-utils + xorg.libpthreadstubs + zbar + zlib + ]; + + meta = { + description = "Open Source Visual Servoing Platform"; + homepage = "https://visp.inria.fr"; + license = lib.licenses.gpl2Plus; + maintainers = [ lib.maintainers.nim65s ]; + }; +}) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..444ac0938c --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716715802, + "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..c0b98db211 --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "Open Source Visual Servoing Platform"; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = + { flake-utils, nixpkgs, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + visp = pkgs.callPackage ./default.nix { }; + in + { + packages.default = visp; + } + ); +}