public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-p2p/bitcoind/files: 0.8.2-sys_leveldb.patch
@ 2013-06-14 18:49 Anthony G. Basile (blueness)
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile (blueness) @ 2013-06-14 18:49 UTC (permalink / raw
  To: gentoo-commits

blueness    13/06/14 18:49:59

  Added:                0.8.2-sys_leveldb.patch
  Log:
  Version bumps
  
  (Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

Revision  Changes    Path
1.1                  net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch?rev=1.1&content-type=text/plain

Index: 0.8.2-sys_leveldb.patch
===================================================================
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
index cf80986..520b5df 100644
--- a/bitcoin-qt.pro
+++ b/bitcoin-qt.pro
@@ -4,7 +4,7 @@ macx:TARGET = "Bitcoin-Qt"
 VERSION = 0.8.0
 INCLUDEPATH += src src/json src/qt
 QT += network
-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
+DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
 CONFIG += no_include_pwd
 CONFIG += thread
 
@@ -98,25 +98,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
     QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
 }
 
+contains(USE_SYSTEM_LEVELDB, 1) {
+    LIBS += -lleveldb
+} else {
 INCLUDEPATH += src/leveldb/include src/leveldb/helpers
-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
+LIBS += $$PWD/src/leveldb/libleveldb.a
 !win32 {
     # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
-    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
+    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
 } else {
     # make an educated guess about what the ranlib command is called
     isEmpty(QMAKE_RANLIB) {
         QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
     }
     LIBS += -lshlwapi
-    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
+    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
 }
 genleveldb.target = $$PWD/src/leveldb/libleveldb.a
 genleveldb.depends = FORCE
 PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
 QMAKE_EXTRA_TARGETS += genleveldb
+}
 # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
+QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
 
 # regenerate src/build.h
 !win32|contains(USE_BUILD_INFO, 1) {
diff --git a/src/leveldb.cpp b/src/leveldb.cpp
index b41764f..f71e801 100644
--- a/src/leveldb.cpp
+++ b/src/leveldb.cpp
@@ -8,7 +8,9 @@
 #include <leveldb/env.h>
 #include <leveldb/cache.h>
 #include <leveldb/filter_policy.h>
+#ifndef LEVELDB_WITHOUT_MEMENV
 #include <memenv/memenv.h>
+#endif
 
 #include <boost/filesystem.hpp>
 
@@ -42,8 +44,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool
     options = GetOptions(nCacheSize);
     options.create_if_missing = true;
     if (fMemory) {
+#ifndef LEVELDB_WITHOUT_MEMENV
         penv = leveldb::NewMemEnv(leveldb::Env::Default());
         options.env = penv;
+#else
+        throw std::runtime_error("CLevelDB(): compiled without memenv support");
+#endif
     } else {
         if (fWipe) {
             printf("Wiping LevelDB in %s\n", path.string().c_str());
diff --git a/src/makefile.unix b/src/makefile.unix
index 081edaf..1735b89 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -104,8 +104,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para
 # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
 xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
 
-OBJS= \
-    leveldb/libleveldb.a \
+BASEOBJS := \
     obj/alert.o \
     obj/version.o \
     obj/checkpoints.o \
@@ -114,7 +113,6 @@ OBJS= \
     obj/crypter.o \
     obj/key.o \
     obj/db.o \
-    obj/init.o \
     obj/keystore.o \
     obj/main.o \
     obj/net.o \
@@ -134,24 +132,43 @@ OBJS= \
     obj/hash.o \
     obj/bloom.o \
     obj/noui.o \
-    obj/leveldb.o \
     obj/txdb.o
 
+OBJS := \
+    obj/leveldb.o \
+    obj/init.o \
+    $(BASEOBJS)
+
+TESTOBJS := \
+    obj-test/leveldb.o \
+    $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
+    $(BASEOBJS)
+
 
 all: bitcoind
 
 test check: test_bitcoin FORCE
 	./test_bitcoin
 
+ifdef USE_SYSTEM_LEVELDB
+    LIBS += -lleveldb
+    TESTLIBS += -lmemenv
+else
 #
 # LevelDB support
 #
 MAKEOVERRIDES =
-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
+LIBS += $(CURDIR)/leveldb/libleveldb.a
+TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
 leveldb/libleveldb.a:
-	@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
+	@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
+leveldb/libmemenv.a:
+	@echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
+OBJS += leveldb/libleveldb.a
+TESTOBJS += leveldb/libmemenv.a
+endif
 
 # auto-generated dependencies:
 -include obj/*.P
@@ -162,26 +179,28 @@ obj/build.h: FORCE
 version.cpp: obj/build.h
 DEFS += -DHAVE_BUILD_INFO
 
-obj/%.o: %.cpp
-	$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+P_TO_D = \
 	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
-	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+	  sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
 	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
 	  rm -f $(@:%.o=%.d)
 
-bitcoind: $(OBJS:obj/%=obj/%)
-	$(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+obj/%.o: %.cpp
+	$(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
+	$(P_TO_D)
 
-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
+bitcoind: $(OBJS)
+	$(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
 
 obj-test/%.o: test/%.cpp
 	$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
-	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
-	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
-	  rm -f $(@:%.o=%.d)
+	$(P_TO_D)
+
+obj-test/leveldb.o: leveldb.cpp
+	$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+	$(P_TO_D)
 
-test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
+test_bitcoin: $(TESTOBJS)
 	$(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
 
 clean:





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in net-p2p/bitcoind/files: 0.8.2-sys_leveldb.patch
@ 2013-08-03 16:25 Anthony G. Basile (blueness)
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile (blueness) @ 2013-08-03 16:25 UTC (permalink / raw
  To: gentoo-commits

blueness    13/08/03 16:25:04

  Modified:             0.8.2-sys_leveldb.patch
  Log:
  Fix 0.8.2-sys_leveldb.patch
  
  (Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

Revision  Changes    Path
1.2                  net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch?r1=1.1&r2=1.2

Index: 0.8.2-sys_leveldb.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0.8.2-sys_leveldb.patch	14 Jun 2013 18:49:59 -0000	1.1
+++ 0.8.2-sys_leveldb.patch	3 Aug 2013 16:25:04 -0000	1.2
@@ -46,15 +46,16 @@
  # regenerate src/build.h
  !win32|contains(USE_BUILD_INFO, 1) {
 diff --git a/src/leveldb.cpp b/src/leveldb.cpp
-index b41764f..f71e801 100644
+index b41764f..30c524d 100644
 --- a/src/leveldb.cpp
 +++ b/src/leveldb.cpp
 @@ -8,7 +8,9 @@
  #include <leveldb/env.h>
  #include <leveldb/cache.h>
  #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
 +#ifndef LEVELDB_WITHOUT_MEMENV
- #include <memenv/memenv.h>
++#include <memenv.h>
 +#endif
  
  #include <boost/filesystem.hpp>
@@ -73,7 +74,7 @@
          if (fWipe) {
              printf("Wiping LevelDB in %s\n", path.string().c_str());
 diff --git a/src/makefile.unix b/src/makefile.unix
-index 081edaf..1735b89 100644
+index 081edaf..27f2199 100644
 --- a/src/makefile.unix
 +++ b/src/makefile.unix
 @@ -104,8 +104,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para
@@ -129,7 +130,8 @@
 +LIBS += $(CURDIR)/leveldb/libleveldb.a
 +TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
  DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
- DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+-DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
++DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers/memenv)
  leveldb/libleveldb.a:
 -	@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
 +	@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-03 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14 18:49 [gentoo-commits] gentoo-x86 commit in net-p2p/bitcoind/files: 0.8.2-sys_leveldb.patch Anthony G. Basile (blueness)
  -- strict thread matches above, loose matches on Subject: below --
2013-08-03 16:25 Anthony G. Basile (blueness)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox