Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

star: init at 2.5.3a #34156

Merged
merged 1 commit into from Jan 27, 2018
Merged

star: init at 2.5.3a #34156

merged 1 commit into from Jan 27, 2018

Conversation

arcadio
Copy link
Contributor

@arcadio arcadio commented Jan 22, 2018

Motivation for this change

Add star derivation.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


buildPhase = ''
cd source
sed 's/\/bin\/rm/rm/g' Makefile > Makefile2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into postPatch.

Copy link
Member

@rasendubi rasendubi Jan 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use another separator to avoid escaping slashes. Also, use inline sed processing to avoid extra mv.

sed 's:/bin/rm:rm/g' -i Makefile

buildInputs = [ zlib ];

buildPhase = ''
cd source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, what's the idiomatic way to do this? sourceRoot = "source/source";?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just sourceRoot = "source" should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had tried sourceRoot = "source" already, but it didn't work. I might be missing something entirely obvious as I'm migrating packages from Guix, and there are some subtle differences.

Note that STAR has a source directory, which shows up inside Nix-created source after unpacking. This is the derivation I'm using, which works fine:

{ stdenv, fetchFromGitHub, zlib }:

stdenv.mkDerivation rec {
  name = "star-${version}";
  version = "2.5.3a";

  src = fetchFromGitHub {
    repo = "STAR";
    owner = "alexdobin";
    rev = version;
    sha256 = "1fd9xl7i1zxgsxn2qf6gz8s42g2djm29qmp6qb35d8nnxh8ns54x";
  };

  sourceRoot = "source/source";
  
  postPatch = "sed 's:/bin/rm:rm:g' -i Makefile";
  
  buildInputs = [ zlib ];
  
  buildPhase = "make STAR STARlong";

  installPhase = ''
    mkdir -p $out/bin
    cp STAR STARlong $out/bin
  '';
  
  meta = with stdenv.lib; {
    description = "Spliced Transcripts Alignment to a Reference";
    homepage = https://github.com/alexdobin/STAR;
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.arc ];
  };
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright 👍

{ stdenv, fetchFromGitHub, zlib }:

stdenv.mkDerivation rec {
name = "star";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include version into the name attribute. Nix parses package version from name attribute and version one has no special meaning.


buildPhase = ''
cd source
sed 's/\/bin\/rm/rm/g' Makefile > Makefile2
Copy link
Member

@rasendubi rasendubi Jan 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use another separator to avoid escaping slashes. Also, use inline sed processing to avoid extra mv.

sed 's:/bin/rm:rm/g' -i Makefile

meta = with stdenv.lib; {
description = "Spliced Transcripts Alignment to a Reference";
homepage = https://github.com/alexdobin/STAR;
license = licenses.gpl3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be gpl3Plus.

@@ -18962,6 +18962,8 @@ with pkgs;

snpeff = callPackage ../applications/science/biology/snpeff/default.nix { };

star = callPackage ../applications/science/biology/star/default.nix { };
Copy link
Member

@rasendubi rasendubi Jan 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default.nix is default path when calling a directory—do not specify it explicitly.

star = callPackage ../applications/science/biology/star { };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Some packages in all-packages do explicitly specify this. I will try to clean them up, at least for the science section sometime.

@@ -55,6 +55,7 @@
antonxy = "Anton Schirg <anton.schirg@posteo.de>";
apeschar = "Albert Peschar <albert@peschar.net>";
apeyroux = "Alexandre Peyroux <alex@px.io>";
arc = "Arcadio Rubio García <arc@well.ox.ac.uk>";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind naming the attribute after your GitHub username arcadio?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's fine.

@arcadio
Copy link
Contributor Author

arcadio commented Jan 23, 2018

All proposed changes done. Shall I squash into one commit?

@rasendubi
Copy link
Member

Yes, squash, please.

@arcadio
Copy link
Contributor Author

arcadio commented Jan 24, 2018

@rasendubi Squashed now.

@disassembler
Copy link
Member

@GrahamcOfBorg build star

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: x86_64-linux

/nix/store/gzx9dy9zd867vm40h7pk9rg7zr70sgvc-star-2.5.3a

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure for system: x86_64-darwin

Package ‘star-2.5.3a’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/applications/science/biology/star/default.nix:28 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success for system: aarch64-linux

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a
shrinking /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a/bin/STARlong
shrinking /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a/bin/STAR
strip is /nix/store/jwz859pxqj7sl2dbwvmxkx68jp774izb-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a/bin
patching script interpreter paths in /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a
checking for references to /build in /nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a...
/nix/store/37v00rrawwwvlpxi0x1nrk98zr1yansq-star-2.5.3a

@rasendubi rasendubi merged commit 38fbc93 into NixOS:master Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants