Bitcoin Forum
May 04, 2024, 12:50:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 »  All
  Print  
Author Topic: Gentoo Linux Ebuild  (Read 21579 times)
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
August 26, 2010, 06:10:29 AM
Last edit: April 28, 2011, 11:34:20 AM by mizerydearia
 #1

bitcoin ebuilds for gentoo linux

2011.03.02: bitcoin-git-9999 ebuild updated
outdated

Come to #bitcoin-gentoo on Freenode for latest
1714827028
Hero Member
*
Offline Offline

Posts: 1714827028

View Profile Personal Message (Offline)

Ignore
1714827028
Reply with quote  #2

1714827028
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364
Merit: 6723


View Profile
August 27, 2010, 12:49:43 AM
 #2

Try -datadir=

Last time I tried $(shell /usr/bin/wx-config), there was immediate hollering about build problems with it.  There wasn't time to investigate at the time.

One problem with $(shell /usr/bin/wx-config) is it will pick up any version (wx 2.8 ) and any configuration (non-UTF-8 ) of wxWidgets that happens to be there.  -lwx_gtk2ud-2.9 only matches the right configuration.  It fails if wxWidgets was built with the wrong configuration.

Quote
Iirc, chatting in #wxwidgets on freenode, the devs there were baffled why that was used.
Did they say why they were baffled?

Quote
This is because on my system the path is /usr/include/wx-2.9/wx/wx.h
Why is it there?  Was it included by the OS, or did you have to build it?  If you built it, I wonder why it would put itself in a different place.

Has wxWidgets 2.9 finally started to become available as a debian package?

Maybe we should do this:

INCLUDEPATHS= \
 -I"/usr/local/include/wx-2.9" \
 -I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9" \
 -I"/usr/include/wx-2.9" \
 -I"/usr/lib/wx/include/gtk2-unicode-debug-static-2.9"

Again, those paths help make sure it's only 2.9 and will fail with 2.8.

wxWidgets 2.8 comes in ANSI and UTF-16, both wrong for us.  It's tempting because it's so easily available as a package; a lot of people were frustrated by it until we started hardcoding 2.9 into the makefile.
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
August 27, 2010, 05:22:35 AM
 #3

Some things:

1) Remind that you will need to fix the header.
2) wxgtk is only needed when building the gui, not the daemon (make that use flag dependable)
3) gtk+ is then dependency of wxgtk, don't ask for it yourself.
4) Check other programs if and how they use wxwidgets through eselect (you can have 2.6 and 2.8 slotted on the same system, you will need 2.9)
4) /home/bticoin?
5) Strip optimizations from the Makefile and let the user provide them (or strip them properly)
6) Don't build static code. I have a Makefile that builds dynamic code. If you want I can send it to you. You will need to make changes to it.

Valuable reading material:
http://devmanual.gentoo.org/
http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml


mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
August 27, 2010, 08:03:27 AM
Last edit: August 27, 2010, 08:22:35 AM by mizerydearia
 #4

Last time I tried $(shell /usr/bin/wx-config), there was immediate hollering about build problems with it.  There wasn't time to investigate at the time.

One problem with $(shell /usr/bin/wx-config) is it will pick up any version (wx 2.8 ) and any configuration (non-UTF-8 ) of wxWidgets that happens to be there.  -lwx_gtk2ud-2.9 only matches the right configuration.  It fails if wxWidgets was built with the wrong configuration.

For reference purpose, Gentoo has the following work-around for specific wxWidgets versions:

Code:
$ eselect wxwidgets list
Available wxWidgets profiles:
  [1]   gtk2-ansi-release-2.6
  [2]   gtk2-unicode-2.9 *
  [3]   gtk2-unicode-release-2.6
  [4]   gtk2-unicode-release-2.8

$ /usr/bin/wx-config --version
2.9.1

# eselect wxwidgets set 1

Setting wxWidgets profile to gtk2-ansi-release-2.6

$ /usr/bin/wx-config --version
2.6.4

I'm not sure about other distros though.


Quote
This is because on my system the path is /usr/include/wx-2.9/wx/wx.h
Why is it there?  Was it included by the OS, or did you have to build it?  If you built it, I wonder why it would put itself in a different place.

Quote from: bonsaikitten
<bonsaikitten> necrodearia: it is there because that's the correct location
<bonsaikitten> necrodearia: it is not in /usr/local because that's not the correct location
<bonsaikitten> further questions might be resolved by reading FHS

http://www.pathname.com/fhs/

Gentoo Linux is designed so that all (99.99%) packages are compiled from source, so yes, I compiled wxGTK using an ebuild from Portage, the Gentoo Linux package management software.


1) Remind that you will need to fix the header.
I don't understand this.  Which header?

4) /home/bticoin?
I don't see where I misspelled bitcoin.  Which file?

5) Strip optimizations from the Makefile and let the user provide them (or strip them properly)
I am uncertain what "optimizations" are.

6) Don't build static code. I have a Makefile that builds dynamic code. If you want I can send it to you. You will need to make changes to it.
I am not familiar with which parts of code are static and could be converted to dynamic.  I only prepared an ebuild because it seems nobody else has.  I am not skilled enough to perfect the ebuild, however, if anyone else would like to contribute towards making it better, I set up a git repository: http://github.com/mizerydearia/bitcoin_gentoo_ebuild
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
August 27, 2010, 06:52:53 PM
Last edit: August 27, 2010, 07:14:06 PM by BioMike
 #5

1) Remind that you will need to fix the header.
I don't understand this.  Which header?

Code:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/lightblue/lightblue-0.4.ebuild,v 1.3 2010/03/27 17:57:36 arfrever Exp $

That header Wink

4) /home/bticoin?
I don't see where I misspelled bitcoin.  Which file?

My mistake. I meant to write /home/bitcoin. My point is that this should be /var/lib/bitcoin.

5) Strip optimizations from the Makefile and let the user provide them (or strip them properly)
I am uncertain what "optimizations" are.

Things like "-msse2 -O3 -march=amdfam10". Gentoo users normally specify them themselves in /etc/make.conf.

6) Don't build static code. I have a Makefile that builds dynamic code. If you want I can send it to you. You will need to make changes to it.
I am not familiar with which parts of code are static and could be converted to dynamic.  I only prepared an ebuild because it seems nobody else has.  I am not skilled enough to perfect the ebuild, however, if anyone else would like to contribute towards making it better, I set up a git repository: http://github.com/mizerydearia/bitcoin_gentoo_ebuild

I can help you with that. One other thing that might be nice is an init.d script to start and stop the daemon at boot. <edit>oh... it's already there.</edit>
checker
Sr. Member
****
Offline Offline

Activity: 340
Merit: 252



View Profile
August 27, 2010, 09:31:30 PM
 #6

ebuild for bitcoin-9999 was updated. I had installed it just with "emerge bitcoin" .
Just synced overlay (booboo) before.
p.s. it would be excelent to make bitcoind .

Xoчeшь oтблaгoдapить - кинь биткoинoв, cкoлькo нe жaлкo- бyдy paд!
(If u want to say me thanx - give me some bitcoins Smiley )
1NXsbppu1B2exLUY8i5cYbQxbc2zWtiTAY
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
August 27, 2010, 10:39:24 PM
 #7

I used the live ebuild as a base to make a new ebuild against 0.3.10. The daemon seems to build fine, but for the graphical client I still need to adjust the Makefile (whole wxGTK part is missing there), but the ebuild already takes most of wxGTK into account. The daemon/graphical client are build on basis of use flags.
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
August 29, 2010, 04:28:56 AM
 #8

Code:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/lightblue/lightblue-0.4.ebuild,v 1.3 2010/03/27 17:57:36 arfrever Exp $

That header Wink

Oooh.

Quote from: #gentoo
<monttyle> necrodearia:  if you wrote the ebuild, I think you could remove the lines.
<monttyle> How much has to be left of the originals for it to be considered derivitave?

