wok rev 18909

Add gnubg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 22 21:29:18 2016 +0100 (2016-02-22)
parents dec20e5fa283
children ab1db1415dd8
files gnubg/receipt gnubg/stuff/gnubg.desktop syslinux/stuff/iso2exe/iso2exe.c syslinux/stuff/iso2exe/iso2exe.sh syslinux/stuff/iso2exe/mvcom.S
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gnubg/receipt	Mon Feb 22 21:29:18 2016 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="gnubg"
     1.7 +VERSION="1.05.000"
     1.8 +CATEGORY="games"
     1.9 +SHORT_DESC="GNU Backgammon game."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +LICENSE="GPL"
    1.12 +TARBALL="$PACKAGE-release-$VERSION-sources.tar.gz"
    1.13 +WEB_SITE="http://www.gnubg.org/"
    1.14 +WGET_URL="http://files.gnubg.org/media/sources/$TARBALL"
    1.15 +
    1.16 +DEPENDS="gtk+ libcanberra ncurses python gmp libvorbis libltdl"
    1.17 +BUILD_DEPENDS="pkg-config autoconf automake bison flex libtool \
    1.18 +glib-dev libpng-dev freetype-dev gtk+-dev cairo-dev libcanberra-dev \
    1.19 +gtkglext-dev readline-dev python sqlite-dev gmp-dev"
    1.20 +
    1.21 +# Rules to configure and make the package.
    1.22 +compile_rules()
    1.23 +{
    1.24 +	./configure --prefix=/usr \
    1.25 +		--sysconfdir=/etc \
    1.26 +		--mandir=/usr/share/man \
    1.27 +		--disable-cputest \
    1.28 +		$CONFIGURE_ARGS &&
    1.29 +	make &&
    1.30 +	make DESTDIR=$DESTDIR install
    1.31 +}
    1.32 +
    1.33 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.34 +genpkg_rules()
    1.35 +{
    1.36 +	mkdir -p $fs/usr/share/applications
    1.37 +	cp -a $install/* $fs
    1.38 +	cp -a $stuff/gnupg.desktop $fs/usr/share/applications
    1.39 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gnubg/stuff/gnubg.desktop	Mon Feb 22 21:29:18 2016 +0100
     2.3 @@ -0,0 +1,10 @@
     2.4 +[Desktop Entry]
     2.5 +Name=GNU Backgammon
     2.6 +GenericName=Backgammon
     2.7 +Comment=GTK or console backgammon program with analysis
     2.8 +Exec=gnubg -w
     2.9 +Terminal=false
    2.10 +Icon=gnubg
    2.11 +Type=Application
    2.12 +Categories=Game;BoardGame;GTK;
    2.13 +Keywords=analysis;tutor;
     3.1 --- a/syslinux/stuff/iso2exe/iso2exe.c	Sun Feb 21 19:26:01 2016 +0000
     3.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c	Mon Feb 22 21:29:18 2016 +0100
     3.3 @@ -63,7 +63,7 @@
     3.4  static uint64_t total64;    /* must be directly before hash[] */
     3.5  static uint32_t hash[8];    /* 4 elements for md5, 5 for sha1, 8 for sha256 */
     3.6  
     3.7 -//#define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
     3.8 +/* #define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n)))) */
     3.9  static uint32_t rotl32(uint32_t x, unsigned n)
    3.10  {
    3.11  	return (x << n) | (x >> (32 - n));
    3.12 @@ -114,10 +114,10 @@
    3.13  		/* Do we have enough space for the length count? */
    3.14  		if (remaining >= 8) {
    3.15  			/* Store the 64-bit counter of bits in the buffer */
    3.16 -			//uint64_t t = total64 << 3;
    3.17 +			/* uint64_t t = total64 << 3; */
    3.18  			uint32_t *t = (uint32_t *) (&wbuffer[64 - 8]);
    3.19  			/* wbuffer is suitably aligned for this */
    3.20 -			//*(uint64_t *) (&wbuffer[64 - 8]) = t;
    3.21 +			/* *(uint64_t *) (&wbuffer[64 - 8]) = t; */
    3.22  			t[0] = total64.l << 3;
    3.23  			t[1] = (total64.h << 3) | (total64.l >> 29);
    3.24  		}
    3.25 @@ -287,14 +287,6 @@
    3.26  	unsigned long size, catalog, lba;
    3.27  	int cylinders, i, j, isohybrid;
    3.28  	unsigned n;
    3.29 -#ifdef __MSDOS__
    3.30 -	for (bootiso = (char *) install;
    3.31 -	     bootiso[0] != 'M' || bootiso[1] != 'Z' || bootiso[2] != '\xEB';
    3.32 -	     bootiso++) if (bootiso < (char *) install) {
    3.33 -		bootiso = "No bootiso data";
    3.34 -		return 0;
    3.35 -	}
    3.36 -#endif
    3.37  	if (!filename)
    3.38  		return USAGE;
    3.39  	fd = open(filename,O_RDWR|O_BINARY);
    3.40 @@ -314,8 +306,7 @@
    3.41  		for (i = 0; i < 32; i++, n = BUFFERSZ) {
    3.42  			write(fd, buffer + n, BUFFERSZ);
    3.43  		}
    3.44 -		i = getcustomsector();
    3.45 -		lseek(fd, i * 2048UL, SEEK_SET);
    3.46 +		lseek(fd, getcustomsector() << 11, SEEK_SET);
    3.47  		i = clear_config(i);
    3.48  		ftruncate(fd, i * 2048UL);
    3.49  		close(fd);
    3.50 @@ -393,12 +384,12 @@
    3.51  		lseek(fd, pos, SEEK_SET);
    3.52  		clear_config(pos);
    3.53  		lseek(fd, pos, SEEK_SET);
    3.54 -		write(fd, "#!boot 00000000000000000000000000000000\n", 40);
    3.55 +		write(fd, bootiso+CUSTOM_HEADER, 40);
    3.56  		n = pos + 40;
    3.57  		md5_begin();
    3.58  		if (append) {
    3.59  			i = strlen(append);
    3.60 -			writenhash("append=", 7);
    3.61 +			writenhash(bootiso+CMDLINE_TAG, 7);
    3.62  			writenhash(append, i);
    3.63  			writenhash("\n", 1);
    3.64  			n += i + 8;
    3.65 @@ -421,7 +412,7 @@
    3.66  			     x /= 10;
    3.67  			} while (x);
    3.68  			if (*++p != '0') {
    3.69 -				writenhash("initrd:", 7);
    3.70 +				writenhash(bootiso+INITRD_TAG, 7);
    3.71  				i = number - p + sizeof(number);
    3.72  				writenhash(p, i);
    3.73  				n += i + 7;
    3.74 @@ -494,7 +485,7 @@
    3.75  	return SUCCESSMSG;
    3.76  }
    3.77  
    3.78 -static unsigned short files[] = { // to move to iso2exe.sh ....
    3.79 +static unsigned short files[] = {
    3.80  	WIN32_EXE,		/*  0 */
    3.81  	SYSLINUX_MBR,		/*  1 */
    3.82  	FLAVOR_INFO,		/*  2 */
    3.83 @@ -516,7 +507,7 @@
    3.84  	char *s;
    3.85  
    3.86  	c = getcustomsector();
    3.87 -	readsector(0);
    3.88 +	readsector(0UL);
    3.89  	i = 1024;
    3.90  	if (WORD(buffer+1024) != 35615) i = 512 * (1 + BYTE(buffer+417));
    3.91  	stub = WORD(buffer+20) - 0xC0;
    3.92 @@ -547,7 +538,7 @@
    3.93  		file_offset = 0x8000U; file_size = 2048*c - file_offset; break;
    3.94  	case CUSTOM_MAGIC:	/* custom.magic */
    3.95  		readsector(c);
    3.96 -		if (!strncmp(buffer, "#!boot", 6)) {
    3.97 +		if (!strncmp(buffer, bootiso+CUSTOM_HEADER, 6)) {
    3.98  			file_size = 39; file_offset = 2048*c;
    3.99  		}; break;
   3.100  	case CUSTOM_APPEND:	/* custom.append */
   3.101 @@ -565,26 +556,34 @@
   3.102  	}
   3.103  }
   3.104  
   3.105 +static long heap = 0;
   3.106 +static void show_free(void)
   3.107 +{
   3.108 +	if (file_offset > heap && (file_offset - heap) > 16)
   3.109 +		printf(bootiso + FREE_FORMAT, file_offset - heap,
   3.110 +		       heap, file_offset);
   3.111 +}
   3.112 +
   3.113  static void list(void)
   3.114  {
   3.115 -	int num, heap = 0;
   3.116 +	int num;
   3.117  
   3.118  	for (num = 0; num < sizeof(files)/sizeof(files[0]); num++) {
   3.119  		fileofs(num);
   3.120  		if (file_size <= 0 || file_offset > 0x3FFFFFFFUL) continue;
   3.121  		readsector(file_offset / 2048);
   3.122  		if (WORD(buffer + file_offset % 2048) == 0) continue;
   3.123 -		if (file_offset > heap && (file_offset - heap) > 16)
   3.124 -			printf("%d free bytes in %04X..%04X\n",
   3.125 -				file_offset - heap, heap, file_offset);
   3.126 +		show_free();
   3.127  		if (file_offset >= heap) heap = file_offset + file_size;
   3.128 -		printf("%s at %04X (%d bytes).\n", bootiso + files[num],
   3.129 -			file_offset, file_size);
   3.130 +		printf(bootiso + USED_FORMAT, bootiso + files[num],
   3.131 +			 file_offset, file_size);
   3.132  	}
   3.133 -	file_offset=lseek(fd, 0UL, SEEK_END);	
   3.134 -	if (file_offset > heap)
   3.135 -		printf("%d free bytes in %04X..%04X\n",
   3.136 -			file_offset - heap, heap, file_offset);
   3.137 +#ifdef  __MSDOS__
   3.138 +	file_offset = (heap + 0xFFFFFUL) & 0xFFF00000UL;
   3.139 +#else
   3.140 +	file_offset=lseek(fd, 0UL, SEEK_END);
   3.141 +#endif
   3.142 +	show_free();
   3.143  }
   3.144  
   3.145  static void extract(char *name)
   3.146 @@ -612,6 +611,7 @@
   3.147  	int i;
   3.148  	char *s;
   3.149  	
   3.150 +	data_fixup();
   3.151  	for (i = 0; argc > 2;) {
   3.152  		s = argv[1];
   3.153  		if (*s != '-') break;
     4.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Sun Feb 21 19:26:01 2016 +0000
     4.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Mon Feb 22 21:29:18 2016 +0100
     4.3 @@ -46,7 +46,8 @@
     4.4  #		2> /dev/null && echo "Store mount.posixovl ($(wc -c \
     4.5  #			< /usr/sbin/mount.posixovl) bytes) ..."
     4.6  	find $TMP -type f -print0 | xargs -0 chmod +x
     4.7 -	( cd $TMP ; find * | cpio -o -H newc ) | compress $TMP/rootfs.gz
     4.8 +	( cd $TMP ; find * | grep -v rootfs.gz | cpio -o -H newc ) | \
     4.9 +		compress $TMP/rootfs.gz
    4.10  	SIZE=$(wc -c < $TMP/rootfs.gz)
    4.11  	store 24 $SIZE $1
    4.12  	OFS=$(( $OFS - $SIZE ))
    4.13 @@ -245,9 +246,9 @@
    4.14  #ifndef __MSDOS__
    4.15  static char $name[] = {
    4.16  /* head */
    4.17 -$(hexdump -v -n $HSZ -e '"    " 16/1 "0x%02X, "' -e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' $DATA | sed 's/ 0x  ,/      /g')
    4.18 +$(hexdump -v -n $HSZ -e '"    " 16/1 "0x%02X, "' -e '"  /* %04.4_ax */ \n"' $DATA | sed 's/ 0x  ,/      /g')
    4.19  /* tail */
    4.20 -$(hexdump -v -s $OFS -e '"    " 16/1 "0x%02X, "' -e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' $DATA | sed 's/ 0x  ,/      /g')
    4.21 +$(hexdump -v -s $OFS -e '"    " 16/1 "0x%02X, "' -e '"  /* %04.4_ax */ \n"' $DATA | sed 's/ 0x  ,/      /g')
    4.22  
    4.23  /* These strange constants are defined in RFC 1321 as
    4.24     T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64
    4.25 @@ -294,14 +295,12 @@
    4.26  	while read tag str; do
    4.27  		if [ "$mode" == "data" ]; then
    4.28  			echo -en "$str\0" | hexdump -v -e '"    " 16/1 "0x%02X, "' \
    4.29 -				-e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' | \
    4.30 +				-e '"  /* %04.4_ax */ \n"' | \
    4.31  				sed 's/ 0x  ,/      /g'
    4.32  		else
    4.33  			if [ $ofs -eq 0 ]; then
    4.34  				cat <<EOT
    4.35  };
    4.36 -#else
    4.37 -static char *$name;
    4.38  #endif
    4.39  
    4.40  #define C_array (uint32_t *) ($name + $(($BOOTISOSZ)))
    4.41 @@ -316,7 +315,7 @@
    4.42  	done <<EOT
    4.43  READSECTORERR	Read sector failure.
    4.44  USAGE		Usage: isohybrid.exe [--list|--read] [--append cmdline] [--initrd file] file.iso [--forced|--undo|--quick|filename...]
    4.45 -OPENERR		Can't open r/w the iso file.
    4.46 +OPENERR		Can't open the iso file.
    4.47  ELTORITOERR	No EL TORITO SPECIFICATION signature.
    4.48  CATALOGERR	Invalid boot catalog.
    4.49  HYBRIDERR	No isolinux.bin hybrid signature.
    4.50 @@ -338,8 +337,51 @@
    4.51  CUSTOM_MAGIC	custom.magic
    4.52  CUSTOM_APPEND	custom.append
    4.53  CUSTOM_INITRD	custom.initrd
    4.54 +CUSTOM_HEADER	#!boot 00000000000000000000000000000000\\\\n
    4.55 +FREE_FORMAT	%ld free bytes in %04lX..%04lX\\\\n
    4.56 +USED_FORMAT	%s at %04lX (%ld bytes).\\\\n
    4.57 +CMDLINE_TAG	append=
    4.58 +INITRD_TAG	initrd:
    4.59  EOT
    4.60  done
    4.61 +	cat <<EOT
    4.62 +#ifdef __MSDOS__
    4.63 +#define BOOTISOFULLSIZE	$(($BOOTISOSZ+(64*4)+64+16+$ofs))
    4.64 +static char bootiso[BOOTISOFULLSIZE];
    4.65 +static data_fixup(void)
    4.66 +{
    4.67 +#asm
    4.68 +	push	ds
    4.69 +	push	ds
    4.70 +	pop	es
    4.71 +	mov	ax,ds
    4.72 +	sub	ax,#0x1000
    4.73 +	mov	ds,ax
    4.74 +	xor	si,si
    4.75 +scanlp:
    4.76 +	dec	si
    4.77 +	jz	copydone
    4.78 +	cmp	byte ptr [si+2],#0xEB
    4.79 +	jne	scanlp
    4.80 +	cmp	word ptr [si],#0x5A4D
    4.81 +	jne	scanlp
    4.82 +	mov	cx,#BOOTISOFULLSIZE
    4.83 +	mov	di,#_bootiso
    4.84 +	cld
    4.85 +	rep
    4.86 +	  movsb
    4.87 +copydone:
    4.88 +	pop	ds	
    4.89 +#endasm
    4.90 +	if (!bootiso[0]) {
    4.91 +		puts("No bootiso data");
    4.92 +		exit(-1);
    4.93 +	}
    4.94 +}
    4.95 +#else
    4.96 +#define data_fixup()
    4.97 +#endif
    4.98 +EOT
    4.99  	rm -rf $DATA
   4.100  	exit ;;
   4.101  --exe)
     5.1 --- a/syslinux/stuff/iso2exe/mvcom.S	Sun Feb 21 19:26:01 2016 +0000
     5.2 +++ b/syslinux/stuff/iso2exe/mvcom.S	Mon Feb 22 21:29:18 2016 +0100
     5.3 @@ -7,41 +7,35 @@
     5.4  
     5.5  	.globl	_start
     5.6  _start:
     5.7 -	movw	$0, %si		// .com size
     5.8 -	movw	$0, %bx		// .com loc
     5.9 -#if 1
    5.10 -// Move up EXE/PE and DOS/COM to ensure that bootiso[]
    5.11 -// in EXE/PE will not be affected by the DOS/COM move.
    5.12 -	pushw	%si
    5.13 -	leaw	1-64-256(%bx,%si), %cx
    5.14 -	leaw	(%bx,%si), %si
    5.15 -	movw	$0xF000, %di	// Keep 4K for stack
    5.16 -	cmpw	%si, %di
    5.17 -	jc	skip
    5.18 +	movw	$0, %cx		// .com size
    5.19 +	movw	$0, %si		// .com loc
    5.20 +	movw	$0x100, %bx
    5.21 +	leaw	15(%bx,%si), %di
    5.22 +	andw	$-16, %di
    5.23 +	addw	%cx, %si
    5.24 +	addw	%cx, %di
    5.25 +	incw	%cx
    5.26  	std
    5.27  	rep
    5.28  	  movsb
    5.29 -	subw	%si, %di
    5.30 -	addw	%di, %bx
    5.31 -skip:
    5.32 -	popw	%si
    5.33 -#endif
    5.34 -	movw	$done-install, %cx
    5.35 -	leaw	(%bx,%si), %di
    5.36 -	pushw	%si
    5.37 -	call	move
    5.38 -install:
    5.39 -	popw	%cx
    5.40 -	movw	$ORGCOM, %di
    5.41 -	pushw	%bx
    5.42 -move:
    5.43 -	popw	%si
    5.44 -	pushw	%di
    5.45 -	cld
    5.46 +	incb	%ch
    5.47 +	movw	%cx, %si	
    5.48 +	decw	%si
    5.49  	rep
    5.50  	  movsb
    5.51 -	ret
    5.52 -done:
    5.53 -	.ascii	"(www.slitaz.org)"
    5.54 +	cld
    5.55 +	incw	%di
    5.56 +	shrw	$4, %di		// 186
    5.57 +	movw	%cs, %ax
    5.58 +	addw	%di, %ax
    5.59 +	movw	%ax, %ds
    5.60 +	movw	%ax, %es
    5.61 +	movw	%ax, %ss
    5.62 +	popw	%dx
    5.63 +	pushw	%cx
    5.64 +	pushw	%ax
    5.65 +	pushw	%bx
    5.66 +	retf
    5.67 +	.ascii	"www.slitaz.org"
    5.68  	
    5.69  //	.org	64