Solved Bypass the mandatory tarball

Hello,

How do I bypass the inevitable compressed tarball https://www.freebsd.org/doc/en/books/porters-handbook/book.html#slow-sources when using git based project ?

The use of Git allows to go back and forth and revert to the wanted commit which is supported according GH_TAGNAME.

Wrote a sample and incomplete Makefile that has to: fetch the git project, run the pre-* and post-* hooks, then run configure followed by make.

So far when trying to run bare make(1), the ncurses dialogue appears and allows me to choose which features the program will be compiled with, then the pre-* hook fetches the project, the post-* hook performs the wanted actions and finally make bails out with:

Code:
===>  Found saved configuration for pinky-bar-1.0.0
===>  pinky-bar-1.0.0 depends on file: /usr/local/sbin/pkg - found
Cloning into 'pinky-bar'...
remote: Counting objects: 1327, done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 1327 (delta 37), reused 0 (delta 0), pack-reused 1260
Receiving objects: 100% (1327/1327), 1.38 MiB | 396.00 KiB/s, done.
Resolving deltas: 100% (912/912), done.
Checking connectivity... done.
=> wifiextender-pinky-bar-1.0.0_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.

The sample and incomplete Makefile

Code:
# Created by: Aaron Caffrey
# $FreeBSD$

PORTNAME=  pinky-bar
PORTVERSION=  1.0.0
CATEGORIES=  sysutils

MAINTAINER=  wifiextender@null.horse
COMMENT=  Eat my slippers

USE_GITHUB=  yes
GH_ACCOUNT=  wifiextender
GH_PROJECT=  pinky-bar

GNU_CONFIGURE=    yes
CONFIGURE_ARGS=  --without-pci --without-sensors
LIB_DEPENDS=  libargp.so:devel/argp-standalone

OPTIONS_DEFINE=  X11 ALSA OSS NET DVD MPD
OPTIONS_DEFAULT=  OSS
X11_CONFIGURE_WITH=  x11
ALSA_CONFIGURE_WITH= alsa  
OSS_CONFIGURE_WITH=  oss
NET_CONFIGURE_WITH=  net
DVD_CONFIGURE_WITH=  dvd
MPD_CONFIGURE_WITH=  mpd

X11_DESC=  Enable it if you are using dwm
ALSA_DESC=  To get the sound volume level  
OSS_DESC=  The default way to get the sound volume level
NET_DESC=  Enable the internet related options
DVD_DESC=  To get the cdrom/dvdrom vendor and model names
MPD_DESC=  To see the currently played song name

DVD_LIB_DEPENDS=  libcdio.so:sysutils/libcdio libcddb.so:audio/libcddb
MPD_LIB_DEPENDS=  libmpdclient.so:audio/libmpdclient

.include <bsd.port.mk>

scripts/pre-fetch

Code:
git clone 'https://github.com/wifiextender/pinky-bar'

scripts/post-fetch

Code:
cd pinky-bar
chmod +x bootstrap
./bootstrap freebsd

I can add archive creation and compression commands to the post-fetch hook, but make bails out again.
 
How do I bypass the inevitable compressed tarball https://www.freebsd.org/doc/en/books/porters-handbook/book.html#slow-sources when using git based project ?
No, as far as I know this is not possible.
The use of Git allows to go back and forth and revert to the wanted commit which is supported according GH_TAGNAME.
Yes and no. When you do a make clean the work/ directory will be removed. So there's never anything left to 'update'.

https://www.freebsd.org/doc/en/book...e-distfiles.html#makefile-master_sites-github
 
The use of Git allows to go back and forth and revert to the wanted commit which is supported according GH_TAGNAME.
GitHub supports downloading tarballs of arbitrary commits and the ports tree uses that service. Just set GH_TAGNAME to the commit/tag you want (this defaults to whatever PORTVERSION is set to) and regenerate distinfo with make makesum.
 
No, as far as I know this is not possible.

Actually there is a way with empty do-fetch and post-fetch hooks, then you can have your say with the pre-fetch hook.

and regenerate distinfo with make makesum

Thanks, that did the trick.

I think I'm nearly done:

Makefile:

Code:
# Created by: Aaron Caffrey
# $FreeBSD$

PORTNAME=  pinky-bar
PORTVERSION=  1.0.0
CATEGORIES=  sysutils

MAINTAINER=  wifiextender@null.horse
COMMENT=  Gather some system information

USE_GITHUB=  yes
GH_ACCOUNT=  wifiextender
GH_PROJECT=  pinky-bar
GH_TAGNAME= 7592e22

GNU_CONFIGURE=    yes
USE_XORG+=  x11
LDFLAGS+=  -L${LOCALBASE}/lib
CFLAGS+=  -I${LOCALBASE}/include
CONFIGURE_ARGS=  --without-pci --without-sensors
CONFIGURE_ARGS+=  --prefix=/usr/local icons=/usr/local/share/icons/xbm_icons
LIB_DEPENDS=  libargp.so:devel/argp-standalone
BUILD_DEPENDS=  git:devel/git tar:archivers/gtar gzip:archivers/gzip

OPTIONS_DEFINE=  X11 ALSA OSS NET DVD MPD COLOURS
OPTIONS_DEFAULT=  OSS
X11_CONFIGURE_WITH=  x11
ALSA_CONFIGURE_WITH=  alsa
OSS_CONFIGURE_WITH=  oss
NET_CONFIGURE_WITH=  net
DVD_CONFIGURE_WITH=  dvd
MPD_CONFIGURE_WITH=  mpd
COLOURS_CONFIGURE_WITH=  colours

X11_DESC=  Enable it if you are using dwm
ALSA_DESC=  To get the sound volume level
OSS_DESC=  The default way to get the sound volume level
NET_DESC=  Enable the internet related options
DVD_DESC=  To get the cdrom/dvdrom vendor and model names
MPD_DESC=  To see the currently played song name
COLOURS_DESC=  Colorize the output data

X11_LIB_DEPENDS=  libX11.so:x11/xorg
ALSA_LIB_DEPENDS=  libasound.so:audio/alsa-lib
DVD_LIB_DEPENDS=  libcdio.so:sysutils/libcdio libcddb.so:audio/libcddb
MPD_LIB_DEPENDS=  libmpdclient.so:audio/libmpdclient

.include <bsd.port.mk>

src/post-extract

Code:
#!/usr/bin/env bash

# Trimmed the gplv3 license header

cd work/pinky-bar-*

chmod +x bootstrap
./bootstrap freebsd

mkdir -p -m 755 '/usr/local/share/icons/xbm_icons'
install -D -m644 xbm_icons/* '/usr/local/share/icons/xbm_icons'

cd ../..

src/post-fetch

Code:
#!/usr/bin/env bash

# Trimmed the gplv3 license header

make makesum

src/post-install

Code:
#!/usr/bin/env bash

# Trimmed the gplv3 license header

echo
echo
echo 'Please read the README'
echo 'https://github.com/wifiextender/pinky-bar/blob/master/README.md'
echo
echo
 
Thanks to everyone participated and for your suggestions. Yesterday submitted the project.

Feel free to close this issue as solved, thanks again.
 
Back
Top