You are not logged in.

#1 2009-06-19 08:10:36

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

GNUDoQ 0.94 (solved)

Hey, guys.

Knowing me, I've probably missed something really obvious... please don't make me get a flame-retardant suit big_smile

I tried to make a PKGBUILD for GNUDoQ (which is based on GNUDoku, but better) just for fun. I've used it on other platforms, and an Arch package doesn't seem to exist yet. I appear to have failed miserably, however.

This is what I've got:

pkgname=GNUDoQ
pkgver=0.94
pkgrel=1
pkgdesc="An open source, graphical Su Doku generator and solver with printer/PDF support"
arch=('i686' 'x86_64')
url="http://www.thelemmings.net/static.php?page=GNUDoQ"
license=('GPL')
depends=('glibc>=2.7-1' 'gcc>=4.1.1' 'qt4>=4.3.3' 'libstdc++5>=3.3.6-3')
source=(http://www.thelemmings.net/projects/$pkgname-$pkgver.tar.bz2)
md5sums=('237c854161a66ecf0fc4ee867d3c9d48') #generate with 'makepkg -g'
build() {
  cd "$srcdir/GNUDoku-$pkgver"
qmake
make
make DESTDIR="$pkgdir/" install
}

I get the following errors when I try to run makepg -c:

sudoku.C:43: error: 'memset' was not declared in this scope
make: *** [sudoku.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from GNUDoQ.C:28:
GNUDoku.xpm:160: warning: deprecated conversion from string constant to 'char*'
GNUDoku.xpm:160: warning: deprecated conversion from string constant to 'char*'
GNUDoku.xpm:160: warning: deprecated conversion from string constant to 'char*'

lots and lots of times on the same line (160), until

make: Nothing to be done for `install'.
==> Tidying install...
  -> Compressing man pages...
  -> Stripping debugging symbols from binaries and libraries...
==> Creating package...
  -> Generating .PKGINFO file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: GNUDoQ 0.94-1 x86_64 (Fri Jun 19 03:21:51 EDT 2009)
==> Cleaning up...

As might be expected, the package is a dud; apparently installs, but doesn't do anything. What have I done?

(Note: the line  cd "$srcdir/GNUDoku-$pkgver" is correct, since that is the name of the folder inside the tarball -- dev never changed it, I guess.)

Also, you've probably noticed that I didn't put GNUDoQ in lowercase like the Wiki suggests. I wasn't sure how to do this and still manage to pull the tarball from the developer's server, since he uses mixed case letters.

I've had fun so far, at least smile

It's worth noting that when I was googling around for dependencies, Ubuntu listed libstdc++6>= 4.2.1-4. Might it be in [testing], for us? the newest version I can see -- and I've got [testing] disabled -- is extra/libstdc++5 3.3.6-3, so that is what I put.

Thanks in advance!

Last edited by cautha (2010-05-09 13:23:43)

Offline

#2 2009-06-19 12:35:57

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: GNUDoQ 0.94 (solved)

1. The $pkgname should be gnudoq. If you really need a variable to point to the upstream name, choose _pkgname.
2.

sudoku.C:43: error: 'memset' was not declared in this scope

This file (and maybe others) needs patching. If I remember right, #include <cstdio> has to be put in.
3. qmake IMHO needs a .pro-file as parameter. Also try make PREFIX=/usr
4. Is there anything in $pkgdir? (ls -R)

Offline

#3 2009-06-20 04:20:37

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: GNUDoQ 0.94 (solved)

I did try using the .pro file, but I got the same error. I'll try putting it back in and patching the file(s) smile

EDIT: #include <cstdio> is already in the file. We'll see if this works...

I just realized that $pkgdir/ doesn't mean anything, since I changed "$srcdir/$pkgdir-$pkgver" to read "$srcdir/GNUDoku-$pkgver". I'll try to get it working, and then report back big_smile

Offline

#4 2009-06-20 06:07:54

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: GNUDoQ 0.94 (solved)

Sorry  for the double post. I think I've figured out the cause of the errors: sudoku.C needs the line "#include <cstring>"; however, it still doesn't seem  to produce anything sad The resulting pkg.tar.gz is still empty.

EDIT: OMG I now have a binary! How did that get there? I've been doing this many times, and I've never seen that before big_smile The pkg.tar.gz is still empty, though. Could it be significant that "pkg" is empty, and everything is in "src/GNUDoku-0.94"?

This is what I've got now. Is there a way to make the PKGBUILD apply that small patch automagically? So far, I've been doing makepkg -o, changing the file manually, and then running makepkg -fe. (I only had to change sudoku.C)

snip

EDIT 2: Figured out how to patch the file, but I still can't get anything to go into the "pkg" dir to be repackaged.

This is rev. 3:

# Contributor: Harry Bellemare <h.bellemare@gmail.com>
pkgname=gnudoq
pkgname_=GNUDoQ
pkgver=0.94
pkgrel=3
pkgdesc="An open source, graphical Su Doku generator and solver with printer/PDF support"
arch=('i686' 'x86_64')
url="http://www.thelemmings.net/static.php?page=GNUDoQ"
license=('GPL')
depends=('glibc>=2.7-1' 'gcc>=4.1.1' 'qt4>=4.3.3' 'libstdc++5>=3.3.6-3')
source=(http://www.thelemmings.net/projects/$pkgname_-$pkgver.tar.bz2)
md5sums=('237c854161a66ecf0fc4ee867d3c9d48')
build() {
cd GNUDoku-$pkgver
# README file says to delete the following 2 files
rm GNUDoku.C sudoku-solve-test.c
# Patch sudoku.C
echo "#include <cstring>" >> patch && cat sudoku.C >> patch
rm sudoku.C && mv patch sudoku.C
qmake $pkgname_.pro
make
make PREFIX=/usr install
}

Last edited by cautha (2009-06-20 07:09:29)

Offline

#5 2009-06-20 13:52:50

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: GNUDoQ 0.94 (solved)

cautha wrote:

EDIT 2: Figured out how to patch the file, but I still can't get anything to go into the "pkg" dir to be repackaged.

The reason for that is quite simple, if you look at the Makefile or try make install manually you will see the following:

make: Nothing to be done for `install'.

in other words there are no install instructions in the Makefile. Now don't ask me why they tell you to call make install in the README, probably for the same reason that Makefile.gtkmm and GNUDoku.desktop go around looking for a binary named GNUDoku. Since the only things you need to install seem to be the binary and desktop file/icon (if you need those) you might as well just copy them to the correct locations in $pkgdir by hand using install. However since the upstream .desktop file points at the wrong binary you will have to patch it if you want one.

A few comments about your PKGBUILD:

# Contributor: Harry Bellemare <h.bellemare@gmail.com>
pkgname=gnudoq
pkgname_=GNUDoQ               

 well normally you call it _pkgname

pkgver=0.94
pkgrel=3   
pkgdesc="An open source, graphical Su Doku generator and solver with printer/PDF support"
arch=('i686' 'x86_64')
url="http://www.thelemmings.net/static.php?page=GNUDoQ"
license=('GPL')
depends=('glibc>=2.7-1' 'gcc>=4.1.1' 'qt4>=4.3.3' 'libstdc++5>=3.3.6-3')    

 You don't have to explicitly state members of base and base-devel as depends/makedepends.
 even if you do: gcc is a makedepend, not a depend. 
 libstdc++ is in the gcc-libs package, libstdc++5 is definitely not a depend for this.
 This means the only depend is qt4, which became the qt package a long time ago.

source=(http://www.thelemmings.net/projects/$pkgname_-$pkgver.tar.bz2)
md5sums=('237c854161a66ecf0fc4ee867d3c9d48')
build() {
cd GNUDoku-$pkgver 

 I think you are missing $srcdir/

# README file says to delete the following 2 files
rm GNUDoku.C sudoku-solve-test.c   

 read the README again. You are supposed to delete them from the *.pro file, not to delete the files.
 they are not in the *.pro file anyway, so you can probably ignore this section of the README

# Patch sudoku.C
echo "#include <cstring>" >> patch && cat sudoku.C >> patch
rm sudoku.C && mv patch sudoku.C

 This is really ugly.
 The proper way to do this would be producing a patch using diff, putting the patch in your source array 
 and then applying the patch using patch.
 Alternatively you can use sed for small changes, but please don't "patch" like this

qmake $pkgname_.pro 
make
  
  It is considered good practice to add || return 1 so makepkg aborts if make fails, same for make install

make PREFIX=/usr install 

 As I said there are no install instructions in the Makefile, if there were, $pkgdir should come up 
 somewhere (otherwise how would make  know that it should put the files there)

}

Last edited by Garns (2009-06-20 13:54:49)

Offline

#6 2009-06-20 17:49:22

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: GNUDoQ 0.94 (solved)

I appreciate your help. One thing that sticks out to me, though, is that if the files I removed aren't in the *.pro file (which is the first place I looked, persuant to the readme), then why should they exist at all? That is why I got rid of them.

When I use $srcdir and run makepkg a few times as I'm testing the PKGBUILD, I end up with multiple nested folders each containing the source underneath "src". Don't ask me why, but that is why I didn't use it.

The folder contained in the upstream tarball doesn't follow the convention $pkgname-$pkgver; I read somewhere that $pkgdir is an alias for $srcdir/$pkgname-$pkgver, which, I think, is probably why I haven't been able to use it  to any effect. (Just because what I posted looks a certain way, it doesn't mean I haven't tried other iterations throughout the process.)

As far as the "patch" goes, it's one line. I thought about doing it the "proper" way, but I didn't really want to have to learn to use diff for that. If someone wants to fix it, he/she is welcome to do so.

I will update the PKGBUILD with your suggestions, but I'll probably leave $pkgrel the same to avoid inflating it unnecessarily.

Last edited by cautha (2009-06-20 17:51:06)

Offline

#7 2009-06-20 19:19:59

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: GNUDoQ 0.94 (solved)

Against my better judgement big_smile I made a *.diff file (patch.diff):

--- /home/harry/sudoku.C    2009-06-20 14:21:19.000000000 -0400
+++ /home/harry/sudoku.C.patched    2009-06-20 14:25:14.000000000 -0400
@@ -4,13 +4,12 @@
 * jcspray@icculus.org
 */
 
-//#include "GNUDoku.H"
 #include "sudoku.H"
 
 #include <cstdio>
 #include <cstdlib>
 #include <ctime>
-
+#include <cstring>
 #include <map>
 namespace sudoku
 {

Now, the PKGBUILD looks like this; the binary & .PKGINFO are placed in the package, but installing it with pacman does nothing. Still, I guess that's better than a kick in the pants.

# Contributor: Harry Bellemare <h.bellemare@gmail.com>
pkgname=gnudoq
_pkgname=GNUDoQ
pkgver=0.94
pkgrel=3
pkgdesc="An open source, graphical Su Doku generator and solver with printer/PDF support"
arch=('i686' 'x86_64')
url="http://www.thelemmings.net/static.php?page=GNUDoQ"
license=('GPL')
depends=('qt')
source=(http://www.thelemmings.net/projects/$_pkgname-$pkgver.tar.bz2
patch.diff)
md5sums=('237c854161a66ecf0fc4ee867d3c9d48'
         '6167156f9eb9d5133fe03293ca8acf56')
build() {
cd $srcdir/GNUDoku-$pkgver
patch -Np1 -i ../patch.diff sudoku.C || return 1
# README file says to delete the following 2 files
rm GNUDoku.C sudoku-solve-test.c
qmake $_pkgname.pro || return 1
make || return 1
make DESTDIR=/usr install || return 1
install -D $srcdir/GNUDoku-$pkgver/$_pkgname $startdir/pkg/$_pkgname
}

Last edited by cautha (2009-06-20 19:21:08)

Offline

#8 2009-06-21 13:00:43

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: GNUDoQ 0.94 (solved)

cautha wrote:

I appreciate your help. One thing that sticks out to me, though, is that if the files I removed aren't in the *.pro file (which is the first place I looked, persuant to the readme), then why should they exist at all? That is why I got rid of them.

As I said they probably were in the .pro file some time ago and the readme was never updated, it certainly doesn't hurt having them lying around so you don't have to delete them.

When I use $srcdir and run makepkg a few times as I'm testing the PKGBUILD, I end up with multiple nested folders each containing the source underneath "src". Don't ask me why, but that is why I didn't use it.

The folder contained in the upstream tarball doesn't follow the convention $pkgname-$pkgver; I read somewhere that $pkgdir is an alias for $srcdir/$pkgname-$pkgver, which, I think, is probably why I haven't been able to use it  to any effect. (Just because what I posted looks a certain way, it doesn't mean I haven't tried other iterations throughout the process.)

man PKGBUILD wrote:

pkgdir
           This points to the directory where makepkg bundles the installed package (this directory will become
           the root directory of your built package). Although it currently is an alias for $startdir/pkg, this
           assumption should not be assumed true for all future revisions of makepkg.

You might want to put the binary into $pkgdir/usr/bin and you can remove the make install line, it doesn't do anything.

Offline

#9 2010-05-09 13:22:42

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: GNUDoQ 0.94 (solved)

Wow, time flies. Sorry for the necro, but I finally got my PKGBUILD to work, after losing interest in it for ages... the day that I originally decided to do it, I must not have had any coffee---either that, or I needed to work on my reading comprehension smile

Thank you, Garns, for your patience. I feel a little stupid, now, but I'm glad it works, and I'm glad to be able to contribute something.

PKGBUILD wrote:

# Contributor: Harry Bellemare <h.bellemare@gmail.com>
pkgname=gnudoq
_pkgname=GNUDoQ
pkgver=0.94
pkgrel=1
pkgdesc="An open source, graphical Su Doku generator and solver with printer/PDF support"
arch=('i686' 'x86_64')
url="http://www.thelemmings.net/static.php?page=GNUDoQ"
license=('GPL')
depends=('qt')
source=(http://www.thelemmings.net/projects/$_pkgname-$pkgver.tar.bz2
patch.diff)
md5sums=('237c854161a66ecf0fc4ee867d3c9d48'
         '01f56b4d0fc52e114f81dd5db83c662e')
build() {
cd $srcdir/GNUDoku-$pkgver
patch -Np1 -i ../patch.diff sudoku.C || return 1
qmake $_pkgname.pro || return 1
make || return 1
install -D $srcdir/GNUDoku-$pkgver/$_pkgname $pkgdir/usr/bin/$pkgname
}

patch.diff wrote:

--- sudoku.C    2005-12-19 10:41:49.000000000 -0500
+++ sudoku.C.patched    2010-05-09 08:50:50.000000000 -0400
@@ -10,7 +10,7 @@
#include <cstdio>
#include <cstdlib>
#include <ctime>
-
+#include <cstring>
#include <map>
namespace sudoku
{

It certainly doesn't help that I picked a package with really strange naming conventions for its files (i.e. capitalization, GNUDoku/DoQ), but hopefully it will encourage me to pay closer attention in the future. Now, time to go submit it big_smile

H

Last edited by cautha (2010-05-09 14:06:53)

Offline

Board footer

Powered by FluxBB