build() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 -i "../../stuff.patch"
sed -i 's|wxHIDE_READONLY|wxFD_DEFAULT_STYLE|' src/fancyfileselection.cc || return 1
./configure --prefix=/usr
sed -i 's|/usr/bin/install|install|' src/GNUmakefile || return 1
sed -i 's|/usr/bin/install|install|' GNUmakefile || return 1
sed -i 's|/usr/bin|$(DESTDIR)/usr/bin|' src/GNUmakefile || return 1
sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1
make || return 1
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR=$pkgdir install || return 1
}
I've also put the make install command into the package function where it belongs. PKGBUILDS should not install from build.
Edit: here's the proper excerpt that avoids the extra seds:
build() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 -i "../../stuff.patch"
sed -i 's|wxHIDE_READONLY|wxFD_DEFAULT_STYLE|' src/fancyfileselection.cc || return 1
./configure --prefix=/usr
sed -i 's|/usr/bin/$|$(DESTDIR)/usr/bin/|' src/GNUmakefile || return 1
sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1
make || return 1
}
make[1]: Entering directory `/home/photon/PKGBUILDS/graphthing/src/graphthing-1.3.2/src'
/home/photon/PKGBUILDS/graphthing/pkg/usr/bin/install -c -d /usr/bin/
make[1]: /home/photon/PKGBUILDS/graphthing/pkg/usr/bin/install: Command not found
make[1]: *** [install] Error 127
make[1]: Leaving directory `/home/photon/PKGBUILDS/graphthing/src/graphthing-1.3.2/src'
make: *** [install] Error 2
So it searches for /usr/bin/install ins pkg/usr/bin/install for some reason. I'm somewhat at my wits' end, since in the make install part everything is quite standard... Currently the PKGBUILD looks like this:
# Maintainer: Michael Kogan <michael dot kogan at gmx dot net>
pkgname=graphthing
pkgver=1.3.2
pkgrel=4
pkgdesc="A tool that allows you to create, manipulate and study graphs"
arch=('i686' 'x86_64')
url="http://graph.seul.org/"
license=('GPL')
depends=('wxgtk' 'libpng12' 'libjpeg7')
makedepends=('flex')
source=("http://graph.seul.org/$pkgname-$pkgver.tar.gz" "stuff.patch")
md5sums=('486df5c84ec85ff8470d6304c1a69c98' '82fd31e240984e9aef34258e545a08d2')
sha1sums=('e9cb8e238ac510be881de8eb8ad1078725019627' '5394f5b93607da337a2b737bc38a6b0174d67d84')
build() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 -i "$srcdir/stuff.patch"
./configure --prefix=/usr
sed -i 's|/usr/bin|$(DESTDIR)/usr/bin|' src/GNUmakefile || return 1
sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1
make || return 1
make DESTDIR="$pkgdir" install || return 1
}
where stuff.patch only patches source files (nothing build related):
diff -rupN graphthing-1.3.2_orig/src/fancyfileselection.cc graphthing-1.3.2/src/fancyfileselection.cc
--- graphthing-1.3.2_orig/src/fancyfileselection.cc 2006-09-11 03:32:12.000000000 +0200
+++ graphthing-1.3.2/src/fancyfileselection.cc 2012-09-29 10:14:50.147565457 +0200
@@ -27,7 +27,7 @@ FancyFileSelection::FancyFileSelection (
: wxFileDialog (parent, title, wxT(""), wxT(""), wxT("*.*"), style)
{
if (style & wxOPEN)
- style |= wxHIDE_READONLY;
+ style |= wxFD_DEFAULT_STYLE;
else if (style & wxSAVE)
style |= wxOVERWRITE_PROMPT;
SetStyle (style);
diff -rupN graphthing-1.3.2_orig/src/gt-bison.y graphthing-1.3.2/src/gt-bison.y
--- graphthing-1.3.2_orig/src/gt-bison.y 2006-09-11 03:32:12.000000000 +0200
+++ graphthing-1.3.2/src/gt-bison.y 2012-09-29 10:15:10.410433971 +0200
@@ -18,7 +18,7 @@ Edge *e;
extern char *yy_gt_text;
-int yy_gt_error (char *s);
+int yy_gt_error (const char *s);
int yy_gt_lex (void);
%}
@@ -132,7 +132,7 @@ edge_property:
%%
-int yy_gt_error (char *s)
+int yy_gt_error (const char *s)
{
fprintf (stderr, "gt-parse: %s in line %i, at symbol \"%s\"\n",
s, gt_lineno, yy_gt_text);
diff -rupN graphthing-1.3.2_orig/src/lang-bison.y graphthing-1.3.2/src/lang-bison.y
--- graphthing-1.3.2_orig/src/lang-bison.y 2006-09-11 03:32:12.000000000 +0200
+++ graphthing-1.3.2/src/lang-bison.y 2012-09-29 10:15:29.009983780 +0200
@@ -15,7 +15,7 @@ int lang_lineno = 1;
std::stack<PhraseBlock *> pbs;
-int yy_lang_error (char *s);
+int yy_lang_error (const char *s);
int yy_lang_lex (void);
%}
@@ -121,7 +121,7 @@ phrase:
extern char *yy_lang_text;
-int yy_lang_error (char *s)
+int yy_lang_error (const char *s)
{
fprintf (stderr, "lang-parse: %s in line %i, at symbol \"%s\"\n",
s, lang_lineno, yy_lang_text);
Thanks for any hint,
PhotonX
*bump*
]]>Current PKGBUILD:
build() {
cd "$startdir/src/$pkgname-$pkgver"
sed -i 's|wxHIDE_READONLY|wxFD_DEFAULT_STYLE|' src/fancyfileselection.cc || return 1 # wxgtk fix
./configure --prefix=/usr
# sed -i 's|/usr/bin|$(DESTDIR)/usr/bin|' src/GNUmakefile || return 1 # commented out to make sure
# sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1 # that it doesn't cause the error
make || return 1
make DESTDIR=$pkgdir install || return 1
}
I get following linking error when running makepkg:
Linking graphthing
edge.o: In function `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Edge const&)':
edge.cc:(.text+0x3df): undefined reference to `wxString::mb_str(wxMBConv&) const'
edge.cc:(.text+0x405): undefined reference to `wxString::mb_str(wxMBConv&) const'
vertex.o: In function `Vertex::Vertex(char*, int, int)':
vertex.cc:(.text+0x335): undefined reference to `wxString::wxString(char const*, wxMBConv&, unsigned long)'
vertex.o: In function `Vertex::Vertex(char*, int, int)':
vertex.cc:(.text+0x3c5): undefined reference to `wxString::wxString(char const*, wxMBConv&, unsigned long)'
vertex.o: In function `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Vertex const&)':
vertex.cc:(.text+0x492): undefined reference to `wxString::mb_str(wxMBConv&) const'
gt-bison.tab.o: In function `yy_gt_parse()':
/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src/gt-bison.y:65: undefined reference to `wxString::wxString(char const*, wxMBConv&, unsigned long)'
/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src/gt-bison.y:65: undefined reference to `wxString::wxString(char const*, wxMBConv&, unsigned long)'
lang-flex.yy.o: In function `yy_lang_lex()':
/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src/lang-flex.l:68: undefined reference to `wxString::wxString(char const*, wxMBConv&, unsigned long)'
collect2: ld returned 1 exit status
make[1]: *** [graphthing] Error 1
make[1]: Leaving directory `/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src'
make: *** [all] Error 2
That's how the linking looks like when running make manually:
gt-bison.y -> gt-bison.tab.cc
gt-bison.tab.cc -> gt-bison.tab.o
gt-bison.y: In Funktion »int yy_gt_parse()«:
gt-bison.y:95:34: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
gt-bison.y:100:34: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
gt-bison.tab.cc:1560:34: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
gt-bison.tab.cc:1675:35: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
lang-bison.y -> lang-bison.tab.cc
lang-bison.tab.cc -> lang-bison.tab.o
lang-bison.tab.cc: In Funktion »int yy_lang_parse()«:
lang-bison.tab.cc:1545:34: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
lang-bison.tab.cc:1660:35: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
gt-flex.l -> gt-flex.yy.c
gt-flex.yy.c -> gt-flex.yy.o
lang-flex.l -> lang-flex.yy.c
lang-flex.yy.c -> lang-flex.yy.o
Linking graphthing
rm gt-flex.yy.c gt-bison.tab.cc lang-flex.yy.c lang-bison.tab.cc
make[1]: Leaving directory `/home/photon/Desktop/graphthing-1.3.2/src'
---------------------------------------------------
GraphThing is now compiled.[...]
---------------------------------------------------
I checked which files were generated by configure. There are four files, three of them are identical in both compile methods while one, namely src/GNUmakefile, differs a bit:
photon@photon-desktop:~/Desktop$ diff src/GNUmakefile_FAILING src/GNUmakefile_WORKING
10,11c10,11
< CFLAGS = -march=x86-64 -mtune=generic -O2 -pipe
< CXXFLAGS = -march=x86-64 -mtune=generic -O2 -pipe \
---
> CFLAGS = -g -O2
> CXXFLAGS = -g -O2 \
######### seems to cause the error ##############
13c13
< LDFLAGS = -Wl,--hash-style=gnu -Wl,--as-needed
---
> LDFLAGS =
#############################################
67c67
< @g++ -march=x86-64 -mtune=generic -O2 -pipe -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O -g -c $< -o $@
---
> @g++ -g -O2 -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O -g -c $< -o $@
70c70
< @g++ -march=x86-64 -mtune=generic -O2 -pipe -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O -g -c $< -o $@
---
> @g++ -g -O2 -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -O -g -c $< -o $@
I have no idea why the makefiles are different since everything is identical otherwise... The only difference that I don't understand is line 13 since everything else is just optimizing stuff... Does anyone have a hint?
Thanks,
Photon
edit: Of course I could sed this line but I'm afraid that there could be problems since the files are generated to fit the user's system...
edit2: I tried to change line 13, but it didn't solve the problem. So in fact you can see the files as identical...
edit3: Even using the working GNUmakefile doesn't solve the problem!
build() {
cd "$startdir/src/$pkgname-$pkgver"
sed -i 's|wxHIDE_READONLY|wxFD_DEFAULT_STYLE|' src/fancyfileselection.cc || return 1
./configure --prefix=/usr
cp ~/Desktop/graphthing-1.3.2/src/GNUmakefile src/GNUmakefile ## take the working GNUmakefile
# sed -i 's|/usr/bin|$(DESTDIR)/usr/bin|' src/GNUmakefile || return 1
# sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1
make || return 1
make DESTDIR=$pkgdir install || return 1
}
Ok, I think everything should be correct. Please check: http://aur.archlinux.org/packages.php?ID=29314
Looks good.
]]>Hmm, I didn't have flex and bison installed on my system until now...
These are in the base-devel group. It is assumed that users who builds packages have base-devel installed.
]]>pkgname=graphthing
pkgver=1.3.2
pkgrel=1
pkgdesc="A tool that allows you to create, manipulate and study graphs"
arch=('i686' 'x86_64')
url="http://graph.seul.org/"
license=('GPL')
depends=('wxgtk-2.6')
source=(http://graph.seul.org/$pkgname-$pkgver.tar.gz)
md5sums=('486df5c84ec85ff8470d6304c1a69c98')
sha1sums=('e9cb8e238ac510be881de8eb8ad1078725019627')
build() {
cd "$startdir/src/$pkgname-$pkgver"
./configure --prefix=/usr --with-wx-config=/usr/bin/wx-config-2.6
sed -i 's|/usr/bin|$(DESTDIR)/usr/bin|' src/GNUmakefile || return 1
sed -i 's|${prefix}|$(DESTDIR)/${prefix}|' GNUmakefile || return 1
make || return 1
make DESTDIR=$pkgdir install || return 1
}
I just try to help you in syntactical things:
1. You will be the maintainer.
2. $startdir/src -> $srcdir
3. depends=('bison' 'flex' 'glibc' 'gcc-libs' 'wxgtk-2.6') -> Remove this line, because namcap say it.
Logical/Functional:
GraphThing is now compiled. It can be executed
by running it directly as:
src/graphthing
or by installing it:
make install
Installing may require superuser privileges.
It works for me in root mode, so with sudo.
]]>