From 19967b67bfe1dd83c875c2435cd76e2b786e0777 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 18:07:57 +0100 Subject: [PATCH 01/15] Add a nightly/test flatpak manifest Signed-off-by: Matthew J. Milner --- ....openchemistry.Avogadro2.Molequeue.desktop | 12 - .../org.openchemistry.Avogadro2.metainfo.xml | 64 --- flatpak/org.openchemistry.Avogadro2.yaml | 423 ++++-------------- flatpak/shared-modules | 1 - 4 files changed, 83 insertions(+), 417 deletions(-) delete mode 100755 flatpak/org.openchemistry.Avogadro2.Molequeue.desktop delete mode 100644 flatpak/org.openchemistry.Avogadro2.metainfo.xml delete mode 160000 flatpak/shared-modules diff --git a/flatpak/org.openchemistry.Avogadro2.Molequeue.desktop b/flatpak/org.openchemistry.Avogadro2.Molequeue.desktop deleted file mode 100755 index 81c3ecb6..00000000 --- a/flatpak/org.openchemistry.Avogadro2.Molequeue.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=MoleQueue -GenericName=Manage computational resources -GenericName[hu]=Számítási erőforrások kezelése -Comment=Manage HPC jobs from the system tray -Comment[hu]=A nagy teljesítményű számítási feladatok kezelése a tálcán -Exec=molequeue %U -Terminal=false -Type=Application -Icon=org.openchemistry.Avogadro2.Molequeue -Categories=Qt;Science;Chemistry; diff --git a/flatpak/org.openchemistry.Avogadro2.metainfo.xml b/flatpak/org.openchemistry.Avogadro2.metainfo.xml deleted file mode 100644 index 0c717932..00000000 --- a/flatpak/org.openchemistry.Avogadro2.metainfo.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - org.openchemistry.Avogadro2 - org.openchemistry.Avogadro2.desktop - Avogadro - Free and open source molecular editor - CC0-1.0 - BSD-3-Clause - -

- Avogadro is an advanced molecular editor designed for cross-platform use in computational chemistry, - molecular modeling, bioinformatics, materials science, and related areas. It offers flexible - rendering and a powerful plugin architecture. The code in this repository is a rewrite of Avogadro - with source code split across a libraries repository and an application repository. Core features - and goals of the Avogadro project: -

-
    -
  • Open source distributed under the liberal 3-clause BSD license
  • -
  • Cross platform with nightly builds on Linux, Mac OS X and Windows
  • -
  • Intuitive interface designed to be useful to whole community
  • -
  • Fast and efficient embracing the latest technologies
  • -
  • Extensible, making extensive use of a plugin architecture
  • -
  • Flexible supporting a range of chemical data formats and packages
  • -
