From 350b666a7332a96456b9318dbee4ea5e87b071e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arcadio=20Rubio=20Garc=C3=ADa?= Date: Sat, 28 Jun 2025 23:04:27 +0200 Subject: [PATCH] star: cleanup and enable all unix platforms --- pkgs/by-name/st/star/package.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/st/star/package.nix b/pkgs/by-name/st/star/package.nix index 43a4989962e2..9d3cb06e5a2c 100644 --- a/pkgs/by-name/st/star/package.nix +++ b/pkgs/by-name/st/star/package.nix @@ -4,6 +4,10 @@ fetchFromGitHub, xxd, zlib, + llvmPackages, + star, + testers, + nix-update-script, }: stdenv.mkDerivation rec { @@ -20,31 +24,48 @@ stdenv.mkDerivation rec { sourceRoot = "${src.name}/source"; postPatch = '' - substituteInPlace Makefile --replace "/bin/rm" "rm" + substituteInPlace Makefile --replace-fail "-std=c++11" "-std=c++14" ''; nativeBuildInputs = [ xxd ]; - buildInputs = [ zlib ]; + buildInputs = [ zlib ] ++ lib.optionals stdenv.isDarwin [ llvmPackages.openmp ]; + + enableParallelBuilding = true; + + makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "CXXFLAGS_SIMD=" ]; + + preBuild = lib.optionalString stdenv.isDarwin '' + export CXXFLAGS="$CXXFLAGS -DSHM_NORESERVE=0" + ''; buildFlags = [ "STAR" "STARlong" ]; - enableParallelBuilding = true; - installPhase = '' runHook preInstall install -D STAR STARlong -t $out/bin runHook postInstall ''; + passthru.tests.version = testers.testVersion { + package = star; + command = "STAR --version"; + }; + + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "Spliced Transcripts Alignment to a Reference"; + longDescription = '' + STAR (Spliced Transcripts Alignment to a Reference) is a fast RNA-seq + read mapper, with support for splice-junction and fusion read detection. + ''; homepage = "https://github.com/alexdobin/STAR"; license = licenses.gpl3Plus; - platforms = [ "x86_64-linux" ]; + platforms = platforms.unix; maintainers = [ maintainers.arcadio ]; }; }