muscle: compile with GCC for Darwin

This revision updates pkgs.muscle to compile with GCC (gccStdenv instead
of stdenv). This works around issues with OpenMP in the Darwin version
of LLVM.

The upstream Makefile assumes that we're compiling with Homebrew or
similar and uses g++-11 instead of g++, so this revision also introduces
a patch to remove this behavior, allowing the package to compile on
Darwin without issue.
This commit is contained in:
Alex Hamilton
2024-06-21 11:16:11 -04:00
parent 930b24aeec
commit 609f8e0590
2 changed files with 34 additions and 9 deletions
@@ -1,10 +1,9 @@
{ lib, stdenv, fetchFromGitHub }:
{ lib, gccStdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "muscle";
gccStdenv.mkDerivation rec {
pname = "muscle";
version = "5.1.0";
src = fetchFromGitHub {
owner = "rcedgar";
repo = pname;
@@ -14,15 +13,26 @@ stdenv.mkDerivation rec {
sourceRoot = "${src.name}/src";
installPhase = ''
install -m755 -D Linux/muscle $out/bin/muscle
'';
patches = [
./muscle-darwin-g++.patch
];
installPhase =
let
target =
if gccStdenv.isDarwin
then "Darwin"
else "Linux";
in
''
install -m755 -D ${target}/muscle $out/bin/muscle
'';
meta = with lib; {
description = "Multiple sequence alignment with top benchmark scores scalable to thousands of sequences";
mainProgram = "muscle";
license = licenses.gpl3Plus;
homepage = "https://www.drive5.com/muscle/";
license = licenses.gpl3Plus;
homepage = "https://www.drive5.com/muscle/";
maintainers = with maintainers; [ unode thyol ];
};
}
@@ -0,0 +1,15 @@
diff --git a/Makefile b/Makefile
index df16673..be3bd0d 100644
--- a/Makefile
+++ b/Makefile
@@ -20,9 +20,6 @@ OS := $(shell uname)
CPPFLAGS := $(CPPFLAGS) -DNDEBUG -pthread
CXX := g++
-ifeq ($(OS),Darwin)
- CXX := g++-11
-endif
CXXFLAGS := $(CXXFLAGS) -O3 -fopenmp -ffast-math