build: Remove snap build machinery (#6532)

This commit is contained in:
Jakob Borg 2020-04-14 14:20:44 +02:00 committed by GitHub
parent 0ba3abdee4
commit 37ede49077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 97 deletions

6
.gitignore vendored
View File

@ -16,11 +16,5 @@ syncthing.sig
RELEASE
deb
lib/auto/gui.files.go
snapcraft.yaml
prime/
snap/
parts/
stage/
*.snap
*.bz2
/repos

View File

@ -1,13 +1,4 @@
# We will grab the Go compiler from the latest Go image.
FROM golang:1.13 as go
# Otherwise we base on the snapcraft container as that is by far the
# most complex and tricky thing to get installed and working...
FROM snapcore/snapcraft
# Go
COPY --from=go /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:$PATH"
FROM golang:1.13
# FPM to build Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \

View File

@ -31,7 +31,6 @@ import (
"runtime"
"strconv"
"strings"
"text/template"
"time"
)
@ -323,9 +322,6 @@ func runCommand(cmd string, target target) {
case "deb":
buildDeb(target)
case "snap":
buildSnap(target)
case "vet":
metalintShort()
@ -588,47 +584,6 @@ func buildDeb(target target) {
runPrint("fpm", args...)
}
func buildSnap(target target) {
os.RemoveAll("snap")
tmpl, err := template.ParseFiles("snapcraft.yaml.template")
if err != nil {
log.Fatal(err)
}
f, err := os.Create("snapcraft.yaml")
defer f.Close()
if err != nil {
log.Fatal(err)
}
snaparch := goarch
if snaparch == "armhf" {
goarch = "arm"
} else if snaparch == "i386" {
goarch = "386"
}
snapver := version
if strings.HasPrefix(snapver, "v") {
snapver = snapver[1:]
}
snapgrade := "devel"
if matched, _ := regexp.MatchString(`^\d+\.\d+\.\d+(-rc.\d+)?$`, snapver); matched {
snapgrade = "stable"
}
err = tmpl.Execute(f, map[string]string{
"Version": snapver,
"HostArchitecture": runtime.GOARCH,
"TargetArchitecture": snaparch,
"Grade": snapgrade,
})
if err != nil {
log.Fatal(err)
}
runPrint("snapcraft", "clean")
build(target, []string{"noupgrade"})
runPrint("snapcraft")
}
func shouldBuildSyso(dir string) (string, error) {
type M map[string]interface{}
version := getVersion()

View File

@ -1,36 +0,0 @@
name: syncthing
version: {{.Version}}
summary: Open Source Continuous File Synchronization
description: |
Syncthing replaces proprietary sync and cloud services with something open,
trustworthy and decentralized. Your data is your data alone and you deserve
to choose where it is stored, if it is shared with some third party and how
it's transmitted over the Internet.
architectures:
- build-on: [{{.HostArchitecture}}]
run-on: [{{.TargetArchitecture}}]
grade: {{.Grade}}
confinement: strict
apps:
syncthing:
command: syncthing
environment:
HOME: ${SNAP_USER_COMMON}
XDG_CONFIG_HOME: ${SNAP_USER_COMMON}
plugs:
- desktop
- home
- network
- network-bind
- removable-media
parts:
syncthing:
source: .
plugin: dump
stage:
- syncthing
prime:
- syncthing