You are not logged in.

#1 2012-10-29 18:24:12

Layus
Member
Registered: 2012-04-30
Posts: 12

[Info] Allow pkgbuild/makepkg to handle local files

Hi there !

As a fan of both Humble Indie Bundle and Archlinux,
I found myself confronted with makepkg incapacity to locate local files.

So i decided to write a dlagent for "file:" in makepkg.conf.
As a side note, "local:" would be a better name, but aur/worldofgoo and aur/anomaly use "file:" so be it.
It reads like this :

DLAGENTS=( ...
          'file::/bin/ln -s $(zenity --file-selection --title="Select ressource %u" --file-filter $(basename %u)) %o')

It simply opens a file browser displaying only files with a name matching the expected one, and then symlinks it to the build location.
I am still usatisfied as it is possible to return a directory with a name not matching the pattern, but it seems impossible to prevent that with zenity.

I wanted to share it with the community, but there is no wiki for makepkg.conf, so I ended up here ;-)
Maybe it is even possible to include it by default (but then makepkg would depend on zenity, which is rater stupid).

Any comment/improvement would be much appreciated.

Layus

Last edited by Layus (2012-10-29 18:24:39)

Offline

#2 2012-10-29 23:56:54

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 6,816

Re: [Info] Allow pkgbuild/makepkg to handle local files

Layus wrote:

makepkg incapacity to locate local files.

Source? makepkg locates 'local files' which are included in the source just fine (put in some dummy download link and state that the file is expected to have a certain name and to be in the same folder)....


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2012-10-30 10:32:20

Layus
Member
Registered: 2012-04-30
Posts: 12

Re: [Info] Allow pkgbuild/makepkg to handle local files

My bad, I didn't make it clear enough.

The humble indie bundle games have to be downloaded from their site, using authentication.

Once you have the tarball, you can manually copy it to the build location, and it is indeed found by makepkg,
or you can use a file:// protocol with the line I presented.

In this case you get a nice file-selector window, and you don't need to know where is the actual build location,
which might be useful because /tmp/yaourt-username/package/src is just a bit long, and might be subject to changes according to config.

Layus.

Offline

#4 2012-10-30 10:48:23

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Info] Allow pkgbuild/makepkg to handle local files

I'm glad it's useful to you, but you should be aware that the package-building process is not meant to be interactive. You write your PKGBUILD correctly, put the required files in your build directory, run makepkg, and it spits out a package - that's it.

You are, of course, free to muck around with that as much as you want. smile

Offline

#5 2012-10-30 11:03:29

Layus
Member
Registered: 2012-04-30
Posts: 12

Re: [Info] Allow pkgbuild/makepkg to handle local files

Yes... I forgot that because building with yaourt is very interactive.

1) ==> Select packages (numbers) to install :
2) ==> Edit PKGBUILD ? [Y/n] (if yes edit, then same question again, until you refuse)
3) ==> Edit readme.install [Y/n]
4) ==> Start compiling <pkg> ? [Y/n]
4') select tarball with zenity
5) ==> Do you want to install <pkg> (or verify it)
6) sudo : enter password for <user> :
7) Proceed to install ? [Y/n] (pacman prompt)

So inserting one interactive step seemed meaningless but of course makepkg is supposed to be fully automatic.

So be it, this idea shall only stay here in case anyone searches for the same functionality.

Thank you for the comment, and be sure I will continue to muck a lot smile

Offline

#6 2012-10-30 13:49:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Info] Allow pkgbuild/makepkg to handle local files

Maybe patch your file selector into yaourt then.

Offline

#7 2012-10-31 06:29:58

Layus
Member
Registered: 2012-04-30
Posts: 12

Re: [Info] Allow pkgbuild/makepkg to handle local files

tomk wrote:

Maybe patch your file selector into yaourt then.

Yes... I sounds right.
But then I would need to parse the source array of the PKGBUILD before calling makepkg.

Sounds hackish too, doesn't it ?

I will investigate smile

Offline

#8 2012-10-31 08:43:36

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Info] Allow pkgbuild/makepkg to handle local files

Hackish indeed - that's why yaourt is the perfect place for it. tongue

Offline

#9 2012-11-15 10:11:51

Nowaker
Member
From: Gdańsk, Poland
Registered: 2011-10-26
Posts: 16
Website

Re: [Info] Allow pkgbuild/makepkg to handle local files

Layus wrote:
DLAGENTS=( ...
          'file::/bin/ln -s $(zenity --file-selection --title="Select ressource %u" --file-filter $(basename %u)) %o')

Works like a charm, thank you Layus! You saved my time.

Offline

#10 2015-02-18 06:01:24

Abdillah
Member
Registered: 2015-01-01
Posts: 1

Re: [Info] Allow pkgbuild/makepkg to handle local files

Well, I don't know why, it is now produce error :

/bin/ln: unrecognized option '--file-selection'
Try '/bin/ln --help' for more information.

I change mutter (Gtk-Mutter) PKGBUILD into :

# ...
- source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz)
+ source=(file:///home/to/full/path/of/mutter/)
# ...

Is it incomplete or wrong?

Offline

#11 2015-02-18 16:04:19

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,557
Website

Re: [Info] Allow pkgbuild/makepkg to handle local files


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB