From 28168c26fdcbd6b506594f191ce361110c24ec46 Mon Sep 17 00:00:00 2001 From: Parthasarathy Tirumalai Date: Fri, 12 May 2023 11:30:21 +0200 Subject: Add support for MacOS homebrew install test. --- .gitlab-ci.yml | 21 ++++++++++++++++++-- crystfel.rb | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 crystfel.rb diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de20bd92..5a79064b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - test + - test_brew - build_container build-meson: @@ -79,13 +80,15 @@ build_container_image_tag: rules: - if: $CI_COMMIT_TAG -build-macos: +build-native-macos: tags: - macOS variables: GIT_STRATEGY: clone script: - - brew install gsl hdf5 flex bison argp-standalone pkg-config doxygen gtk+3 cairo pango gdk-pixbuf fftw meson python-tk + - brew update + - brew upgrade + - brew install gsl hdf5 flex bison argp-standalone pkg-config doxygen gtk+3 cairo pango gdk-pixbuf fftw meson ninja python python-tk - export PATH="$(brew --prefix)/opt/bison/bin:$(brew --prefix)/opt/flex/bin:$PATH" - export LDFLAGS="-L$(brew --prefix)/opt/bison/lib -L$(brew --prefix)/opt/flex/lib -L$(brew --prefix)/opt/argp-standalone/lib -largp $LDFLAGS" - export CFLAGS="-I$(brew --prefix)/opt/flex/include -I$(brew --prefix)/opt/argp-standalone/include/ $CFLAGS" @@ -93,3 +96,17 @@ build-macos: - ninja -C build - ninja -C build test +build-brew-macos: + stage: test_brew + tags: + - macOS + variables: + GIT_STRATEGY: clone + script: + - brew update + - brew upgrade + - brew install gsl hdf5 flex bison argp-standalone pkg-config doxygen gtk+3 cairo pango gdk-pixbuf fftw meson ninja python python-tk + - brew uninstall -v -f crystfel + - brew install -v -s ./crystfel.rb --HEAD + - brew uninstall -v -f crystfel + diff --git a/crystfel.rb b/crystfel.rb new file mode 100644 index 00000000..3123c514 --- /dev/null +++ b/crystfel.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Suite for processing Serial Femtosecond Crystallography (SFX) data +class Crystfel < Formula + desc 'Suite for processing Serial Femtosecond Crystallography (SFX) data' + homepage 'https://www.desy.de/~twhite/crystfel/index.html' + + stable do + url 'https://www.desy.de/~twhite/crystfel/crystfel-0.10.2.tar.gz' + sha256 '9c23bd9dd0ca4b9e1b54df48845062095373aa4ec1b029635c5ace9a5c7eb0fe' + end + + head do + url 'https://gitlab.desy.de/thomas.white/crystfel.git' + end + + depends_on 'bison' => :build + depends_on 'meson' => :build + depends_on 'ninja' => :build + depends_on 'pkg-config' => :build + depends_on 'argp-standalone' => :build + depends_on 'cairo' + depends_on 'fftw' + depends_on 'gdk-pixbuf' + depends_on 'gsl' + depends_on 'gtk+3' + depends_on 'hdf5' + depends_on 'libpng' + depends_on 'libtiff' + depends_on 'pango' + + def install + args = std_meson_args + if OS.mac? + args << "-Dc_args=-I/opt/argp-standalone/include" + args << "-Dc_link_args=-L/usr/local/opt/argp-standalone/lib -largp" + end + system 'meson', 'setup', *args, 'build' + system 'ninja','-C','build' + system 'ninja','-C','build','test' + system 'ninja','-C','build','install' + end + + test do + # All functionality tests are done in the above section with make test + system bin / 'ambigator', '--help' + system bin / 'cell_explorer', '--help' + system bin / 'cell_tool', '--help' + system bin / 'check_hkl', '--help' + system bin / 'compare_hkl', '--help' + system bin / 'crystfel', '--help' + system bin / 'detector-shift', '--help' + system bin / 'get_hkl', '--help' + system bin / 'indexamajig', '--help' + system bin / 'list_events', '--help' + system bin / 'make_pixelmap', '--help' + system bin / 'partialator', '--help' + system bin / 'peakogram-stream', '--help' + system bin / 'process_hkl', '--help' + system bin / 'render_hkl', '--help' + system bin / 'whirligig', '--help' + end +end -- cgit v1.2.3