Subject: [bug#28698] [PATCH] gnu: Enable support for libpurple in bitlbee.

From: Oleg Pykhalov <[email-masked]>
Date: Wed, 13 Dec 2017 00:26:16 +0300

Hello Ludovic and Tomáš,

[email-masked] (Ludovic Courtès) writes:

> Tomáš Čech <[email-masked]> skribis:
>
>> * gnu/packages/messaging.scm (bitlbee): Add pidgin input, add more configure
>>   flags.
>
> I think it’s a good idea, but it’s taking a lot of extra space:
>
> $ guix size bitlbee |tail -1
> total: 176.5 MiB
> $ guix size bitlbee pidgin |tail -1
> total: 668.0 MiB
>
> What about adding a “lib” output to Pidgin?  BitlBee would depend on
> that rather than on the whole Pidgin.

I want a libpurple support in bitlbee, too.  So, here is a libpurple
output, but still there is a big size because of inputs, I guess.  :-(

Is there a way to decrease this?

From 4ddb9d732fdfa2f06960df0447723062cd58ab17 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <[email-masked]>
Date: Wed, 13 Dec 2017 00:19:17 +0300
Subject: [PATCH] gnu: pidgin: Copy libpurple to separate output.

* gnu/packages/messaging.scm (pidgin): Copy libpurple to separate output.
---
 gnu/packages/messaging.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 1780536d0..8612c9060 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -338,6 +338,7 @@ authentication.")
          "1y5p2mq3bfw35b66jsafmbva0w5gg1k99y9z8fyp3jfksqv3agcc"))
        (patches (search-patches "pidgin-add-search-path.patch"))))
     (build-system glib-or-gtk-build-system)
