from spack import *
from glob import glob
import os

class Nextflow(Package):
    """Data-driven computational pipelines"""

    homepage = "http://www.nextflow.io"

    version('0.20.1', '0e4e0e3eca1c2c97f9b4bffd944b923a',
            url='https://github.com/nextflow-io/nextflow/releases/download/v0.20.1/nextflow',
            expand=False)

    depends_on('jdk')

    def unpack(self):
        pass

    def install(self, spec, prefix):
        chmod = which('chmod')

        mkdirp(prefix.bin)
        install("nextflow", join_path(prefix.bin, "nextflow"))
        chmod('+x', join_path(prefix.bin, "nextflow"))

from spack import *


class Nextflow(Package):
    """Data-driven computational pipelines"""

    homepage = "http://www.nextflow.io"

    version('0.20.1', '0e4e0e3eca1c2c97f9b4bffd944b923a',
            url='https://github.com/nextflow-io/nextflow/releases/download/v0.20.1/nextflow',
            expand=False)

    depends_on('jdk')

    def unpack(self):
        pass

    def install(self, spec, prefix):
        mkdirp(prefix.bin)
        install("nextflow", join_path(prefix.bin, "nextflow"))
        set_executable( join_path(prefix.bin, "nextflow"))

Add standard header, use spack helpers
Add standard header, use spack helpers

Added the standard header (stolen from R).

Touched up the install to use set_executable rather than doing it
myself.

  from spack import *
+ 
- from glob import glob
- import os
  
  class Nextflow(Package):
      """Data-driven computational pipelines"""
  
      homepage = "http://www.nextflow.io"
  
      version('0.20.1', '0e4e0e3eca1c2c97f9b4bffd944b923a',
              url='https://github.com/nextflow-io/nextflow/releases/download/v0.20.1/nextflow',
              expand=False)
  
      depends_on('jdk')
  
      def unpack(self):
          pass
  
      def install(self, spec, prefix):
-         chmod = which('chmod')
- 
          mkdirp(prefix.bin)
          install("nextflow", join_path(prefix.bin, "nextflow"))
-         chmod('+x', join_path(prefix.bin, "nextflow"))
+         set_executable( join_path(prefix.bin, "nextflow"))
  
Add standard header, use spack helpers
## Code Before:
from spack import *
from glob import glob
import os

class Nextflow(Package):
    """Data-driven computational pipelines"""

    homepage = "http://www.nextflow.io"

    version('0.20.1', '0e4e0e3eca1c2c97f9b4bffd944b923a',
            url='https://github.com/nextflow-io/nextflow/releases/download/v0.20.1/nextflow',
            expand=False)

    depends_on('jdk')

    def unpack(self):
        pass

    def install(self, spec, prefix):
        chmod = which('chmod')

        mkdirp(prefix.bin)
        install("nextflow", join_path(prefix.bin, "nextflow"))
        chmod('+x', join_path(prefix.bin, "nextflow"))

## Instruction:
Add standard header, use spack helpers
## Code After:
from spack import *


class Nextflow(Package):
    """Data-driven computational pipelines"""

    homepage = "http://www.nextflow.io"

    version('0.20.1', '0e4e0e3eca1c2c97f9b4bffd944b923a',
            url='https://github.com/nextflow-io/nextflow/releases/download/v0.20.1/nextflow',
            expand=False)

    depends_on('jdk')

    def unpack(self):
        pass

    def install(self, spec, prefix):
        mkdirp(prefix.bin)
        install("nextflow", join_path(prefix.bin, "nextflow"))
        set_executable( join_path(prefix.bin, "nextflow"))
