Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
This is an ebuild file of BeyondCompare 4 on Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
qlb1234
n00b
n00b


Joined: 23 Aug 2016
Posts: 7

PostPosted: Tue Dec 27, 2016 6:01 am    Post subject: This is an ebuild file of BeyondCompare 4 on Gentoo Reply with quote

Hi. I Google searched "Gentoo BeyondCompare" and all posts were years ago. Hopefully someone would find it useful.

bcompare-4.1.9.21719.ebuild
Code:

EAPI=6

DESCRIPTION="Compare, merge files and folders using simple, powerful commands."
HOMEPAGE="http://www.scootersoftware.com"
SRC_URI="http://www.scootersoftware.com/${P}.x86_64.tar.gz
   x86?   ( http://www.scootersoftware.com/${P}.i386.tar.gz )"

LICENSE=""
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="caja kde konq nautilus nemo thunar"

DEPEND="dev-util/patchelf"
RDEPEND=""

src_install()
{
   mkdir -p "${D}/"usr/lib/beyondcompare
   cp "${S}/"{bcmount.sh,bcmount32,bcmount64,BCompare,BCompare.mad,lib7z.so,libQt4Pas.so.5} "${D}/"usr/lib/beyondcompare/
   patchelf --set-rpath '$ORIGIN/' "${D}/"usr/lib/beyondcompare/BCompare

   mkdir -p "${D}/"usr/bin
   ln -s /usr/lib/beyondcompare/BCompare "${D}/"usr/bin/bcompare

   mkdir -p "${D}/"usr/share/applications
   cp "${S}/"bcompare.desktop "${D}/"usr/share/applications/

   mkdir -p "${D}/"usr/share/doc/beyondcompare
   cp "${S}/"help/* "${D}/"usr/share/doc/beyondcompare/

   mkdir -p "${D}/"usr/share/mime/packages
   cp "${S}/"bcompare.xml "${D}/"usr/share/mime/packages/

   mkdir -p "${D}/"usr/share/pixmaps
   cp "${S}/"{bcompare.png,bcomparefull32.png,bcomparehalf32.png} "${D}/"usr/share/pixmaps/

   if use caja
   then
      mkdir -p "${D}/"usr/lib/caja/extensions-3.0
      if use amd64
      then
         cp "${S}/"ext/bcompare-ext-caja.amd64.so "${D}/"usr/lib/caja/extensions-3.0/
      elif use x86
      then
         cp "${S}/"ext/bcompare-ext-caja.i386.so "${D}/"usr/lib/caja/extensions-3.0/
      fi
   fi

   if use kde
   then
      mkdir -p "${D}/"usr/lib/kde4
      if use amd64
      then
         cp "${S}/"ext/bcompare_ext_kde.amd64.so "${D}/"usr/lib/kde4/
      elif use x86
      then
         cp "${S}/"ext/bcompare_ext_kde.i386.so "${D}/"usr/lib/kde4/
      fi
   fi

   if use konq
   then
      mkdir -p "${D}/"usr/lib/kde4
      if use amd64
      then
         cp "${S}/"ext/bcompare_ext_konq.amd64.so "${D}/"usr/lib/kde4/
      elif use x86
      then
         cp "${S}/"ext/bcompare_ext_konq.i386.so "${D}/"usr/lib/kde4/
      fi
   fi

   if use nautilus
   then
      mkdir -p "${D}/"usr/lib/nautilus/extensions-3.0
      if use amd64
      then
         cp "${S}/"ext/bcompare-ext-nautilus.amd64.so "${D}/"usr/lib/nautilus/extensions-3.0/
      elif use x86
      then
         cp "${S}/"ext/bcompare-ext-nautilus.i386.so "${D}/"usr/lib/nautilus/extensions-3.0/
      fi
   fi

   if use nemo
   then
      mkdir -p "${D}/"usr/lib/nemo/extensions-3.0
      if use amd64
      then
         cp "${S}/"ext/bcompare-ext-nemo.amd64.so "${D}/"usr/lib/nemo/extensions-3.0/
      elif use x86
      then
         cp "${S}/"ext/bcompare-ext-nemo.i386.so "${D}/"usr/lib/nemo/extensions-3.0/
      fi
   fi

   if use thunar
   then
      mkdir -p "${D}/"usr/lib/thunarx-2
      if use amd64
      then
         cp "${S}/"ext/bcompare-ext-thunarx.amd64.so "${D}/"usr/lib/thunarx-2/
      elif use x86
      then
         cp "${S}/"ext/bcompare-ext-thunarx.i386.so "${D}/"usr/lib/thunarx-2/
      fi
   fi
}


metadata.xml
Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
   <use>
      <flag name="caja">Install context menu for caja.</flag>
      <flag name="kde">Install context menu for kde.</flag>
      <flag name="nautilus">Install context menu for nautilus.</flag>
      <flag name="nemo">Install context menu for nemo.</flag>
      <flag name="thunar">Install context menu for thunar.</flag>
   </use>
</pkgmetadata>
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Tue Dec 27, 2016 9:40 am    Post subject: Re: This is an ebuild file of BeyondCompare 4 on Gentoo Reply with quote

qlb1234 wrote:
Code:
EAPI=6

DESCRIPTION="Compare, merge files and folders using simple, powerful commands."
HOMEPAGE="http://www.scootersoftware.com"
SRC_URI="http://www.scootersoftware.com/${P}.x86_64.tar.gz
   x86?   ( http://www.scootersoftware.com/${P}.i386.tar.gz )"

LICENSE=""
SLOT="0"
...

There should be something in LICENSE="" too., see
* http://www.scootersoftware.com/shop.php?zz=kb_licensev4
* https://devmanual.gentoo.org/ebuild-writing/variables/index.html#ebuild-defined-variables
* https://wiki.gentoo.org/wiki//etc/portage/license_groups
* https://wiki.gentoo.org/wiki/License_Groups/Non-free
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Wed Dec 28, 2016 3:12 am    Post subject: Re: This is an ebuild file of BeyondCompare 4 on Gentoo Reply with quote

qlb1234 wrote:
bcompare-4.1.9.21719.ebuild:

SRC_URI="http://www.scootersoftware.com/${P}.x86_64.tar.gz
   x86?   ( http://www.scootersoftware.com/${P}.i386.tar.gz )"
This looks suspicious to me. If I install this on x86, it will try to depend on both files, but x86 users cannot run x86_64 programs natively.
qlb1234 wrote:
bcompare-4.1.9.21719.ebuild:

RDEPEND=""
Is it really the case that this program depends on nothing outside the @system set?
qlb1234 wrote:
bcompare-4.1.9.21719.ebuild:

src_install()
{
   mkdir -p "${D}/"usr/lib/beyondcompare
   cp "${S}/"{bcmount.sh,bcmount32,bcmount64,BCompare,BCompare.mad,lib7z.so,libQt4Pas.so.5} "${D}/"usr/lib/beyondcompare/
Bundling is usually a bad idea. Does the package need the bundled versions of common open-source libraries or can it be used with the system copies?
qlb1234 wrote:
bcompare-4.1.9.21719.ebuild:

   patchelf --set-rpath '$ORIGIN/' "${D}/"usr/lib/beyondcompare/BCompare
Does the license permit modifying a distributed file like this? If it does, why do you need to modify this? An ebuild comment explaining why upstream's default is not appropriate could be helpful to future readers.

You could de-duplicate much of your extension handling by loading a shell variable with the appropriate text. For example:
Code:

local e
if use amd64; then
   e=amd64
elif use x86; then
   e=i386
fi
if [[ -n "$e" ]]; then
   if use caja; then
      mkdir -p "${D}/"usr/lib/caja/extensions-3.0
      cp "${S}/"ext/bcompare-ext-caja."$e".so "${D}/"usr/lib/caja/extensions-3.0/
   fi
   if use kde; then
      mkdir -p "${D}/"usr/lib/kde4
      cp "${S}/"ext/bcompare_ext_kde."$e".so "${D}/"usr/lib/kde4/
   fi
   # etc.
fi
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Dec 28, 2016 4:40 am    Post subject: Re: This is an ebuild file of BeyondCompare 4 on Gentoo Reply with quote

qlb1234 wrote:
Code:
LICENSE=""

LICENSE AGREEMENT (V4) wrote:
This is not free software. Scooter Software hereby grants you a non-exclusive, non-transferable, limited license to use the Software free of charge for a period of thirty (30) days. Use of the Software beyond the thirty-day (30-day) trial period requires the purchase of a License Key as described below. Use of the Software beyond the thirty-day (30-day) trial period without purchase of a License Key is a violation of U.S. and international copyright laws.

Yay, trialware for linux.

best ... khay
Back to top
View user's profile Send private message
qlb1234
n00b
n00b


Joined: 23 Aug 2016
Posts: 7

PostPosted: Tue Jan 24, 2017 2:09 am    Post subject: Reply with quote

Quote:
This looks suspicious to me. If I install this on x86, it will try to depend on both files, but x86 users cannot run x86_64 programs natively.

Thanks. I forgot to put the amd64 condition.

Quote:
Is it really the case that this program depends on nothing outside the @system set?

I did a `ldd` on the binary and this is what it tells me.
Code:

        linux-vdso.so.1 (0x00007ffd484b5000)
   librt.so.1 => /lib64/librt.so.1 (0x00007f21a72c9000)
   libbz2.so.1.0 => /lib64/libbz2.so.1.0 (0x00007f21a70b8000)
   lib7z.so => /usr/lib64/beyondcompare/lib7z.so (0x00007f21a6c7f000)
   libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f21a6a63000)
   libc.so.6 => /lib64/libc.so.6 (0x00007f21a66ca000)
   libdl.so.2 => /lib64/libdl.so.2 (0x00007f21a64c6000)
   libQt4Pas.so.5 => /usr/lib64/beyondcompare/libQt4Pas.so.5 (0x00007f21a60b9000)
   libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f21a5d78000)
   libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f21a5b41000)
   libz.so.1 => /lib64/libz.so.1 (0x00007f21a592a000)
   libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libstdc++.so.6 (0x00007f21a55d2000)
   libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/libgcc_s.so.1 (0x00007f21a53bb000)
   /lib64/ld-linux-x86-64.so.2 (0x00007f21a74d1000)
   libQtGui.so.4 => /usr/lib64/qt4/libQtGui.so.4 (0x00007f21a46da000)
   libQtNetwork.so.4 => /usr/lib64/qt4/libQtNetwork.so.4 (0x00007f21a438c000)
   libQtCore.so.4 => /usr/lib64/qt4/libQtCore.so.4 (0x00007f21a3e98000)
   libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f21a3c6f000)
   libm.so.6 => /lib64/libm.so.6 (0x00007f21a3973000)
   libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007f21a3748000)
   libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f21a3438000)
   libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f21a3203000)
   libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f21a2f51000)
   libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007f21a2d48000)
   libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007f21a2b2b000)
   libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007f21a291a000)
   libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f21a2710000)
   libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007f21a2505000)
   libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f21a22ff000)
   libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007f21a20f4000)
   libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f21a1eb6000)
   libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f21a1ca4000)
   libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007f21a1a35000)
   libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007f21a15f2000)
   libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f21a13ee000)
   libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f21a11e8000)
   libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007f21a0fe6000)
   libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 (0x00007f21a0de1000)
   libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0 (0x00007f21a0bd9000)
   libxcb-dri3.so.0 => /usr/lib64/libxcb-dri3.so.0 (0x00007f21a09d6000)
   libxcb-present.so.0 => /usr/lib64/libxcb-present.so.0 (0x00007f21a07d3000)
   libxcb-sync.so.1 => /usr/lib64/libxcb-sync.so.1 (0x00007f21a05cc000)
   libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1 (0x00007f21a03c9000)
   libgbm.so.1 => /usr/lib64/libgbm.so.1 (0x00007f21a01bc000)
   libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f219ff92000)
   libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f219fd82000)
   libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f219fb10000)
   libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f219f90b000)
   libbsd.so.0 => /usr/lib64/libbsd.so.0 (0x00007f219f6f5000)

I also checked my `emerge -ep @system` and I didn't find anything outside of it.

Quote:
Bundling is usually a bad idea. Does the package need the bundled versions of common open-source libraries or can it be used with the system copies?

I, too, don't like bundling. As of today, there's still no dev-lib/qt4pas in the Gentoo repository. And no package offers lib7z.so.

Quote:
Does the license permit modifying a distributed file like this? If it does, why do you need to modify this? An ebuild comment explaining why upstream's default is not appropriate could be helpful to future readers.

I believe the license prohibits distribution of its proprietary binaries. I didn't distribute any of them. It is the user who decides to install Beyond Compare downloads it himself/herself and modifies it. I provide a way to change its rpath because it comes with bundled libraries, that don't seem like reasonable to be installed in /usr/lib. Otherwise, the user have to run a script which set LD_LIBRARY_PATH before he/she runs the executable. This is a bad idea and presetting the rpath is a common practice in releasing Linux proprietary software because in some programme, e.g. git, you can just call the binary with `git difftool` and forget about the LD_LIBRARY_PATH.

Quote:
You could de-duplicate much of your extension handling by loading a shell variable with the appropriate text.

Thanks. I prefer the explicit way so that it might be easier to read (for some people), and definitely easier to do a search (just search the exact filename). It's not like we have a million of duplication and by doing this we can reduce the size by 3KB. However, if any of you Gentoo maintainers decides it's a bad idea to layout redundant structures like this, please feel free to modify it to suit your needs.

I will update it on Bugzilla. Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum