diff --git a/pkgs/applications/science/biology/febio-studio/default.nix b/pkgs/applications/science/biology/febio-studio/default.nix new file mode 100644 index 000000000000..e334637f243c --- /dev/null +++ b/pkgs/applications/science/biology/febio-studio/default.nix @@ -0,0 +1,61 @@ +{ lib, stdenv, fetchFromGitHub, cmake, zlib, libglvnd, libGLU, wrapQtAppsHook +, sshSupport ? true, openssl, libssh +, tetgenSupport ? true, tetgen +, ffmpegSupport ? true, ffmpeg +, dicomSupport ? false, dcmtk +, withModelRepo ? true +, withCadFeatures ? false +}: + +stdenv.mkDerivation rec { + pname = "febio-studio"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "febiosoftware"; + repo = "FEBioStudio"; + rev = "v${version}"; + sha256 = "0r6pg49i0q9idp7pjymj7mlxd63qjvmfvg0l7fmx87y1yd2hfw4h"; + }; + + patches = [ + ./febio-studio-cmake.patch # Fix Errors that appear with certain Cmake flags + ]; + + cmakeFlags = [ + "-DQt_Ver=5" + "-DNOT_FIRST=On" + "-DOpenGL_GL_PREFERENCE=GLVND" + ] + ++ lib.optional sshSupport "-DUSE_SSH=On" + ++ lib.optional tetgenSupport "-DUSE_TETGEN=On" + ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On" + ++ lib.optional dicomSupport "-DUSE_DICOM=On" + ++ lib.optional withModelRepo "-DMODEL_REPO=On" + ++ lib.optional withCadFeatures "-DCAD_FEATURES=On" + ; + + + installPhase = '' + runHook preInstall + mkdir -p $out/ + cp -R bin $out/ + runHook postInstall + ''; + + nativeBuildInputs = [ cmake wrapQtAppsHook ]; + buildInputs = [ zlib libglvnd libGLU openssl libssh ] + ++ lib.optional sshSupport openssl + ++ lib.optional tetgenSupport tetgen + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional dicomSupport dcmtk + ; + + meta = with lib; { + description = "FEBio Suite Solver"; + license = with licenses; [ mit ]; + homepage = "https://febio.org/"; + platforms = platforms.unix; + maintainers = with maintainers; [ Scriptkiddi ]; + }; +} diff --git a/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch b/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch new file mode 100644 index 000000000000..e694f6c3b89f --- /dev/null +++ b/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/FEBioStudio/RepositoryPanel.cpp b/FEBioStudio/RepositoryPanel.cpp +index 382db303..314cdc68 100644 +--- a/FEBioStudio/RepositoryPanel.cpp ++++ b/FEBioStudio/RepositoryPanel.cpp +@@ -1364,10 +1364,10 @@ void CRepositoryPanel::loadingPageProgress(qint64 bytesSent, qint64 bytesTotal) + + #else + +-CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QWidget* parent){} ++CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QDockWidget* parent){} + CRepositoryPanel::~CRepositoryPanel(){} + void CRepositoryPanel::OpenLink(const QString& link) {} +-// void CRepositoryPanel::Raise() {} ++void CRepositoryPanel::Raise() {} + void CRepositoryPanel::SetModelList(){} + void CRepositoryPanel::ShowMessage(QString message) {} + void CRepositoryPanel::ShowWelcomeMessage(QByteArray messages) {} +@@ -1396,6 +1396,7 @@ void CRepositoryPanel::on_actionSearch_triggered() {} + void CRepositoryPanel::on_actionClearSearch_triggered() {} + void CRepositoryPanel::on_actionDeleteRemote_triggered() {} + void CRepositoryPanel::on_actionModify_triggered() {} ++void CRepositoryPanel::on_actionCopyPermalink_triggered() {} + void CRepositoryPanel::on_treeWidget_itemSelectionChanged() {} + void CRepositoryPanel::on_treeWidget_customContextMenuRequested(const QPoint &pos) {} + void CRepositoryPanel::DownloadItem(CustomTreeWidgetItem *item) {} +diff --git a/FEBioStudio/WzdUpload.cpp b/FEBioStudio/WzdUpload.cpp +index 5ce74346..20062e06 100644 +--- a/FEBioStudio/WzdUpload.cpp ++++ b/FEBioStudio/WzdUpload.cpp +@@ -1183,7 +1183,7 @@ void CWzdUpload::on_saveJson_triggered() + getProjectJson(&projectInfo); + + QFile file(filedlg.selectedFiles()[0]); +- file.open(QIODeviceBase::WriteOnly); ++ file.open(QIODevice::WriteOnly); + file.write(projectInfo); + file.close(); + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 14985ac2e313..a4538d4fc257 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31892,6 +31892,8 @@ with pkgs; fastp = callPackage ../applications/science/biology/fastp { }; + febio-studio = libsForQt5.callPackage ../applications/science/biology/febio-studio { }; + hisat2 = callPackage ../applications/science/biology/hisat2 { }; htslib = callPackage ../development/libraries/science/biology/htslib { };