Skip to content

Commit

Permalink
chore(CI): modify PKGBUILD to support OBS
Browse files Browse the repository at this point in the history
modify PKGBUILD to support OBS

log:
  • Loading branch information
tsic404 authored and deepin-bot[bot] committed May 16, 2023
1 parent 8f0624b commit e703a7b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 163 deletions.
7 changes: 7 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ test_build:
architectures:
- x86_64

- name: archlinux
paths:
- target_project: deepin:CI
target_repository: archlinux
architectures:
- x86_64

filters:
event: pull_request

Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ ts-to-policy:
out/bin/%:
${GOBUILD} -o $@ ${GOBUILD_OPTIONS} ${GOPKG_PREFIX}/${@F}

# Install go packages
build-dep:
go get github.com/disintegration/imaging
go get gopkg.in/check.v1
go get github.com/linuxdeepin/go-x11-client

build-binary: prepare $(addprefix out/bin/, ${BINARIES})

install-binary:
Expand Down
46 changes: 20 additions & 26 deletions archlinux/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
pkgname=deepin-api-git
pkgver=5.5.12.r8.ga0dc403
pkgrel=1
sourcename=dde-api
sourcetars=("$sourcename"_"$pkgver".tar.xz vendor.tar.gz)
sourcedir="$sourcename"
useforobs=1
pkgdesc='Golang bindings for dde-daemon'
arch=('x86_64' 'aarch64')
url="https://github.com/linuxdeepin/dde-api"
Expand All @@ -12,48 +16,38 @@ license=('GPL3')
# librsvg: rsvg-convert used in adjust-grub-theme
# util-linux: rfkill used in device
depends=('alsa-utils' 'bc' 'fontconfig' 'glib2' 'gdk-pixbuf2' 'gtk3' 'libcanberra-pulse' 'librsvg'
'libxi' 'libxfixes' 'poppler-glib' 'util-linux' 'xcur2png' 'blur-effect')
makedepends=('git' 'deepin-gettext-tools-git' 'golang-deepin-gir-git' 'golang-deepin-lib-git'
'golang-github-linuxdeepin-go-dbus-factory-git' 'golang-github-linuxdeepin-go-x11-client-git'
'golang-github-nfnt-resize' 'bzr' 'go-pie')
'libxi' 'libxfixes' 'poppler-glib' 'util-linux' 'xcur2png' 'blur-effect' 'gdk-pixbuf-xlib'
'libgudev')

makedepends=('git' 'bzr' 'go-pie' 'deepin-gettext-tools-git')
provides=('deepin-api')
conflicts=('deepin-api')
groups=('deepin-git')
install=deepin-api.install
source=("source.tar.gz"
source=("${sourcetars[@]}"
deepin-api.sysusers)
sha512sums=('SKIP'
sha512sums=('SKIP' 'SKIP'
'e894eb3928af9e244fa78010fdf16c8abb6ce18df114cf05327d02b18774d6ba5b023e4dfa0d07042f4e44a5c6e2ddb55b07f3e0db466a0e6169b52465fdefd6')

prepare() {
cd $deepin_source_name
cd $sourcedir
export GOPATH="$PWD/gobuild:/usr/share/gocode"
export GO111MODULE=off
# golang-deepin-lib's dependency, remove when go packaging resumes
go get -v github.com/cryptix/wav
go get -v github.com/youpy/go-wav
go get -v github.com/disintegration/imaging
go get -v github.com/fogleman/gg
go get -v github.com/mattn/go-sqlite3
go get -v github.com/gosexy/gettext
go get -v github.com/rickb777/date
go get -v github.com/fsnotify/fsnotify
go get -v github.com/godbus/dbus/
go get -v github.com/godbus/dbus/introspect
go get -v github.com/godbus/dbus/prop
go get -v github.com/disintegration/imaging
go get -v gopkg.in/yaml.v3
go get -v github.com/stretchr/testify/
if [[ ! -n "$useforobs" ]];then
export GOFLAGS="-buildmode=pie -trimpath -modcacherw -mod=readonly"
go mod tidy
else
export GOFLAGS="-buildmode=pie -trimpath -modcacherw -mod=vendor"
cp -a "$srcdir"/vendor "$srcdir"/"$sourcedir"/vendor
fi
}

build(){
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
cd $deepin_source_name
cd $sourcedir
make -j1
}

package() {
cd $deepin_source_name
cd $sourcedir
make DESTDIR="$pkgdir" SYSTEMD_LIB_DIR=/usr/lib install
install -Dm644 ../deepin-api.sysusers "$pkgdir"/usr/lib/sysusers.d/deepin-api.conf
}
17 changes: 16 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/linuxdeepin/dde-api

go 1.15
go 1.20

require (
github.com/disintegration/imaging v1.6.2
Expand All @@ -16,6 +16,21 @@ require (
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rickb777/plural v1.4.1 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/youpy/go-riff v0.1.0 // indirect
github.com/youpy/go-wav v0.3.2 // indirect
golang.org/x/image v0.0.0-20220902085622-e7cb96979f69 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/linuxdeepin/go-dbus-factory v0.0.0-20230407013947-6ff704a21ca7
Expand Down
Loading

0 comments on commit e703a7b

Please sign in to comment.