You are not logged in.

#1 2016-10-08 12:23:24

rcorre
Member
Registered: 2015-11-27
Posts: 65

PKGBUILD review request: myrddin-git

Hi all, this is my first PKGBUILD submission.
It is a package for the myrddin programming language.

# Maintainer: Ryan Roden-Corrent <ryan@rcorre.net>

_pkgname=mc
pkgname=myrddin-git
pkgver=20160924.606bce2
pkgrel=1
pkgdesc='Compiler and tools for the Myrddin programming language.'
arch=('i686' 'x86_64')
license=('MIT')
url="https://myrlang.org/"
source=("git://git.eigenstate.org/git/ori/mc.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  git log -1 --format='%cd.%h' --date=short | tr -d -
}

build() {
  cd "$srcdir/$_pkgname"
  ./configure --prefix="$pkgdir/usr"
  make
}

package() {
  cd "$srcdir/$_pkgname"
  make install
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$_pkgname/README.md"
}

There are two specific questions I had:

1. `./configure --prefix=/usr` seems pretty typical in PKGBUILDS, but in this case it would bypass the fakeroot and try to install directly to /usr. I believe this is because myrddin uses its own buid tool, mbld, to install itself. The fakeroot manpage mentions that it does not wrap open()/create(), so I suspect that mbld is using these and bypassing fakeroot.

In this case, is it ok to use `--prefix="$pkgdir/usr" instead?

2. The git repo contains some vim ftdetect/indent/syntax files in a subdirectory. Should I:
    1. Leave them out
    2. Include the entire subdirectory in /usr/share/mc
    3. Add them to /usr/share/vim/vimfiles

    2 sounds like the best, as it allows vim package managers like plugged to hook into them.
    /usr/share/vim/vimfiles would not work for users of nvim.

Thanks for taking the time to look at this, and let me now if there's anything else I should change!

Offline

#2 2016-10-08 12:33:57

basica
Member
From: Australia
Registered: 2012-10-31
Posts: 217

Re: PKGBUILD review request: myrddin-git

  ./configure --prefix="$pkgdir/usr"

This won't work as it's hardcoding the installation path into the file. Usually you can do a make DESTDIR=$pkgdir on the program, but in some cases this won't work in which case you might need to just copy the files across manually (you could do an install locally to see where they go so you know which ones to copy, but there might be an easier way that someone more experienced than me knows). As for the syntax files, I think the second option also would be best.

Offline

#3 2016-10-08 13:27:15

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: PKGBUILD review request: myrddin-git

Include the entire subdirectory in /usr/share/mc

If myrdin uses   /usr/share/mc , it conflicts with Midnight Commander .

If you want to put those files there for use by Midnight Commander let the user do that themselves.
just put them under /usr/share/myrdin-folder   and add a .install file that alerts the user to the presence of these files.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2016-10-08 14:09:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,543

Re: PKGBUILD review request: myrddin-git

That pkgver function isn't really acceptable. Please read the VCS Package Guidelines page on the Wiki.

Offline

#5 2016-10-08 15:53:30

rcorre
Member
Registered: 2015-11-27
Posts: 65

Re: PKGBUILD review request: myrddin-git

Thanks for the review.

Scimmia: I've updated pkgver() based on that article's recommendation for a git repo without tags.

Lone_Wolf: The repository is called 'mc' for 'Myrddin Compiler'. Thanks for pointing out the potential conflict with Midnight Commander, as I also had to rename a manpage.

The updated pkgbuild is below. I'm not sure I installed the vimfiles in the best way, but it seems to work.

# Maintainer: Ryan Roden-Corrent <ryan@rcorre.net>

_reponame=mc
_pkgname=myrddin
pkgname=myrddin-git
pkgver=0.3939.606bce2
pkgrel=1
pkgdesc='Compiler and tools for the Myrddin programming language.'
arch=('i686' 'x86_64')
license=('MIT')
url="https://myrlang.org/"
source=("git://git.eigenstate.org/git/ori/mc.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_reponame"
  echo "0.$(git rev-list --count HEAD).$(git describe --always)"
}

build() {
  cd "$srcdir/$_reponame"
  ./configure --prefix="$pkgdir/usr"
  make
}

package() {
  cd "$srcdir/$_reponame"
  make install
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$_pkgname/README.md"

  # avoid conflict with midnight commander
  # this manpage is for the compiler, called 6m
  mv "$pkgdir/usr/share/man/man1/"{mc,6m}.1

  cd "$srcdir/$_reponame/support/vim/"
  for dir in *; do
    install -t "$pkgdir/usr/share/$_pkgname/vim/$dir" -Dm644 "$dir"/*.vim
  done
}

Offline

#6 2016-10-08 16:05:38

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,543

Re: PKGBUILD review request: myrddin-git

That is not what the VCS package guidelines page recommends.

You're still using $pkgdir in the build function. Don't do that, it may not be correct.

Offline

#7 2016-10-08 16:47:38

rcorre
Member
Registered: 2015-11-27
Posts: 65

Re: PKGBUILD review request: myrddin-git

Argh, sorry. DESTDIR is what I needed. Does this look better?

build() {
  cd "$srcdir/$_reponame"
  ./configure --prefix="/usr"
  make
}

package() {
  cd "$srcdir/$_reponame"
  make DESTDIR="$pkgdir" install
  ...

Offline

#8 2016-10-08 16:52:08

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,543

Re: PKGBUILD review request: myrddin-git

Yep, that looks much better.

Offline

Board footer

Powered by FluxBB