From 79ce2054d4362f39cd4083992098b7378861a4c8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jul 2019 18:45:20 +0200 Subject: Linux: add script and instructions for creating snap packages We will now maintain the Blender package on snapcraft.io/blender. Differential Revision: https://developer.blender.org/D5342 --- release/freedesktop/snap/README.txt | 38 +++++++++++++++++++++++ release/freedesktop/snap/bundle.py | 21 +++++++++++++ release/freedesktop/snap/snapcraft.yaml.in | 48 ++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 release/freedesktop/snap/README.txt create mode 100755 release/freedesktop/snap/bundle.py create mode 100644 release/freedesktop/snap/snapcraft.yaml.in diff --git a/release/freedesktop/snap/README.txt b/release/freedesktop/snap/README.txt new file mode 100644 index 00000000000..2e8822f32dc --- /dev/null +++ b/release/freedesktop/snap/README.txt @@ -0,0 +1,38 @@ + +Snap Package Instructions +========================= + +This folder contains the scripts for creating and uploading the snap on: +https://snapcraft.io/blender + + +Setup +----- + +This has only been tested to work on Ubuntu. + +# Install required packages +sudo apt install snapd snapcraft + + +Steps +----- + +# Build the snap file +python3 bundle.py --version 2.XX --url https://download.blender.org/release/Blender2.XX/blender-2.XX-x86_64.tar.bz2 + +# Install snap to test +# --dangerous is needed since the snap has not been signed yet +# --classic is required for installing Blender in general +sudo snap install --dangerous --classic blender_2.XX_amd64.snap + +# Upload +snapcraft push --release=stable blender_2.XX_amd64.snap + + +Release Values +-------------- + +stable: final release +candidate: release candidates + diff --git a/release/freedesktop/snap/bundle.py b/release/freedesktop/snap/bundle.py new file mode 100755 index 00000000000..c3ecc5af561 --- /dev/null +++ b/release/freedesktop/snap/bundle.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import argparse +import os +import pathlib +import subprocess + +parser = argparse.ArgumentParser() +parser.add_argument("--version", required=True) +parser.add_argument("--url", required=True) +parser.add_argument("--grade", default="stable", choices=["stable", "devel"]) +args = parser.parse_args() + +yaml_text = pathlib.Path("snapcraft.yaml.in").read_text() +yaml_text = yaml_text.replace("@VERSION@", args.version) +yaml_text = yaml_text.replace("@URL@", args.url) +yaml_text = yaml_text.replace("@GRADE@", args.grade) +pathlib.Path("snapcraft.yaml").write_text(yaml_text) + +subprocess.call(["snapcraft", "clean"]) +subprocess.call(["snapcraft", "snap"]) diff --git a/release/freedesktop/snap/snapcraft.yaml.in b/release/freedesktop/snap/snapcraft.yaml.in new file mode 100644 index 00000000000..12fff16d528 --- /dev/null +++ b/release/freedesktop/snap/snapcraft.yaml.in @@ -0,0 +1,48 @@ +name: blender +summary: Blender is the free and open source 3D creation suite. +description: | + Blender is the free and open source 3D creation suite. It supports the + entirety of the 3D pipeline—modeling, rigging, animation, simulation, + rendering, compositing and motion tracking, and video editing. + + Blender is a public project, made by hundreds of people from around the + world; by studios and individual artists, professionals and hobbyists, + scientists, students, VFX experts, animators, game artists, modders, and + the list goes on. + + The standard snap channels are used in the following way: + + stable - Latest stable release. + candidate - Test builds for the upcoming stable release. + +icon: ../icons/scalable/apps/blender.svg + +passthrough: + license: GPL-3.0 + +confinement: classic + +apps: + blender: + command: ./blender + desktop: ./blender.desktop + +version: @VERSION@ +grade: @GRADE@ + +parts: + blender: + plugin: dump + source: @URL@ + build-attributes: [keep-execstack, no-patchelf] + override-build: | + snapcraftctl build + sed -i 's|Icon=blender|Icon=${SNAP}/blender.svg|' ${SNAPCRAFT_PART_INSTALL}/blender.desktop + stage-packages: + - libxcb1 + - libxext6 + - libx11-6 + - libxi6 + - libxfixes3 + - libxrender1 + - libxxf86vm1 -- cgit v1.2.3