diff --git a/.github/workflows/test-snap-can-build.yml b/.github/workflows/test-snap-can-build.yml new file mode 100644 index 0000000000..3e6d948af8 --- /dev/null +++ b/.github/workflows/test-snap-can-build.yml @@ -0,0 +1,25 @@ +name: 🧪 Snap Builds + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: snapcore/action-build@v1 + id: build + + - uses: diddlesnaps/snapcraft-review-action@v1 + with: + snap: ${{ steps.build.outputs.snap }} + isClassic: 'false' + # Plugs and Slots declarations to override default denial (requires store assertion to publish) + #plugs: ./plug-declaration.json + #slots: ./slot-declaration.json diff --git a/README.md b/README.md index 3670cede53..4b3032717e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,18 @@ webpage for a list of **[All Supported Installations](https://fpm.fortran-lang.o The easiest installation routes are shown below. +### [Snap](https://snapcraft.io/fortran-fpm) + +[![fortran-fpm](https://snapcraft.io/fortran-fpm/badge.svg)](https://snapcraft.io/fortran-fpm) + +[![🧪 Snap Builds](https://github.com/kz6fittycent/fpm/actions/workflows/test-snap-can-build.yml/badge.svg?branch=main)](https://github.com/kz6fittycent/fpm/actions/workflows/test-snap-can-build.yml) + +**Note:** Linux only + +``` +sudo snap install fortran-fpm +``` + ### [Binary](https://github.com/fortran-lang/fpm/releases) Binaries for the latest stable release are available [to download](https://github.com/fortran-lang/fpm/releases/latest) for Windows, MacOS, and Linux. diff --git a/snap/local/fpm.png b/snap/local/fpm.png new file mode 100644 index 0000000000..1ab82e3923 Binary files /dev/null and b/snap/local/fpm.png differ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000000..742698c3fc --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,73 @@ +name: fortran-fpm +adopt-info: fortran-fpm +summary: Fortran Package Manager +description: | + Fortran Package Manager (fpm) is a package manager and build system for Fortran. + Its key goal is to improve the user experience of Fortran programmers. + It does so by making it easier to build your Fortran program or library, + run the executables, tests, and examples, and distribute it as a dependency + to other Fortran projects. Fpm's user interface is modeled after Rust's Cargo, + so if you're familiar with that tool, you will feel at home with fpm. + Fpm's long term vision is to nurture and grow the ecosystem of modern Fortran + applications and libraries. + + Fpm is an early prototype and is evolving rapidly. You can use it to build and + package your Fortran projects, as well as to use existing fpm packages as dependencies. + Fpm's behavior and user interface may change as it evolves, however as fpm matures + and we enter production, we will aim to stay backwards compatible. Please follow + the issues to contribute and/or stay up to date with the development. + Before opening a bug report or a feature suggestion, please read our Contributor Guide. + You can also discuss your ideas and queries with the community in fpm discussions, + or more broadly on Fortran-Lang Discourse. + + Fortran Package Manager is not to be confused with Jordan Sissel's fpm, a more general, + non-Fortran related package manager. + + Website: https://fpm.fortran-lang.org/ + +license: MIT +source-code: https://github.com/fortran-lang/fpm +issues: https://github.com/kz6fittycent/fpm/issues +contact: https://github.com/kz6fittycent/fpm +icon: snap/local/fpm.png + +base: core24 +grade: stable +confinement: strict +compression: lzo + +platforms: + amd64: + build-on: [amd64] + build-for: [amd64] + +apps: + fortran-fpm: + command: usr/bin/fpm + plugs: + - home + +parts: + fortran-fpm: + source: https://github.com/fortran-lang/fpm + source-type: git + plugin: dump + build-packages: + - wget + - curl + + override-build: | + #VARS + ################################ + LATEST=$(curl -s https://api.github.com/repos/fortran-lang/fpm/releases/latest | grep '"tag_name":' | cut -d ":" -f2 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^v//') + ################################ + + mkdir -p $CRAFT_PART_INSTALL/usr/bin/ + cd $CRAFT_PART_INSTALL/usr/bin/ + wget -O fpm "https://github.com/fortran-lang/fpm/releases/download/v${LATEST}/fpm-${LATEST}-linux-x86_64" + chmod a+x fpm + + override-pull: | + craftctl default + craftctl set version="$(curl -s https://api.github.com/repos/fortran-lang/fpm/releases/latest | grep '"tag_name":' | cut -d ":" -f2 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^v//')" +