~alpine/aports

1

[alpine-aports] [PATCH 2/2] main/git: add git-gui and gitk subpackages

Andrew Hills <ahills@ednos.net>
Details
Message ID
<1432922663-15777-2-git-send-email-ahills@ednos.net>
Sender timestamp
1432922663
DKIM signature
missing
Download raw message
Patch: +28 -2
---
 main/git/APKBUILD | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/main/git/APKBUILD b/main/git/APKBUILD
index 5ab057b..636f571 100644
--- a/main/git/APKBUILD
+++ b/main/git/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=git
pkgver=2.4.2
pkgrel=0
pkgrel=1
pkgdesc="A distributed version control system"
url="http://git.or.cz/"
arch="all"
@@ -24,6 +24,8 @@ subpackages="$pkgname-doc
	$pkgname-subtree
	$pkgname-subtree-doc:subtree_doc
	$pkgname-perl:_git_perl
	$pkgname-gui
	$pkgname-gitk
	"

makedepends="zlib-dev openssl-dev curl-dev expat-dev perl-dev python-dev
@@ -37,7 +39,6 @@ source="git-$pkgver.tar.gz::https://github.com/git/git/archive/v$pkgver.tar.gz
_makeopts="
	NO_GETTEXT=YesPlease
	NO_NSEC=YesPlease
	NO_TCLTK=YesPlease
	NO_SVN_TESTS=YesPlease
	USE_LIBPCRE=1"

@@ -189,6 +190,31 @@ subtree_doc() {
	make install-man prefix=/usr DESTDIR="$subpkgdir"
}

gui() {
	depends="git=$pkgver-r$pkgrel tcl tk"
	pkgdesc="GUI interface for git"
	arch="noarch"
	replaces=""

	mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/libexec/git-core
	mv "$pkgdir"/usr/share/git-gui "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/libexec/git-core/git-citool \
		"$pkgdir"/usr/libexec/git-core/git-gui \
		"$pkgdir"/usr/libexec/git-core/git-gui--askpass \
		"$subpkgdir"/usr/libexec/git-core/
}

gitk() {
	depends="git=$pkgver-r$pkgrel tcl tk"
	pkgdesc="Gitk interface for git"
	arch="noarch"
	replaces=""

	mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/share/gitk "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/bin/gitk "$subpkgdir"/usr/bin/
}

# catch-the-rest of stuff that needs perl
_git_perl() {
	depends="git=$pkgver-r$pkgrel perl-git=$pkgver-r$pkgrel perl"
-- 
2.4.2



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

new APKBUILD format? (WAS: Re: [alpine-aports] [PATCH 2/2] main/git: add git-gui and gitk subpackages)

Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20150529104119.5e7fd668@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1432922663-15777-2-git-send-email-ahills@ednos.net> (view parent)
Sender timestamp
1432888879
DKIM signature
missing
Download raw message
Thank you for this patch.

This patch uncovers a problem in abuild/APKBUILD that I'd like to solve.

The problem is that we need to tell abuild (and aports building tools)
the dependencies in global scope.

I'll explain below.

On Fri, 29 May 2015 14:04:23 -0400
Andrew Hills <ahills@ednos.net> wrote:

> @@ -24,6 +24,8 @@ subpackages="$pkgname-doc
>  	$pkgname-subtree
>  	$pkgname-subtree-doc:subtree_doc
>  	$pkgname-perl:_git_perl
> +	$pkgname-gui
> +	$pkgname-gitk
>  	"
>  
>  makedepends="zlib-dev openssl-dev curl-dev expat-dev perl-dev python-dev

We have 2 subpackages, git-gui and git-gitk.

...
  
> @@ -189,6 +190,31 @@ subtree_doc() {
>  	make install-man prefix=/usr DESTDIR="$subpkgdir"
>  }
>  
> +gui() {
> +	depends="git=$pkgver-r$pkgrel tcl tk"

git-gui needs tcl and tk to run.

...
> +gitk() {
> +	depends="git=$pkgver-r$pkgrel tcl tk"


so does git-gitk.

The problem here is that when building the repository from scratch,
there is no way for the build scripts to know that tcl and tk needs to
be built before git. The tcl and tk must be built before git because if
other package would have makedepends="git-gui" the would the build fail
if tcl and tk is not built at that point.

The problem is not the patch itself but the problem is in APKBUILD. We
need a way to say that subpackage git-gui has depends of tcl and tk.

Something like this in global scope would have been nice:

  git-gui.depends="git=$pkgver-r$pkgdr tcl tk"
  git-gui.pkgdesc="GUI interface for git"

but that is not possible in shell. (it would be possible to do like
git_gui_depends="..." and then do tricks with eval, but i would very much
want avoid that)

For this specific case we can work around it with:
makedepends="tcl tk ..."

To fix this properly, we would need replace APKBUILD with another
format (embedded yaml? lua? .spec?), where the meta data (pkgname,
depends, etc) was not shell.

If we want stick to shell then we could also do some kind of hack:

subdepends="
	$pkgname-gui:tcl
	$pkgname-gui:tk
	"

This problem alone does not justify replacing APKBUILD, but there are
other issues too with the APKBUILD format that i'd like to fix.

I am open to ideas.

-nc


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)