Control: reopen -1
Control: retitle -1 opencv: avoid building gigabytes of unused example binaries

Hello,

> du -hs obj-x86_64-linux-gnu-static
> 46G     obj-x86_64-linux-gnu-static

> this is just used during dh_install place, can we just remove it after
> copying files into debian/tmp/ directory?

Mmm. That huge space is actually coming mostly from the few hundreds of
100-MB statically-linked examples... which we don't even install. Do we
really need to enable -DBUILD_EXAMPLES=ON, actually?  At least, we could
avoid uselessly building the unused static version with the attached
change. That'll reduce disk usage from tens of gigabytes down to a few
gigabytes, and probably reduce the build time a lot as well.

Samuel
--- debian/rules.original       2020-01-01 19:27:07.000000000 +0000
+++ debian/rules        2020-01-05 19:30:09.000000000 +0000
@@ -52,7 +58,6 @@
 CMAKE_FLAGS = \
        -GNinja \
        -DANT_EXECUTABLE=/usr/bin/ant \
-       -DBUILD_EXAMPLES=ON     \
        -DBUILD_JAVA=ON \
        -DBUILD_PROTOBUF=OFF \
        -DBUILD_TESTS=ON \
@@ -123,6 +127,7 @@
        # dynamicly linked
        dh_auto_configure -B $(BUILDDIR) \
                -- $(CMAKE_FLAGS) \
+               -DBUILD_EXAMPLES=ON \
                -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \
                -DBUILD_SHARED_LIBS=ON -DBUILD_DOCS=ON
        # statically linked

Reply via email to