+    (outputs '("out" "libpurple"))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("check" ,check)
@@ -382,7 +383,25 @@ authentication.")
              "--enable-cyrus-sasl"
              (string-append "--with-ncurses-headers="
                             (assoc-ref %build-inputs "ncurses")
-                            "/include"))))
+                            "/include"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-libpurple
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (libpurple (assoc-ref outputs "libpurple")))
+               (for-each (lambda (file)
+                           (install-file file
+                                         (string-append libpurple "/lib")))
+                         (find-files (string-append out "/lib") "libpurple"))
+               (for-each (lambda (file)
+                           (install-file file
+                                         (string-append libpurple "/include/libpurple")))
+                         (find-files (string-append out "/include/libpurple")))
+               (let ((pkgconfig "/lib/pkgconfig"))
+                 (install-file (string-append out pkgconfig "/purple.pc")
+                               (string-append libpurple pkgconfig))))
+             #t)))))
     (native-search-paths
      (list (search-path-specification
             (variable "PURPLE_PLUGIN_PATH")
-- 
2.15.1

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix size pidgin:libpurple
store item                                                       total    self
/gnu/store/ks27x0mf95gir0cdgb9h573xbava6v1k-python-3.5.3           171.5    65.2   9.7%
/gnu/store/zlbbayv8rv6z7gnhz435gjq8pzjm06v6-python-2.7.13          159.7    54.5   8.1%
/gnu/store/bzn4wyrbdmfc1bd7lq05db5psfl5f8x8-perl-5.26.0            140.3    52.6   7.8%
/gnu/store/yihvhxv3xyyvl1m2cy1lnf1lyi9h76fk-guile-2.2.2            131.2    44.2   6.6%
/gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25              38.5    37.1   5.5%
/gnu/store/h751h6b615w9v6r1amyhxvqqi98kimrs-gtk+-2.24.31           488.1    35.8   5.3%
/gnu/store/0s5manjvfa0gmsv2r71rchky7ab70g1d-icu4c-58.2             122.7    35.0   5.2%
/gnu/store/m1c4sqff8dd6jxnws098bxha9pna44jr-pidgin-2.12.0          667.1    33.9   5.0%
/gnu/store/3x53yv4v144c9xp02rs64z7j597kkqax-gcc-5.4.0-lib           68.6    30.1   4.5%
/gnu/store/7x2drw405w5rkphvg1vzhdy48fx26wx3-ghostscript-with-cups-9.21   183.2    25.3   3.8%
/gnu/store/42d5rjrdkln6nwvzwdc8dyd4w6iy3n5j-coreutils-8.27          86.8    14.8   2.2%
/gnu/store/azbfh3i72lbaqvhgg5m7p6ymmqq0ii6q-glib-2.52.3            111.9    13.8   2.1%
/gnu/store/j56x8kcdlyqbq9mjl5ahdvrz2qy6xwim-cups-2.2.4             287.7    12.2   1.8%
/gnu/store/ghmpqlplg05jjrqni48dvrs606xlmhs0-cups-minimal-2.2.4     150.7    12.1   1.8%
/gnu/store/zbywrj6klakskj0sppq56viqh9l56jl0-util-linux-2.30.1       87.7    12.1   1.8%
/gnu/store/kwzs8k97qy7avxxldnzavlii9zphh3d6-libxml2-2.9.4           81.1    10.0   1.5%
/gnu/store/knzhrdlih3y4pndp6b40j7ab3w3kgk7z-font-dejavu-2.37         9.7     9.7   1.4%
/gnu/store/2l781ng7cl6647i3mbrincdap9j4n8d5-gconf-3.2.6            148.5     7.9   1.2%
/gnu/store/3vcaqrs4169a2607mqackjwfw9hqrmvv-poppler-0.59.0         154.9     7.0   1.0%
/gnu/store/jz1b4asy3pldfvv3pdgalcv90w79brs4-shared-mime-info-1.8   129.6     6.6   1.0%
/gnu/store/c4vl4hw5jccg0b23sfvs0kdnfdbxdlgm-cairo-1.14.10          141.5     6.0   0.9%
/gnu/store/f3rwis4xfhvmnfz77x66vb28ilbp854p-cairo-1.14.10          141.5     6.0   0.9%
/gnu/store/m0m6bwzi8lx7kv8zbn3hjrim6flmgnf4-openssl-1.0.2l          74.6     5.9   0.9%
/gnu/store/09j7scnl3hahcmql986fsjpzj6gqsmzv-ncurses-6.0             74.3     5.7   0.8%
/gnu/store/ycnghyhg38c7hyls7ha8qmaxq32rnk32-pidgin-2.12.0-libpurple   672.7     5.6   0.8%
/gnu/store/b7y66db86k57vbb03nr4bfn9svmks4gf-bash-4.4.12             81.0     5.4   0.8%
/gnu/store/clrddh6a60b31anv7a9hrk3i9id0k5zs-libxcb-1.12             74.4     5.1   0.8%
/gnu/store/np05q8mf1y9y4bk5y4ssj99m0dss2b1q-libx11-1.6.5            79.3     4.9   0.7%
/gnu/store/4c0dm8h5ln0zr1l93nwhhizf5p040yi6-gs-fonts-8.11            4.5     4.5   0.7%
/gnu/store/965dw3smmsvj6jyfxrkapp0gn9jh9djn-libunistring-0.9.7      73.1     4.5   0.7%
/gnu/store/jvsgj5l4lgdknari34rv29wv253n8jcl-gnutls-3.5.13          138.5     4.4   0.7%
/gnu/store/m5mpr30kyv4mm1nrzkbcwzbjskhrxsdf-gdk-pixbuf+svg-2.36.10   224.2     4.1   0.6%
/gnu/store/6srq8zd7fxlcm4ry9q2scdkvxy7l9wgg-gdk-pixbuf-2.36.10     128.3     4.1   0.6%
/gnu/store/w85rbll51r86mclkmp1bxa774b36jy1q-mit-krb5-1.15.1         73.6     4.0   0.6%
/gnu/store/4b9y9f5fvghk2vmwpbgzncal7z3r4n5y-pango-1.40.12          201.5     3.9   0.6%
/gnu/store/mpl9b9w60gjzsq470zka5l8p2bmy7r8v-sqlite-3.19.3           79.0     3.5   0.5%
/gnu/store/an52j0jrvd23qypbidd5f20k2wi75vh9-pcre-8.40               72.1     3.4   0.5%
/gnu/store/xr8mcc3yiaj9mypmgvr18cc1s62b7w1i-cups-filters-1.17.7    275.4     3.3   0.5%
/gnu/store/fy6ymaxvry5vn69k80xd4x8h3ax9i1if-qpdf-6.0.0              75.7     3.2   0.5%
/gnu/store/9pq16kfcldqqcbd58mmfp37g3awhg4sd-gawk-4.1.4              72.6     3.0   0.5%
/gnu/store/vlfm0js4kc8w75pb7fm0kcjxrlzpyxz0-orbit2-2.14.19         115.3     2.9   0.4%
/gnu/store/1jp44pfmqcj3zycclvmmva3xcwinyg7l-freetype-2.8            73.6     2.8   0.4%
/gnu/store/f02wqyqqm39f1g7d7y6ajqdmz0swasy2-libxslt-1.1.29          85.9     2.7   0.4%
/gnu/store/scs7siybrjl5bb7sxqaskysf8n1ld718-gmp-6.1.2               71.2     2.6   0.4%
/gnu/store/5jl21csvr3jmsa4a7d08sqa2waks3f09-gmp-6.1.2               71.2     2.6   0.4%
/gnu/store/3k1y78v6nxjvmivnri5j46wai6ppvyz0-harfbuzz-1.5.1         171.4     2.5   0.4%
/gnu/store/sd1nm52b87353m41qxzwka0c0bbpk617-avahi-0.6.31           128.1     2.4   0.4%
/gnu/store/nniszqyslmgllha2cyi9g3pfsmm6sg16-atk-2.24.0             114.0     2.2   0.3%
/gnu/store/7841988i5qs5abnibcizx1b5vg0l0vhg-libtiff-4.0.8           73.9     2.1   0.3%
/gnu/store/nw400gfan3mxvjfwvy1q72s1ybmdscsk-fontconfig-2.12.3       80.7     2.0   0.3%
/gnu/store/c6vpfgm9n7jzgr0llax0x7szqk9a5bfm-nettle-3.3              73.0     1.7   0.3%
/gnu/store/xr0zjan791j0pgvcs770m59za9bsjsr6-dbus-1.10.22            81.7     1.7   0.3%
/gnu/store/djzkjdadhl4qc6ck7aflc0rrbkf9c2gg-libcroco-0.6.12        124.7     1.7   0.2%
/gnu/store/w8kii3hjvmh50yxs52gkdywkq9jc7s19-pixman-0.34.0           70.2     1.6   0.2%
/gnu/store/zhrajv6qf2hzn9c3g2bb07559hyrz5xp-bash-static-4.4.12       1.4     1.4   0.2%
/gnu/store/bw44dfc7sb38dk2j2k562bsjjsy93lvq-libgcrypt-1.7.8         71.7     1.3   0.2%
/gnu/store/mipizipnr4y2hly9b429j8id1albbgqi-readline-7.0            75.6     1.3   0.2%
/gnu/store/ryqd73alrlq5djsr18xjjihi735592im-pkg-config-0.29.2       69.9     1.3   0.2%
/gnu/store/jpg8ddw8ny40ja5agb90kn5nnncjbrrs-lcms-2.8                76.0     1.3   0.2%
/gnu/store/9blidf28xz0a0glnv6a4xcw6nxadg427-libgc-7.6.0             70.4     1.2   0.2%
/gnu/store/0np5m3mra5940awvq711bwkhnhwf1cny-xproto-7.0.31            1.1     1.1   0.2%
/gnu/store/59yggxz3afj1s8zq3y2f0cd84rpcsfnj-dbus-glib-0.108        126.0     1.1   0.2%
/gnu/store/g3nari57wcfnm00kv9bnpyzdzfq4h8pk-xz-5.2.2                70.7     1.1   0.2%
/gnu/store/xh3d0r8zc46fh9pjayxkwgklk1d175xb-kbproto-1.0.7            1.0     1.0   0.1%
/gnu/store/vdibsrn3w4pvn0yav5z8aa1hw6hadid2-librsvg-2.40.18        220.1     1.0   0.1%
/gnu/store/kpxi8h3669afr9r1bgvaf9ij3y4wdyyn-bash-minimal-4.4.12     39.5     1.0   0.1%
/gnu/store/7ljjhfz6p14xlnwnmzmg6hi01wfvz9vb-cyrus-sasl-2.1.26       80.9     0.8   0.1%
/gnu/store/b9ww6qv1ii9v6n45kin7543vkf6jfnd3-libpng-1.6.29           70.8     0.8   0.1%
/gnu/store/w31zw2chff41x6q6kpa2wrkgx8agr0an-libidn-1.33             69.4     0.8   0.1%
/gnu/store/pd3nggfvrq50nh419an2ahay69mzrvck-libjpeg-9b              69.4     0.8   0.1%
/gnu/store/rp8lfy4yfj08dk41m4ia9b80yy93mzf6-libjpeg-8d              69.4     0.8   0.1%
/gnu/store/7v2w3506q0gf96rsf6wf3gdr2iv5frmm-libgpg-error-1.27       70.3     0.7   0.1%
/gnu/store/m96jkig3g1yjxak5i617v68xabjgagva-check-0.10.0            73.3     0.7   0.1%
/gnu/store/3mg0zb2f6p8fskhjkgb34sh3rpizxfva-python2-dbus-1.2.0     126.7     0.7   0.1%
/gnu/store/b8yzs5x0cnypb9vygcsxw5aiih9k3kmd-libxi-1.7.9             80.4     0.6   0.1%
/gnu/store/5avga6vm5n26wfirw7q3ivd3c8p1yx70-xextproto-7.3.0          0.6     0.6   0.1%
/gnu/store/0f76ak4jn36qs7syhfaw5ag9958yabzh-libatomic-ops-7.4.4      0.6     0.6   0.1%
/gnu/store/wdlhrg370gm42s7ggyhnvnb4xrzpls1x-expat-2.2.1             69.2     0.6   0.1%
/gnu/store/47jgabf5wx296alb06pb5iig6cqbmx0v-gdbm-1.13               69.2     0.6   0.1%
/gnu/store/r0nj8x68zjvdqxqq8kjb02zwiv055nv7-libidl-0.8.14          112.4     0.5   0.1%
/gnu/store/vais0pchk05ihl7kqj7rq8zf8p4cjdha-libice-1.0.9            69.6     0.5   0.1%
/gnu/store/kdwlvs51isdfbl61jdishzhly8h139zf-libbsd-0.8.3            69.1     0.5   0.1%
/gnu/store/c2k4gqjhnjyqyisci1sy81416i03pk22-libidn2-2.0.2           73.6     0.5   0.1%
/gnu/store/j38il4np3l29z14ilg2h352c89qsgl9y-openjpeg-1.5.2          77.2     0.5   0.1%
/gnu/store/jz7wvy930liqjvm95lhdv9i1dr1xxvxp-libxext-1.3.3           79.8     0.4   0.1%
/gnu/store/5lrk6d5cjsv2s29vfji6j59gyf18rb5m-acl-2.2.52              69.3     0.4   0.1%
/gnu/store/sfx1wh27i6gsrk21p87rdyikc64v7d51-zlib-1.2.11             69.0     0.4   0.1%
/gnu/store/mxsbvhljh0fk82hdsgy04p3l2d5hz4j4-libtasn1-4.12           69.0     0.3   0.1%
/gnu/store/20jm67srhdzi01d2gdg36cspyip21lsd-libsm-1.2.2             89.0     0.3   0.0%
/gnu/store/p5hrrimz30kfp56rah7qn4ymshyg78mq-graphite2-1.3.10        68.9     0.3   0.0%
/gnu/store/4dc900sd73wyv40pvpa5pf8kx1a6b2c5-jbig2dec-0.13           68.9     0.3   0.0%
/gnu/store/593cj4b7nsa0csjfjnh0xx8y4rdpykxh-libxft-2.3.2            91.8     0.3   0.0%
/gnu/store/yz1lf55ag0904w9ib0q2kcjpdx33y7wm-attr-2.4.47             68.9     0.2   0.0%
/gnu/store/1xc97akbdcisrid2n8djpkn09f8bkl5f-libxdmcp-1.1.2          69.3     0.2   0.0%
/gnu/store/jnbb8ffxxvrw2b4z18zn0g08kqk9rsgl-libffi-3.2.1            68.8     0.1   0.0%
/gnu/store/sq26apxpvka5n46xkza1l5lrz5s4w8v2-libxrandr-1.5.1         80.0     0.1   0.0%
/gnu/store/kgy00x8jl7q965sngq1yyihbczxj15wk-libxrender-0.9.10       79.5     0.1   0.0%
/gnu/store/hxn2viwl04nwswpjkfg0iyyhm815yaza-libcap-2.25             68.8     0.1   0.0%
/gnu/store/yzlmd2nlcyjhx0ydbap7x32zjqxc3hz9-libcap-2.25             68.8     0.1   0.0%
/gnu/store/14f4vh3y3wdf3rfpzkpqfqbl9i81hyw8-libxcursor-1.1.14       79.7     0.1   0.0%
/gnu/store/w29l6cn2z5l4s6d70iiagn2i4gwi0019-startup-notification-0.12    79.5     0.1   0.0%
/gnu/store/qh1fri7qppqi8bhyzbiw7h8knmk4cb3q-libltdl-2.4.6           68.8     0.1   0.0%
/gnu/store/dgyan2zawxw7qnxrmf9yp3ll954c9sxm-libdaemon-0.14          68.7     0.1   0.0%
/gnu/store/7792axzccdwyajxq9vavyvph7mljs8yc-util-macros-1.19.1       0.1     0.1   0.0%
/gnu/store/85n2gzncy1dl6cbnky79nih4qhcwibds-libxfixes-5.0.3         79.4     0.1   0.0%
/gnu/store/mlcg8p2dmjbvca56n3hq4gav4j5s199m-xcb-util-0.4.0          74.4     0.1   0.0%
/gnu/store/ia2rwi4zdl2nhhwfmj1gaap1xz70mmxs-libpaper-1.1.24         69.7     0.1   0.0%
/gnu/store/whsbky21nkkc0zl41r31xrwvij1fksr4-renderproto-0.11.1       0.1     0.1   0.0%
/gnu/store/xv8bp0zxbr9iphr38wy0ll4lzkbh9i87-libxau-1.0.8            68.7     0.0   0.0%
/gnu/store/rcrkyzx8n8h6avydhqr8cr3v2i7dnnvw-scrnsaverproto-1.2.2     0.0     0.0   0.0%
/gnu/store/mgmik2qgg3splm7bnpk4r7db9r5igpgb-libxscrnsaver-1.2.2     79.8     0.0   0.0%
/gnu/store/wrbmwv93ns5dr35iyw9m7c0gx9wgkldv-libxcomposite-0.4.4     79.4     0.0   0.0%
/gnu/store/v3rw36lf3m9ncg6sihghchnbivix2gvi-libxinerama-1.1.3       79.8     0.0   0.0%
/gnu/store/5s19lin8dm65aygm85s8cwqsq41hym6d-libxdamage-1.1.4        79.4     0.0   0.0%
/gnu/store/v4i3zfiwk6vl0mhdz580diqs0p6sc8vg-python-wrapper-3.5.3   176.9     0.0   0.0%
/gnu/store/39q7jaky8dalbyjmckpswwfkwckfgi40-libpthread-stubs-0.4     0.0     0.0   0.0%
total: 672.7 MiB
--8<---------------cut here---------------end--------------->8---

Thanks,
Oleg.