diff --git a/pkgs/applications/science/biology/muscle/default.nix b/pkgs/applications/science/biology/muscle/default.nix index cdcf6c7b50aa..86067538b13c 100644 --- a/pkgs/applications/science/biology/muscle/default.nix +++ b/pkgs/applications/science/biology/muscle/default.nix @@ -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 ]; }; } diff --git a/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch b/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch new file mode 100644 index 000000000000..41e5fc7ae476 --- /dev/null +++ b/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch @@ -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 +