You are not logged in.
Hello community,
I'm trying to create my first PKGBUILD and having some trouble. Here is the PKGBUILD:
# Contributor: Michael Kogan <michael dot kogan at gmx dot net>
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=('bison' 'flex' 'glibc' 'gcc-libs' 'wxgtk-2.6')
source=(http://graph.seul.org/$pkgname-$pkgver.tar.gz)
md5sums=('486df5c84ec85ff8470d6304c1a69c98')
build() {
cd "$startdir/src/$pkgname-$pkgver"
./configure --prefix=/usr --with-wx-config=/usr/bin/wx-config-2.6
make || return 1
make prefix=$startdir/pkg/usr install || return 1
}
configure and make run fine but the make install part brings some errors:
make[1]: Entering directory `/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src'
/bin/install -c -d /usr/bin/
/bin/install -c -s -m 755 graphthing /usr/bin/
/bin/install: cannot create regular file `/usr/bin/graphthing': Permission denied
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/photon/PKGBUILDs/graphthing/src/graphthing-1.3.2/src'
make: *** [install] Error 2
==> ERROR: Build Failed.
Aborting...
I've searched for this error on the net and found following: http://www.nabble.com/hsftp-build-error-td23845852.html But I don't really understand how to fix this...
PhotonX
Last edited by PhotonX (2012-09-29 12:32:28)
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
replace the last line
make prefix=$startdir/pkg/usr install || return 1
with this
make DESTDIR=${pkgdir} install || return 1
The first one seems not to respekt fakeroot.
Last edited by flamelab (2009-08-15 17:14:45)
Offline
Nope, unfortunately the same error with the replaced line.
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
Hello PhotonX!
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.
Offline
Yes, with sudo it surely works but it should work without it, I think... Why should the depends line be removed? namcap hasn't said anything about it when I run it.
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
You should never run makepkg as root or with sudo. Check your package content. It's empty. The files were installed directly on your system without pacman's knowledge. Use the PKGBUILD below. You'll probably have file conflict when installing it. If so, use the -f option. I removed 'bison' 'flex' 'glibc' 'gcc-libs' from the depends because they are part of base. It is assumed that everyone has base 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
}
Offline
Hmm, I didn't have flex and bison installed on my system until now...
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
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.
Offline
Ah, I see. So what to do now with this PKGBUILD to make it accessible through the AUR?
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
get a AUR account if you don't have one and submit the PKGBUILD: http://wiki.archlinux.org/index.php/AUR … NSUPPORTED
Offline
Ok, I think everything should be correct. Please check: http://aur.archlinux.org/packages.php?ID=29314
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
Ok, I think everything should be correct. Please check: http://aur.archlinux.org/packages.php?ID=29314
Looks good.
Offline
Thanks for your support!
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
Hi, since wxgtk-2.6 disappeared from the repositories I wanted to fix graphthing to work with wxgtk 2.8. This was no big deal but I have build errors again... If I run make manually it runs smoothly, but calling it via makepkg gives an error.
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
}
Last edited by PhotonX (2010-09-24 10:16:44)
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
Still not solved, please help!
*bump*
Last edited by PhotonX (2010-10-21 15:48:56)
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
The never ending story continues. I have some time now to work on this package again. The current state is that it compiles well with the newest g++ and wxgtk but tha "make install" command fails with
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
Last edited by PhotonX (2012-09-29 11:06:59)
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline
Your sed lines damage the install directives. This can be prevented as follows, or by using more appropriate sed commands in the first place.
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
}
Last edited by Trilby (2012-09-29 12:17:24)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Thanks, works fine now! Really strange that it worked for a long time with the two sed lines.
Desktop: http://www.sysprofile.de/id15562, Arch Linux | Notebook: Thinkpad L13 Yoga Gen2, Manjaro
The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work. - Tuomas Lukka
Offline