-
- https://two.avogadro.cc/ - https://discuss.avogadro.cc/ - https://github.com/OpenChemistry/avogadroapp/issues - Open Chemistry team - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-first-renders-i2x4-gro.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-multiwidget-hi.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-multimol-multiwidget.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-qtaim1.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-bondcentric.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-qtaim.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro-client-server.png - - - https://www.openchemistry.org/wp-content/uploads/2014/05/avogadro2-benzene.png - - - - - - - - - - -
diff --git a/flatpak/org.openchemistry.Avogadro2.yaml b/flatpak/org.openchemistry.Avogadro2.yaml index 481fdb25..f050a888 100644 --- a/flatpak/org.openchemistry.Avogadro2.yaml +++ b/flatpak/org.openchemistry.Avogadro2.yaml @@ -1,366 +1,109 @@ app-id: org.openchemistry.Avogadro2 +default-branch: nightly runtime: org.kde.Platform sdk: org.kde.Sdk -runtime-version: 5.15-21.08 +runtime-version: "6.7" command: avogadro2 -rename-desktop-file: avogadro2.desktop +appdata-license: BSD-3-Clause AND GPL-2.0-only finish-args: - - --share=ipc - # Broke in Wayland - #- --socket=wayland - - --socket=x11 - - --device=dri - - --filesystem=home - # Molequeue enjoy its life in the menu tray. - - --talk-name=org.freedesktop.Notifications - - --talk-name=org.kde.StatusNotifierWatcher - # Allow Avogadro to communicate with Molequeue. - - --share=network - - --talk-name=org.freedesktop.DBus - - --talk-name=org.freedesktop.DBus.Proprieties - - --system-talk-name=org.freedesktop.DBus - - --system-talk-name=org.freedesktop.DBus.Proprieties + - --socket=wayland + - --socket=fallback-x11 # To support X11 + - --share=ipc # Bad performance on X11 without + - --device=dri # OpenGL rendering + - --share=network # For plugin downloads cleanup: - /include - /lib/cmake - - /share/doc - '*.la' - '*.a' modules: - - shared-modules/glew/glew.json + # Needed to compile glew apparently - shared-modules/glu/glu-9.json - - name: python3-numpy - buildsystem: simple - build-commands: - - python3 -mpip install . --no-index --find-links=file://${PWD} --prefix=${FLATPAK_DEST} - --no-build-isolation - sources: - - type: archive - url: https://files.pythonhosted.org/packages/13/b1/0c22aa7ca1deda4915cdec9562f839546bb252eecf6ad596eaec0592bd35/numpy-1.23.1.tar.gz - sha256: d748ef349bfef2e1194b59da37ed5a29c19ea8d7e6342019921ba2ba4fd8b624 - x-checker-data: - type: pypi - name: numpy - - - name: Eigen3 + # Open Babel is broken without patched rapidjson + - name: rapidjson buildsystem: cmake-ninja builddir: true sources: - - type: archive - url: https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2 - sha256: b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626 - x-checker-data: - type: anitya - project-id: 13751 - stable-only: true - url-template: https://gitlab.com/libeigen/eigen/-/archive/$version/eigen-$version.tar.bz2 - cleanup: - - '*' + - type: git + url: https://github.com/Tencent/rapidjson.git + # Commit used was simply most recent at the time of writing + # Would rather use 4d6cb08189cf7336821f04090b612baa2ca6a90d (same commit as openSUSE + # Tumbleweed) as known to be good, but older commits like that don't seem to compile + commit: 7c73dd7de7c4f14379b781418c6e947ad464c818 - - name: hdf5 + - name: avogadro2 buildsystem: cmake-ninja - builddir: true - config-opts: - - -DCMAKE_BUILD_TYPE=RelWithDebInfo - - -DBUILD_TESTING:BOOL=OFF - - -DHDF5_BUILD_EXAMPLES:BOOL=OFF - cleanup: - - /share/hdf5_examples - sources: - - type: archive - url: https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_13_1.tar.gz - sha256: 92552458f35c7e58128ce1bfc2831abf901cc142ea0fdd2b056311e4452db7bf - x-checker-data: - type: anitya - project-id: 1303 - stable-only: true - url-template: https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-$version.tar.gz - - - name: libmsym - buildsystem: cmake - config-opts: - - -DCMAKE_INSTALL_PREFIX:PATH=/app - - -DMSYM_BUILD_PYTHON:BOOL=ON - - -DBUILD_SHARED_LIBS:BOOL=ON - sources: - - type: archive - url: https://github.com/mcodev31/libmsym/archive/refs/tags/v0.2.3-paper.tar.gz - sha256: 3741ebe163cf40696570d6b62e4834ca587d43dcac9de713994cc5e2960fb8fd - x-checker-data: - type: anitya - project-id: 221475 - stable-only: true - url-template: https://github.com/mcodev31/libmsym/archive/refs/tags/v$version.tar.gz - - - name: pybind11 - buildsystem: simple - build-commands: - - python3 setup.py build - - cmake -DPYBIND11_INSTALL=ON -DPYBIND11_TEST=OFF -DCMAKE_INSTALL_INCLUDEDIR:PATH=${FLATPAK_DEST}/include - -DCMAKE_INSTALL_LIBDIR:PATH=${FLATPAK_DEST}/lib -DCMAKE_INSTALL_DATAROOTDIR:PATH=${FLATPAK_DEST}/share - . - - python3 setup.py install --prefix=${FLATPAK_DEST} - - cmake --build . - - cmake --install . - sources: - - type: archive - url: https://github.com/pybind/pybind11/archive/v2.10.0.tar.gz - sha256: eacf582fa8f696227988d08cfc46121770823839fe9e301a20fbce67e7cd70ec - x-checker-data: - type: anitya - project-id: 13384 - stable-only: true - url-template: https://github.com/pybind/pybind11/archive/v$version.tar.gz - - - name: mmtf-cpp - buildsystem: cmake + builddir: true # Build outside of source tree, just like other builds + no-make-install: true # Superbuild doesn't have `install` command defined config-opts: - - -DBUILD_TESTS:BOOL=OFF - - -Dmmtf_build_local:BOOL=ON - - -Dmmtf_build_examples:BOOL=OFF - sources: - - type: archive - url: https://github.com/rcsb/mmtf-cpp/archive/refs/tags/v1.0.0.tar.gz - sha256: 881f69c4bb56605fa63fd5ca50842facc4947f686cbf678ad04930674d714f40 - x-checker-data: - type: anitya - project-id: 221487 - stable-only: true - url-template: https://github.com/rcsb/mmtf-cpp/archive/refs/tags/v$version.tar.gz - - - name: msgpack - buildsystem: cmake - config-opts: - - -DCMAKE_INSTALL_PREFIX:PATH=/app - - -DBUILD_SHARED_LIBS:BOOL=ON - - -DMSGPACK_ENABLE_STATIC:BOOL=OFF - - -DCMAKE_INSTALL_LIBDIR:PATH=lib - - -DMSGPACK_BUILD_EXAMPLES:BOOL=OFF - - -DMSGPACK_CXX11:BOOL=ON + # Match GitHub builds as much as possible, which generally means using defaults + - -DCMAKE_BUILD_TYPE=Release + - -DUSE_VTK=ON + - -DBUILD_GPL_PLUGINS=ON + - -DBUILD_MOLEQUEUE=OFF + - -DQT_VERSION=6 + - -DDOWNLOAD_TO_SOURCE_DIR=ON sources: - - type: archive + # Don't fetch any Avogadro stuff, already done as part of GitHub Actions + # This means that if using this to build the Flatpak locally, the openchemistry repo and + # its submodules must be cloned in advance of running flatpak-builder with this manifest + + # Now fetch third-party stuff where the source is expected in `openchemistry/thirdparty` + # VTK + - type: archive + url: https://www.vtk.org/files/release/9.3/VTK-9.3.0.tar.gz + sha256: fdc7b9295225b34e4fdddc49cd06e66e94260cb00efee456e0f66568c9681be9 + dest: thirdparty/VTK + + # Other third-party sources would normally be downloaded by Avogadro build on the fly + # Flatpaks aren't allowed network access during build so have to download source archives + # ahead of time to download_dir (which we've indicated using `-DDOWNLOAD_TO_SOURCE_DIR=ON`) + # Match order in projects.cmake + # glew + # (Should be able to use shared module but not picked up for whatever reason) + - type: file + url: https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz + sha256: d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1 + dest: Downloads + # Eigen3 + - type: file + url: https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz + sha256: 8586084f71f9bde545ee7fa6d00288b264a2b7ac3607b974e54d13e7162c1c72 + dest: Downloads + # OpenBabel + - type: file + url: https://github.com/openbabel/openbabel/archive/32cf131444c1555c749b356dab44fb9fe275271f.tar.gz + sha256: 7b471015df510b30057b8356f42729a35dfd1f4fa85f205c56bbaf3c64e85071 + dest: Downloads + # spglib + - type: file + url: https://github.com/spglib/spglib/archive/v2.3.1.tar.gz + sha256: c295dbea7d2fc9e50639aa14331fef277878c35f00ef0766e688bfbb7b17d44c + dest: Downloads + # libarchive + - type: file + url: https://github.com/libarchive/libarchive/archive/v3.6.2.tar.gz + sha256: 652b84588488c2ff38db8f666cd7f781163f85bff4449dcb2e16d3c734f96697 + dest: Downloads + # msgpackc + - type: file url: https://github.com/msgpack/msgpack-c/releases/download/cpp-3.3.0/msgpack-3.3.0.tar.gz sha256: 6e114d12a5ddb8cb11f669f83f32246e484a8addd0ce93f274996f1941c1f07b - x-checker-data: - type: anitya - project-id: 12278 - stable-only: true - url-template: https://github.com/msgpack/msgpack-c/releases/download/cpp-$version/msgpack-$version.tar.gz - - - name: OpenBabel - buildsystem: cmake - builddir: true - config-opts: - - -DENABLE_TESTS:BOOL=OFF - - -DBUILD_GUI:BOOL=OFF - - -DOPTIMIZE_NATIVE:BOOL=OFF - - -DOB_USE_PREBUILT_BINARIES:BOOL=OFF - - -DENABLE_VERSIONED_FORMATS:BOOL=OFF - - -DWITH_JSON:BOOL=OFF - - -DWITH_MAEPARSER:BOOL=OFF - sources: - - type: archive - url: https://github.com/openbabel/openbabel/releases/download/openbabel-3-1-1/openbabel-3.1.1-source.tar.bz2 - sha256: a6ec8381d59ea32a4b241c8b1fbd799acb52be94ab64cdbd72506fb4e2270e68 - x-checker-data: - type: anitya - project-id: 2539 - stable-only: true - url-template: https://github.com/openbabel/openbabel/releases/download/openbabel-3-1-1/openbabel-$version-source.tar.bz2 - - - name: zeromq - buildsystem: cmake-ninja - builddir: true - config-opts: - - -DCMAKE_BUILD_TYPE=Release - sources: - - type: archive - url: https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz - sha256: c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 - x-checker-data: - type: anitya - project-id: 16245 - stable-only: true - url-template: https://github.com/zeromq/libzmq/releases/download/v$version/zeromq-$version.tar.gz - - - name: spglib - buildsystem: simple - ensure-writable: - - /lib/python3/site-packages/easy-install.pth - build-commands: - - cmake -DCMAKE_INSTALL_PREFIX=${FLATPAK_DEST} -DCMAKE_INSTALL_INCLUDEDIR:PATH=${FLATPAK_DEST}/include - -DCMAKE_INSTALL_LIBDIR:PATH=${FLATPAK_DEST}/lib . - - cmake --build . - - cmake --install . - - cd python && python3 -mpip install . --no-index --find-links=file://${PWD} - --prefix=${FLATPAK_DEST} --no-build-isolation - sources: - - type: archive - url: https://github.com/spglib/spglib/archive/refs/tags/v1.16.5.tar.gz - sha256: 1bbde03b6b78da756c07f458bd90d84f3c253841b9b0632db5b72c5961e87aef - x-checker-data: - type: anitya - project-id: 14891 - stable-only: true - url-template: https://github.com/spglib/spglib/archive/refs/tags/v$version.tar.gz - - - name: MoleQueue - buildsystem: simple - build-commands: - - install -Dm0644 molequeue/app/icons/molequeue.png /app/share/icons/hicolor/32x32/apps/${FLATPAK_ID}.Molequeue.png - - cmake -DENABLE_TESTING:BOOL=OFF -DBUILD_DOCUMENTATION:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/app - -Wno-dev . - - cmake --build . - - cmake --install . - - install -Dm0644 ${FLATPAK_ID}.Molequeue.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.Molequeue.desktop - - desktop-file-validate ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.Molequeue.desktop - sources: - - type: archive - url: https://github.com/OpenChemistry/molequeue/releases/download/0.9.0/molequeue-0.9.0.tar.bz2 - sha256: 2825fa9645fca707796ad32967c307bec76dab4f6c305befeebeac8c7f7f2ef0 - x-checker-data: - type: anitya - project-id: 13839 - stable-only: true - url-template: https://github.com/OpenChemistry/molequeue/releases/download/$version/molequeue-$version.tar.bz2 + dest: Downloads + # mmtf-cpp - type: file - path: org.openchemistry.Avogadro2.Molequeue.desktop - - #- name: protobuf - #buildsystem: cmake - #subdir: cmake - #sources: - #- type: archive - #url: https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protobuf-cpp-3.15.6.tar.gz - #sha256: bbdfb7455431d7d58666e8a2996d14b236718ff238eecde10646581e4c87f168 - - #- name: protocall-OpenChemistry - #buildsystem: cmake - #sources: - #- type: git - #url: https://github.com/OpenChemistry/protocall - - # Avogadrolibs does not build with VTK 9.0.1 - # https://github.com/OpenChemistry/avogadrolibs/issues/516 - - name: VTK - buildsystem: cmake-ninja - builddir: true - build-options: - cflags: -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables - -fstack-clash-protection -flto -fno-fat-lto-objects - cxxflags: -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables - -fstack-clash-protection -flto -fno-fat-lto-objects - config-opts: - - -DBUILD_SHARED_LIBS=ON - - -DOpenGL_GL_PREFERENCE=GLVND - - -DBUILD_TESTING:BOOL=OFF - - -DVTK_GROUP_ENABLE_Qt:BOOL=YES - - -DVTK_BUILD_COMPILE_TOOLS_ONLY:BOOL=OFF - sources: - - type: archive - url: https://www.vtk.org/files/release/9.2/VTK-9.2.0.rc1.tar.gz - sha256: 3d219ae624d0ce6d72bb9bdbf5895d0eaa875ff3115a61d3c300b257ea7c0f7e - - #- name: genXrd - #buildsystem: cmake-ninja - #builddir: true - ##build-options: - ##cflags: -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables - ##-fstack-clash-protection -flto -fno-fat-lto-objects - ##cxxflags: -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables - ##-fstack-clash-protection -flto -fno-fat-lto-objects - #config-opts: - ##- -DBUILD_SHARED_LIBS=ON - ##- -DOpenGL_GL_PREFERENCE=GLVND - ##- -DBUILD_TESTING:BOOL=OFF - ##- -DVTK_GROUP_ENABLE_Qt:BOOL=YES - ##- -DVTK_BUILD_COMPILE_TOOLS_ONLY:BOOL=OFF - #sources: - #- type: archive - #url: https://github.com/psavery/genXrdPattern/archive/refs/tags/1.1-linux.tar.gz - #sha256: 9bc01dbf637d6520d8e2f5743bb1b46f8319432af5ce2d2a484a36615c1586d3 - - - name: avogadrolibs - buildsystem: cmake - builddir: true - subdir: avogadrolibs - config-opts: - - -DOpenGL_GL_PREFERENCE=GLVND - - -DUSE_SYSTEM_GENXRDPATTERN:BOOL=ON - - -DCMAKE_BUILD_TYPE:STRING=Release - - -DENABLE_TRANSLATIONS:BOOL=ON - - -DUSE_HDF5:BOOL=ON - - -DUSE_PYTHON:BOOL=ON - - -DUSE_QT:BOOL=ON - - -DUSE_LIBMSYM:BOOL=ON - - -DUSE_SPGLIB:BOOL=ON - - -DUSE_MMTF:BOOL=ON - - -DUSE_MOLEQUEUE:BOOL=ON - - -DUSE_PROTOCALL:BOOL=OFF - - -DUSE_VTK:BOOL=ON - - -DBUILD_GPL_PLUGINS:BOOL=ON - - -DBUILD_STATIC_PLUGINS:BOOL=ON - - -Dlibmsym_DIR:PATH=${FLATPAK_DEST}/lib/cmake/libmsym - - -Dpybind11_DIR:PATH=${FLATPAK_DEST}/lib/python3.8/site-packages/pybind11-2.6.2-py3.8.egg/pybind11/share/cmake/pybind11/ - sources: - - type: git - url: https://github.com/OpenChemistry/avogadrolibs - tag: 1.97.0 - commit: 82938e4f5ce188a1e53300d263167bebe717f5b2 - dest: avogadrolibs - x-checker-data: - type: git - tag-pattern: ^([\d.]+)$ - - type: archive - url: https://github.com/OpenChemistry/molecules/archive/refs/heads/master.zip - sha256: a1275e8139c2021127514abdccfb13e20b1cca0791d14459e9f50065ca566f02 - dest: molecules - dest-filename: molecules.zip - - type: archive - url: https://github.com/OpenChemistry/crystals/archive/refs/heads/master.zip - sha256: 0365aa346ccc9f77a849cd10964ebcace96621f847216546e49c386f071119e7 - dest: crystals - dest-filename: crystals.zip - #- type: file - #url: https://github.com/psavery/genXrdPattern/releases/download/1.0-static/linux64-genXrdPattern - #sha256: 5e0b8f2b463952fd16a92d70b972e4f88af8f6c00e51126a5bd6e2ab243e2ba7 - #dest: avogadrolibs/${FLATPAK_BUILDER_BUILDDIR}/bin - #dest-filename: genXrdPattern - + url: https://github.com/rcsb/mmtf-cpp/archive/refs/tags/v1.1.0.tar.gz + sha256: 021173bdc1814b1d0541c4426277d39df2b629af53151999b137e015418f76c0 + dest: Downloads + # libmsym + - type: file + url: https://github.com/mcodev31/libmsym/archive/refs/tags/v0.2.3-paper.tar.gz + sha256: 3741ebe163cf40696570d6b62e4834ca587d43dcac9de713994cc5e2960fb8fd + dest: Downloads - - name: Avogadro2 - subdir: Avogadro2 - buildsystem: cmake - config-opts: - - -DENABLE_RPATH:BOOL=ON - - -DENABLE_TESTING:BOOL=OFF - - -DBUILD_DOCUMENTATION:BOOL=OFF - - -DCMAKE_BUILD_TYPE:STRING=Release post-install: - - install -Dm644 avogadro/icons/avogadro2_64.png ${FLATPAK_DEST}/share/icons/hicolor/64x64/apps/${FLATPAK_ID}.png - - install -Dm644 avogadro/icons/avogadro2_128.png ${FLATPAK_DEST}/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png - - install -Dm644 avogadro/icons/avogadro2_256.png ${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png - - install -Dm644 avogadro/icons/avogadro2_512.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png - - desktop-file-edit --set-icon=${FLATPAK_ID} ${FLATPAK_DEST}/share/applications/avogadro2.desktop - # Remove Education category fix Avogadro2 not appearing in menu entry, no clue why. - - desktop-file-edit --remove-category=Education ${FLATPAK_DEST}/share/applications/avogadro2.desktop - - install -Dm644 ${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml - sources: - - type: archive - url: https://github.com/OpenChemistry/avogadroapp/archive/refs/tags/1.97.0.tar.gz - sha256: c4e1a0d54e43c2ae8bbd6b872e46b2f983f45c5aaa981731c681d5325faaec63 - dest: Avogadro2 - x-checker-data: - type: anitya - project-id: - stable-only: true - url-template: https://github.com/OpenChemistry/avogadroapp/archive/refs/tags/$version.tar.gz - - type: archive - url: https://github.com/OpenChemistry/avogadro-i18n/archive/refs/heads/master.zip - dest: avogadro-i18n - sha256: cb32911c83d47f6d93d7f6d9193d634b60ce114d283f2be018a064d86ff2479a - - type: file - path: org.openchemistry.Avogadro2.metainfo.xml - dest: Avogadro2 + # Manually copy contents of prefix dir over into main build dir + # -a option is recursive should preserve permissions and symlinks + - cp -a prefix/* -t ${FLATPAK_DEST}/ diff --git a/flatpak/shared-modules b/flatpak/shared-modules deleted file mode 160000 index a07b11ab..00000000 --- a/flatpak/shared-modules +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a07b11abc2155e3c664e1d09e39e98819d4541fa From 32b3aaf0b3a5457cb3f76b961cd1aa40e7868a19 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 18:08:29 +0100 Subject: [PATCH 02/15] Add a flatpak workflow for GitHub Actions Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 00000000..16f791c8 --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,66 @@ +name: Build Flatpak + +on: [push, pull_request] + +jobs: + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:kde-6.7 + options: --privileged + + steps: + - name: Checkout Flathub shared-modules + uses: actions/checkout@v4 + with: + repository: flathub/shared-modules + + - name: Checkout openchemistry + uses: actions/checkout@v4 + with: + repository: openchemistry/openchemistry + submodules: false + + - name: Checkout avogadroapp + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadroapp + path: avogadroapp + + - name: Checkout avogadrolibs + uses: actions/checkout@v4 + with: + path: avogadrolibs + + - name: Checkout i18n + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadro-i18n + path: avogadro-i18n + + - name: Checkout crystals + uses: actions/checkout@v4 + with: + repository: openchemistry/crystals + path: crystals + + - name: Checkout fragments + uses: actions/checkout@v4 + with: + repository: openchemistry/fragments + path: fragments + + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: molecules + + - name: Build with flatpak-builder + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: avogadro2.flatpak + branch: nightly + manifest-path: avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml + cache-key: flatpak-builder-${{ github.sha }} From 92dada5338f14a9ab4036d4c6d1d66bdae0f31da Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 18:14:03 +0100 Subject: [PATCH 03/15] Add avogadrogenerators Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 16f791c8..d44892b8 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -38,6 +38,12 @@ jobs: with: repository: openchemistry/avogadro-i18n path: avogadro-i18n + + - name: Checkout avogadrogenerators + uses: actions/checkout@v4 + with: + repository: openchemistry/avogenerators + path: avogadrogenerators - name: Checkout crystals uses: actions/checkout@v4 From f82629248e602e0c48653fc263df11be29a1bb41 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 18:47:04 +0100 Subject: [PATCH 04/15] Checkout shared-modules after openchemistry Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index d44892b8..4907667f 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -11,11 +11,6 @@ jobs: options: --privileged steps: - - name: Checkout Flathub shared-modules - uses: actions/checkout@v4 - with: - repository: flathub/shared-modules - - name: Checkout openchemistry uses: actions/checkout@v4 with: @@ -63,6 +58,11 @@ jobs: repository: openchemistry/molecules path: molecules + - name: Checkout Flathub shared-modules + uses: actions/checkout@v4 + with: + repository: flathub/shared-modules + - name: Build with flatpak-builder uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: From 80f596e8c1236b04142780a4a6a6b9b0111f1543 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 22:22:47 +0100 Subject: [PATCH 05/15] Checkout correctly Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 4907667f..dc4f3694 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -20,12 +20,12 @@ jobs: - name: Checkout avogadroapp uses: actions/checkout@v4 with: - repository: openchemistry/avogadroapp path: avogadroapp - name: Checkout avogadrolibs uses: actions/checkout@v4 with: + repository: openchemistry/avogadrolibs path: avogadrolibs - name: Checkout i18n @@ -62,6 +62,7 @@ jobs: uses: actions/checkout@v4 with: repository: flathub/shared-modules + path: shared-modules - name: Build with flatpak-builder uses: flatpak/flatpak-github-actions/flatpak-builder@v6 From 3c1b3b2da120817bed694ecef09b44a5b0fbd8f2 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sun, 10 Nov 2024 22:44:33 +0100 Subject: [PATCH 06/15] Move manifest into top-level before starting build Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index dc4f3694..0dc8ee17 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -64,10 +64,13 @@ jobs: repository: flathub/shared-modules path: shared-modules + - name: Move manifest + run: mv avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ + - name: Build with flatpak-builder uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: avogadro2.flatpak branch: nightly - manifest-path: avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml + manifest-path: org.openchemistry.Avogadro2.yaml cache-key: flatpak-builder-${{ github.sha }} From def9dad197d588d2bb894edb807b51a5b3ee26dd Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 11 Nov 2024 01:02:31 +0100 Subject: [PATCH 07/15] Put all source code into src and point flatpak-builder to it as a source Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 19 ++++++++++--------- flatpak/org.openchemistry.Avogadro2.yaml | 8 +++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 0dc8ee17..cee1debe 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -16,56 +16,57 @@ jobs: with: repository: openchemistry/openchemistry submodules: false + path: src - name: Checkout avogadroapp uses: actions/checkout@v4 with: - path: avogadroapp + path: src/avogadroapp - name: Checkout avogadrolibs uses: actions/checkout@v4 with: repository: openchemistry/avogadrolibs - path: avogadrolibs + path: src/avogadrolibs - name: Checkout i18n uses: actions/checkout@v4 with: repository: openchemistry/avogadro-i18n - path: avogadro-i18n + path: src/avogadro-i18n - name: Checkout avogadrogenerators uses: actions/checkout@v4 with: repository: openchemistry/avogenerators - path: avogadrogenerators + path: src/avogadrogenerators - name: Checkout crystals uses: actions/checkout@v4 with: repository: openchemistry/crystals - path: crystals + path: src/crystals - name: Checkout fragments uses: actions/checkout@v4 with: repository: openchemistry/fragments - path: fragments + path: src/fragments - name: Checkout molecules uses: actions/checkout@v4 with: repository: openchemistry/molecules - path: molecules + path: src/molecules - name: Checkout Flathub shared-modules uses: actions/checkout@v4 with: repository: flathub/shared-modules - path: shared-modules + path: src/shared-modules - name: Move manifest - run: mv avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ + run: mv src/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ - name: Build with flatpak-builder uses: flatpak/flatpak-github-actions/flatpak-builder@v6 diff --git a/flatpak/org.openchemistry.Avogadro2.yaml b/flatpak/org.openchemistry.Avogadro2.yaml index f050a888..1d9ed9d4 100644 --- a/flatpak/org.openchemistry.Avogadro2.yaml +++ b/flatpak/org.openchemistry.Avogadro2.yaml @@ -46,10 +46,12 @@ modules: - -DQT_VERSION=6 - -DDOWNLOAD_TO_SOURCE_DIR=ON sources: - # Don't fetch any Avogadro stuff, already done as part of GitHub Actions + # Avogadro stuff all already collected together as part of GitHub Actions # This means that if using this to build the Flatpak locally, the openchemistry repo and - # its submodules must be cloned in advance of running flatpak-builder with this manifest - + # its submodules must be cloned into ./src in advance of running flatpak-builder with this manifest + - type: dir + path: src + # Now fetch third-party stuff where the source is expected in `openchemistry/thirdparty` # VTK - type: archive From 052970bb2bd8737e69d8cbbb93e96935d712f102 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 11 Nov 2024 01:06:47 +0100 Subject: [PATCH 08/15] Don't put shared-modules in src Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index cee1debe..9569ac6f 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -63,7 +63,7 @@ jobs: uses: actions/checkout@v4 with: repository: flathub/shared-modules - path: src/shared-modules + path: shared-modules - name: Move manifest run: mv src/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ From e2defc79149f33f51aa082a591ab6814ee5410b2 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 11 Nov 2024 09:58:02 +0100 Subject: [PATCH 09/15] Add tmate debugging and cleanup step, turn off .flatpak-builder cache Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 9569ac6f..cc8d7ba9 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -65,6 +65,10 @@ jobs: repository: flathub/shared-modules path: shared-modules + - name: Setup tmate session + if: failure() + uses: mxschmitt/action-tmate@v3 + - name: Move manifest run: mv src/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ @@ -74,4 +78,14 @@ jobs: bundle: avogadro2.flatpak branch: nightly manifest-path: org.openchemistry.Avogadro2.yaml + cache: false cache-key: flatpak-builder-${{ github.sha }} + + - name: Cleanup + if: ${{ always() }} # To ensure this step runs even when earlier steps fail + shell: bash + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ From b39b26d30656006bfaecf6ef8eb58ff03a147977 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 11 Nov 2024 13:55:48 +0100 Subject: [PATCH 10/15] Trigger GHA after hopefully clearing runner storage Signed-off-by: Matthew J. Milner From 56f5a1823dcb52ff9ec7e2e0db51b1d81e0555a7 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Tue, 12 Nov 2024 02:25:02 +0100 Subject: [PATCH 11/15] Trigger GHA again Signed-off-by: Matthew J. Milner From b5f1e470d712b9b645cef1f0522eed3ef131302e Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Tue, 12 Nov 2024 18:56:51 +0100 Subject: [PATCH 12/15] Build manually in normal fashion rather than using pre-made action Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 43 +++++++++++++----------- flatpak/org.openchemistry.Avogadro2.yaml | 6 ++-- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index cc8d7ba9..93d3e58f 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -6,58 +6,61 @@ jobs: flatpak: name: "Flatpak" runs-on: ubuntu-latest - container: - image: bilelmoussaoui/flatpak-github-actions:kde-6.7 - options: --privileged steps: + - name: Install dependencies + run: sudo apt update -qq && sudo apt install -y -qq flatpak flatpak-builder + + - name: Configure flatpak + run: flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo + - name: Checkout openchemistry uses: actions/checkout@v4 with: repository: openchemistry/openchemistry submodules: false - path: src + path: openchemistry - name: Checkout avogadroapp uses: actions/checkout@v4 with: - path: src/avogadroapp + path: openchemistry/avogadroapp - name: Checkout avogadrolibs uses: actions/checkout@v4 with: repository: openchemistry/avogadrolibs - path: src/avogadrolibs + path: openchemistry/avogadrolibs - name: Checkout i18n uses: actions/checkout@v4 with: repository: openchemistry/avogadro-i18n - path: src/avogadro-i18n + path: openchemistry/avogadro-i18n - name: Checkout avogadrogenerators uses: actions/checkout@v4 with: repository: openchemistry/avogenerators - path: src/avogadrogenerators + path: openchemistry/avogadrogenerators - name: Checkout crystals uses: actions/checkout@v4 with: repository: openchemistry/crystals - path: src/crystals + path: openchemistry/crystals - name: Checkout fragments uses: actions/checkout@v4 with: repository: openchemistry/fragments - path: src/fragments + path: openchemistry/fragments - name: Checkout molecules uses: actions/checkout@v4 with: repository: openchemistry/molecules - path: src/molecules + path: openchemistry/molecules - name: Checkout Flathub shared-modules uses: actions/checkout@v4 @@ -65,21 +68,23 @@ jobs: repository: flathub/shared-modules path: shared-modules - - name: Setup tmate session + - name: Set up tmate session if: failure() uses: mxschmitt/action-tmate@v3 - name: Move manifest - run: mv src/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ + run: mv openchemistry/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./ - name: Build with flatpak-builder - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + run: flatpak-builder --force-clean --user --install-deps-from=flathub --arch=x86_64 --default-branch=test --repo=repo builddir org.openchemistry.Avogadro2.yaml + + - name: Create bundle + run: flatpak build-bundle repo Avogadro2.flatpak org.openchemistry.Avogadro2 + + - name: Upload bundle + uses: actions/upload-artifact@v4 with: - bundle: avogadro2.flatpak - branch: nightly - manifest-path: org.openchemistry.Avogadro2.yaml - cache: false - cache-key: flatpak-builder-${{ github.sha }} + path: Avogadro2.flatpak - name: Cleanup if: ${{ always() }} # To ensure this step runs even when earlier steps fail diff --git a/flatpak/org.openchemistry.Avogadro2.yaml b/flatpak/org.openchemistry.Avogadro2.yaml index 1d9ed9d4..ef1ee5d8 100644 --- a/flatpak/org.openchemistry.Avogadro2.yaml +++ b/flatpak/org.openchemistry.Avogadro2.yaml @@ -1,5 +1,4 @@ app-id: org.openchemistry.Avogadro2 -default-branch: nightly runtime: org.kde.Platform sdk: org.kde.Sdk runtime-version: "6.7" @@ -48,9 +47,10 @@ modules: sources: # Avogadro stuff all already collected together as part of GitHub Actions # This means that if using this to build the Flatpak locally, the openchemistry repo and - # its submodules must be cloned into ./src in advance of running flatpak-builder with this manifest + # its submodules must be cloned into ./openchemistry in advance of running flatpak-builder + # with this manifest - type: dir - path: src + path: openchemistry # Now fetch third-party stuff where the source is expected in `openchemistry/thirdparty` # VTK From 230e726d4cdfea3023df8bb911228dc15bb086c0 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Tue, 12 Nov 2024 23:54:07 +0100 Subject: [PATCH 13/15] Update spglib and libarchive versions Signed-off-by: Matthew J. Milner --- flatpak/org.openchemistry.Avogadro2.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flatpak/org.openchemistry.Avogadro2.yaml b/flatpak/org.openchemistry.Avogadro2.yaml index ef1ee5d8..5e13f4f0 100644 --- a/flatpak/org.openchemistry.Avogadro2.yaml +++ b/flatpak/org.openchemistry.Avogadro2.yaml @@ -81,13 +81,13 @@ modules: dest: Downloads # spglib - type: file - url: https://github.com/spglib/spglib/archive/v2.3.1.tar.gz - sha256: c295dbea7d2fc9e50639aa14331fef277878c35f00ef0766e688bfbb7b17d44c + url: https://github.com/spglib/spglib/archive/v2.5.0.tar.gz + sha256: b6026f5e85106c0c9ee57e54b9399890d0f29982e20e96ede0428b3efbe6b914 dest: Downloads # libarchive - type: file - url: https://github.com/libarchive/libarchive/archive/v3.6.2.tar.gz - sha256: 652b84588488c2ff38db8f666cd7f781163f85bff4449dcb2e16d3c734f96697 + url: https://github.com/libarchive/libarchive/archive/v3.7.7.tar.gz + sha256: fa62384995e8aa4f5a901c184fb5c91e56a29e24c05b6881a7f8fd5bbea694d2 dest: Downloads # msgpackc - type: file From d5334d0aa9c1df4ea892aaa5876fbb2652fac144 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Wed, 13 Nov 2024 00:10:49 +0100 Subject: [PATCH 14/15] Workaround for git's issue with cloning submodules Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 93d3e58f..c829a862 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -14,6 +14,11 @@ jobs: - name: Configure flatpak run: flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo + - name: Configure git + run: git config --global protocol.file.allow always + # Have to do this because for a while git's handling of submodules was broken + # See https://github.com/flatpak/flatpak-builder/issues/495 + - name: Checkout openchemistry uses: actions/checkout@v4 with: From 2c56246105ef179f693aa1aed095d648b2b75c1f Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Wed, 13 Nov 2024 02:31:11 +0100 Subject: [PATCH 15/15] Specify test branch for bundle, as defaults to master otherwise Signed-off-by: Matthew J. Milner --- .github/workflows/flatpak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index c829a862..c50b8a28 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -84,7 +84,7 @@ jobs: run: flatpak-builder --force-clean --user --install-deps-from=flathub --arch=x86_64 --default-branch=test --repo=repo builddir org.openchemistry.Avogadro2.yaml - name: Create bundle - run: flatpak build-bundle repo Avogadro2.flatpak org.openchemistry.Avogadro2 + run: flatpak build-bundle repo Avogadro2.flatpak org.openchemistry.Avogadro2 test - name: Upload bundle uses: actions/upload-artifact@v4