From 2b64ba422ee97d376bbb98009b1d9be7ee886b81 Mon Sep 17 00:00:00 2001 From: Allan CORNET Date: Tue, 31 Dec 2024 17:40:00 +0100 Subject: [PATCH] chore(nixos) update package after review and advices (#1315) --- default.nix | 76 +++-------------------------------------------------- nelson.nix | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) create mode 100644 nelson.nix diff --git a/default.nix b/default.nix index 03a5d39548..e1c1b0d819 100644 --- a/default.nix +++ b/default.nix @@ -1,72 +1,4 @@ -{ pkgs ? import {} }: - -pkgs.stdenv.mkDerivation { -name = "nelson"; -version = "master"; - -# Source URL for the Nelson source code -src = pkgs.fetchFromGitHub { -owner = "nelson-lang"; -repo = "nelson"; -rev = "master"; -sha256 = "sha256-DbmwDShdBjQXtpXjJ2QyApYxt7g7P13ap1uN3L0MPPc="; # Replace with the actual checksum -}; - -buildInputs = [ -]; - -nativeBuildInputs = [ -pkgs.gcc # C++ compiler -pkgs.cmake # Build system -pkgs.gnumake # Make utility -pkgs.zlib # Compression library -pkgs.boost # Boost libraries -pkgs.openssl # SSL support -pkgs.gfortran # Fortran compiler (if needed for certain modules) -pkgs.eigen # Eigen library -pkgs.mpi # MPI support -pkgs.hdf5 # HDF5 support -pkgs.curl # cURL support -pkgs.libgit2 # Git support -pkgs.libsndfile # Sound file support -pkgs.portaudio # PortAudio support -pkgs.lapack # LAPACK support -pkgs.openblas # OpenBLAS support -pkgs.libjack2 # JACK support -pkgs.taglib # TagLib support -pkgs.alsa-oss # ALSA support -pkgs.alsa-lib # ALSA support -pkgs.matio # MATIO support -pkgs.libcxx # C++ standard library -pkgs.pkg-config # pkg-config for detecting dependencies -pkgs.qt5.full # Qt for GUI support -pkgs.qt5.wrapQtAppsHook # Wrapper for Qt applications -]; - -buildPhase = '' -cmake . -DLGPL_ONLY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$out -cmake --build . -- -j $(nproc) -''; - -installPhase = '' -make install -''; - -# Wrap the application with Qt environment variables -postInstall = '' -wrapQtApp $out/bin/nelson -''; - -checkPhase = '' -''; - -doCheck = false; - -meta = { -description = "Nelson programming language"; -homepage = "https://github.com/nelson-lang/nelson"; -license = pkgs.lib.licenses.lgpl3Plus; -maintainers = with pkgs.lib.maintainers; [ Nelson-numerical-software ]; -}; - -} \ No newline at end of file +{ + pkgs ? import { }, +}: +pkgs.callPackage ./nelson.nix { } diff --git a/nelson.nix b/nelson.nix new file mode 100644 index 0000000000..da90b56e3a --- /dev/null +++ b/nelson.nix @@ -0,0 +1,67 @@ +{ + pkgs ? import { }, +}: + +pkgs.stdenv.mkDerivation { + name = "nelson"; + version = "master"; + + # Source URL for the Nelson source code + src = pkgs.fetchFromGitHub { + owner = "nelson-lang"; + repo = "nelson"; + rev = "master"; + sha256 = "sha256-V6DERgNNv2dUal6lkbu/OtFpJoFKdMRW6HLOQJBZbWk="; # Replace with the actual checksum + }; + + buildInputs = [ + pkgs.zlib # Compression library + pkgs.boost # Boost libraries + pkgs.openssl # SSL support + pkgs.mpi # MPI support + pkgs.hdf5 # HDF5 support + pkgs.curl # cURL support + pkgs.libgit2 # Git support + pkgs.libsndfile # Sound file support + pkgs.portaudio # PortAudio support + pkgs.lapack # LAPACK support + pkgs.openblas # OpenBLAS support + pkgs.libjack2 # JACK support + pkgs.taglib # TagLib support + pkgs.alsa-oss # ALSA support + pkgs.alsa-lib # ALSA support + pkgs.matio # MATIO support + pkgs.libcxx # C++ standard library + pkgs.qt5.full # Qt for GUI support + pkgs.qt5.wrapQtAppsHook # Wrapper for Qt applications + ]; + + nativeBuildInputs = [ + pkgs.cmake # Build system + pkgs.gnumake # Make utility + pkgs.gfortran # Fortran compiler (if needed for certain modules) + pkgs.eigen # Eigen library + pkgs.pkg-config # pkg-config for detecting dependencies + ]; + + cmakeFlags = [ + "-DLGPL_ONLY=ON" + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=$out" + ]; + + # Wrap the application with Qt environment variables + postInstall = '' + wrapQtApp $out/bin/nelson + ''; + + doCheck = false; + + meta = { + description = "Nelson programming language"; + homepage = "https://github.com/nelson-lang/nelson"; + license = pkgs.lib.licenses.lgpl3Plus; + maintainers = with pkgs.lib.maintainers; [ ]; + }; + +}