Quote from: #gentoo-dev-help
<necrodearia> I wrote an ebuild and released it on github.  I mistakenly left in the three lines starting with # Copyright 1999-2010 Gentoo Foundation from copying from another ebuild file.  Since I had released the file with that in the header, do I no longer own the copyright?
<necrodearia> http://bitcointalk.org/index.php?topic=930.msg11414#msg11414
<floppym> If anyone has downloaded it, you would have a difficult time suing them.
<necrodearia> That isn't my intention.  I would like to maintain gpl if I am able to.
<floppym> Also, since you copied an existing ebuild, yours would probably be considered a derrivative work under the GPL.
<necrodearia> I agree.  How can I proceed safely so that my derivation is still acceptable?  Is it okay to remove the $Header line?
<floppym> I'm not an expert on the GPL, but I believe you need to maintain a record of the original author(s).
<necrodearia> mm, I imagine so.  However, someone pointed out that I should fix the header.  I am uncertain how to "fix" it.

Any ideas on proper or best method to "fix" this?  I am not so knowledgeable of copyright.
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
August 29, 2010, 04:31:06 AM
 #9

Sent as a private message, reposting here since I am unfamiliar with how to prepare an ebuild to support foreign languages.
I had  a problem with emerging boinc-9999 - can u help me to fix it?
Quote
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_system
collect2: выпoлнeниe ld зaвepшилocь c кoдoм вoзвpaтa 1
make: *** [bitcoin] Error 1
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-p2p/bitcoin-9999/work/bitcoin-9999 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-p2p/bitcoin-9999/work/bitcoin-9999 ...
make -j3
make: *** He зaдaны цeли и нe нaйдeн make-фaйл.  Ocтaнoв.
emake failed
>>> Source compiled.
>>> Test phase [not enabled]: net-p2p/bitcoin-9999

>>> Install bitcoin-9999 into /var/tmp/portage/net-p2p/bitcoin-9999/image/ category net-p2p
!!! dobin: bitcoin does not exist
dobin failed
!!! dobin: bitcoind does not exist
dobin failed
>>> Completed installing bitcoin-9999 into /var/tmp/portage/net-p2p/bitcoin-9999/image/

 * QA Notice: file does not exist:
 *
 *    dobin: bitcoin does not exist
 *    dobin: bitcoind does not exist

>>> Installing (1 of 1) net-p2p/bitcoin-9999
>>> Auto-cleaning packages...
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12972


View Profile
August 29, 2010, 06:05:01 AM
 #10

Any ideas on proper or best method to "fix" this?  I am not so knowledgeable of copyright.

Including "Copyright 1999-2010 Gentoo Foundation" didn't assign your copyright to the Gentoo Foundation.

Looking at this, you can just remove the header (and the other comments if they're copied). It's pretty generic stuff.

If the work is not derivative, there's no legal risk in placing it under another license or even keeping full copyright. Old code will still be usable under the GPL, but new code will be under the new license only (you aren't required to put it under the GPL if you're the sole copyright holder).

For a derivative work, you would change the header to something like this:
Code:
# Copyright 2010 mizerydearia
# Distributed under the terms of the GNU General Public License v2
# Based on the ebuild for LightBlue:
# /var/cvsroot/gentoo-x86/app-mobilephone/lightblue/lightblue-0.4.ebuild,v 1.3 2010/03/27 17:57:36 arfrever Exp
# Copyright 1999-2010 Gentoo Foundation
I don't think it is derivative, though, if you remove the header.

(IANAL)

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
August 29, 2010, 06:42:02 AM
 #11

Thanks to BioMike/Myckel for pointing out http://devmanual.gentoo.org/ebuild-writing/file-format/index.html I used the official header provided at /usr/portage/header.txt
O01eg
Full Member
***
Offline Offline

Activity: 209
Merit: 100



View Profile WWW
August 31, 2010, 06:42:14 PM
 #12

Ebuild for net-p2p/bitcoin is in overlay "booboo".
http://bin.mypage.sk/FILES/bitcoin-9999-Makefile.patch is patch for makefile.unix to compile bitcoin with system boost and wxGTK.
Use overlay "dirtyepic" for wxGTK:2.9.

BC: 1LhZ2ooo1egD7wKT5pBmEhN6wpUExYek2H
"Coциaлизм -- этo экoнoмичecкaя пoлитикa тoлпы, мacc, лишeнныx пoнимaния пpиpoды экoнoмичecкoй дeятeльнocти. Coциaлиcтичecкaя тeopия ecть peзyльтaт иx пoдxoдa к экoнoмичecким вoпpocaм. Oнa coздaнa и пoддepживaeтcя тeми, для кoгo экoнoмичecкaя жизнь вpaждeбнa, ктo нe пoнимaeт ee." Людвиг фoн Mизec
"The rotter who simpers that he sees no difference between the power of the dollar and the power of the whip, ought to learn the difference on his own hide – as, I think, he will." Francisco d’Anconia
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
August 31, 2010, 07:23:31 PM
 #13

Ebuild for net-p2p/bitcoin is in overlay "booboo".
http://bin.mypage.sk/FILES/bitcoin-9999-Makefile.patch is patch for makefile.unix to compile bitcoin with system boost and wxGTK.
Use overlay "dirtyepic" for wxGTK:2.9.

wxGTK 2.9 is already in tree. I've already send mizerydearia an ebuild with makefile to build bitcoind and bitcoin based on use flags with autodetected berkdb, cflags and ldflags. Also localisation files are installed based on LINGUAS. For bitcoind init.d script is installed that seem to work fine under the bitcoin user. The ebuild isn't finished yet, but it is getting along.
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
September 02, 2010, 04:04:25 AM
 #14

http://github.com/mizerydearia/bitcoin_gentoo_ebuild
I updated bitcoin-9999.ebuild
Any feedback is appreciated.
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
September 02, 2010, 08:13:19 PM
 #15

On my side, documentation (readme and license) are installed, and a .desktop menu entry is made when the gui is installed (to start bitcoin from the menu). Did some permission fixing for /var/lib/bitcoin (daemon), but not validated yet if it is correct.
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
September 02, 2010, 08:22:58 PM
 #16

http://devmanual.gentoo.org/ebuild-writing/variables/index.html

freenode / #gentoo-dev-help:
Quote
<mizerydearia> In regards to compiling a package (bitcoin) from source and using useflags to determine whether to compile bitcoin binary (gui requiring wxwidgets-2.9) and/or bitcoind binary (daemon), which useflag method does anyone suggest: use "gui" and "daemon", use "wxwidgets" or something else?
<mizerydearia> Does it matter or is it important what useflags are used?
<mizerydearia> Perhaps it would be acceptable to use useflags "bitcoin" and "bitcoind?"
<nao> mizerydearia: maybe client and server use-flags are better?
<mizerydearia> nao, I don't think so because bitcoin is a gui-based p2p client that connects to the p2p network and bitcoind is a daemon-based p2p client that connects tot he p2p network.
<mizerydearia> Both have server and client characteristics
<nao> mizerydearia: they share some code or they are completly different?
<mizerydearia> nao: They share code
<nao> mizerydearia: they share some libs or other resources? e.g. Can you compile +gui -daemon, install it, then compile -gui +daemon and install again without collision with previous?
<mizerydearia> hmm, I used "wxidgets" and "daemon" useflags.  "wxwidgets" provides gui binary and "daemon" provides daemon and init.d/conf.d scripts
<mizerydearia> It is possible to install only the gui or only the daemon
<nao> mizerydearia: IMHO wxidgets is not the best variant, maybe use "gui"?
<mizerydearia> hmm, really?  I thought it was better than gui
<nao> mizerydearia: gui is more generic
<mizerydearia> And in the case in future that a second gui is available to be compiled that isn't reliant on wxwidgets, then how to separate them?
<mizerydearia> gui2?
<nao> mizerydearia: hm... seems you are right
<nao> mizerydearia: can this package be splitted into two?
<nao> two separate ebuild
<nao> ebuilds
<mizerydearia> I suppose, but they would download content from same repository and use same files
<mizerydearia> and there only be very minor difference in indicating to build bitcoind or bitcoin binary.
<mizerydearia> It would seem pointless to split into two.
<mizerydearia> dry (don't repeat yourself)?
<nao> mizerydearia: IMHO, if files are not overlap... splitting may be useful
<mizerydearia> nao, Can you provide examples of ebuilds in portage that have been split?
<nao> mizerydearia: dev-games/renpy -> dev-games/renpy, dev-games/renpy-modules is splitted by me in sunrise Wink
<mizerydearia> Any examples in portage?
<mizerydearia> in main?  not sure of name
<nao> mizerydearia: but no, there was a special reason for that
<nao> mizerydearia: try this:
<nao> mizerydearia: cat /var/db/pkg/*/*/SRC_URI | tr ' ' '\n' | grep '^http\|^ftp\|^mirror' | sed 's@^.*/\([^/]*\)$@\1@' | sort | uniq -dc | sort -n
<nao> mizerydearia: hmm... there are some bug in my script;) wait...
<nao> mizerydearia: *-ant packages, vim-core and gvim
<nao> mizerydearia: i.e. splitting is not used widely
<mizerydearia> I agree
<nao> mizerydearia: then not forget to test if at last one of the flags enabled
<nao> mizerydearia: you can use confutils.eclass for that

Quote
<mizerydearia> nao, Here is the ebuild.  How does it look? http://github.com/mizerydearia/bitcoin_gentoo_ebuild/blob/master/net-p2p/bitcoin/bitcoin-9999.ebuild
<nao> mizerydearia: The name of ebuild (package) can be removed from description
<nao> mizerydearia: Add / to the end of HOMEPAGE
<nao> mizerydearia: bitcoin in SRC_URI can be replaced by ${PN}
<nao> mizerydearia: sort DEPEND
<nao> mizerydearia: min version of app-admin/eselect-wxwidgets in portage is 1.1, so you can drop version
<nao> mizerydearia: using ${PN} in enewuser... don`t know, better to ask someone on the channel
<nao> mizerydearia: don`t use 'cd trunk', you can set S variable for that
<nao> mizerydearia: try to use emake instead of make
<mizerydearia> S variable?
<mizerydearia> $ grep "enewuser.*PN" */*/*.ebuild
<mizerydearia> Shows a couple packages using ${PN}
<mizerydearia> Not too many though
<mizerydearia> nao, Thanks for tips.  Anything else?
<nao> mizerydearia: lines 45,46 can be expanded to more lines
<nao> mizerydearia: inlines with if fi is not readable
<nao> mizerydearia: nls? needs gettext, or maybe virtual/libintl
<mizerydearia> Which is better to rely on: sys-devel/gettext or virtual/libintl?
<mizerydearia> I'll use sys-devel/gettext
<nao> mizerydearia: don`t know. but many of ebuilds in portage rely on sys-devel/gettext
<nao> mizerydearia: I just found 'domo' helper Smiley you can use it for .mo files
<mizerydearia> mm, domo?
<nao> mizerydearia: And, I think, if LINGUAS is not set, you need to install all mo files
<mizerydearia> ah
<mizerydearia> Only a few ebuilds use domo
<mizerydearia> Very few even
<nao> mizerydearia: yes, but you can use it:)
<nao> mizerydearia: don`t know much about stuff on lines 56-70. hope you know it better
<nao> mizerydearia: I don`t have more comments on your ebuild
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
September 03, 2010, 05:11:59 AM
 #17

Some interesting tips in there (last part), especially the domo command. The gui/daemon flags aren't a big issue currently. Development of an ebuild isn't working to an end point, but always ongoing. Splitting isn't useful here, can be done, but the package is IMHO to small for a split.
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
September 04, 2010, 07:51:04 AM
 #18

domo is not usable in this case (bitcoin doesn't use the standard gettext localisation (po) dir). Bitcoin doesn't handle gettext directly, as far as I can see, so no dependency on gettext.
BioMike
Legendary
*
Offline Offline

Activity: 1658
Merit: 1001


View Profile
September 05, 2010, 10:33:29 AM
 #19

My current ebuild is now also available from github. Smiley

Please test.
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
September 05, 2010, 06:30:57 PM
Last edit: September 05, 2010, 08:02:36 PM by mizerydearia
 #20

You should specify which ebuild is yours so that others know.  Currently there are two ebuild versions in the repository.

You should specify which ebuild is yours so that others know.  Currently there are two ebuild versions in the repository.

Message says:
"bitcoin-0.3.11 ebuild from BioMike"

Ah, I didn't check git repository
Pages: [1] 2 3 4 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!