You are not logged in.

#1 2018-11-15 07:23:56

regid
Member
Registered: 2016-06-06
Posts: 83

Comments about vmg, and vmg-svn, AUR packages

The magnifier, or vmg, is a simple, customizable, easy-to-use, virtual on screen magnifying glass. Though it is old, and uses gtk2, I find it a valuable tool for those not using a desktop environment with such a tool. It is stated to work on Linux, Mac and Windows.
The AUR has 2 PKGBUILDs by the same maintainer: vmg, and vmg-svn. Their version numbers are 3.5-2 and 3.7-3, respectively. 3.5-2 installs an upstream compiled binary for i686 Linux platforms. The way I first got it, source by version number 3.4 is the source for any OS.
I will write notes about this post at the 2 related AUR pages.

PKGBUILD used throughout this post
I have used the following PKGBUILD to examine these packages:

# Maintainer: NextHendrix <cjones12@sheffield.ac.uk>

pkgver=3.4  # The packager is expected to manually insert here one of
            # {'3.4' '3.5' '3.7'}, and the rest of this PKGBUILD 
            # will handle it without other modification for pkgver.
pkgdesc="Simple, customizable, easy-to-use, virtual on screen magnifying glass"
url="http://magnifier.sourceforge.net/"
license=('GPL2' 'custom')
case "${pkgver}" in
    "3.4")
        pkgname=vmg-bfs  # bfs stands for Build From Source.
        pkgrel=1
        arch=('x86_64')
        conflicts=('vmg' 'vmg-svn')
        depends=('gtk2')
        # https://wiki.archlinux.org/index.php/Free_Pascal_package_guidelines#Packaging
        # is only not partially followed. lazarus-gtk2 depends on fpc.
        makedepends=('lazarus')
        # It could be that the underline source tree is also at
        # https://sourceforge.net/p/magnifier/code/HEAD/tree/trunk/ .
        # This tree might be retrievble also by
        # svn checkout https://svn.code.sf.net/p/magnifier/code/trunk.
        _patches=('3.4-install.sh.patch'
                  '3.4-make.sh.patch')
        source=(
            "https://sourceforge.net/projects/magnifier/files/new%20source%20code/${pkgver}/magnifier-${pkgver}.zip"
            "${_patches[@]}")
        md5sums=('bf6dc629b519b410f5d7817c01c54033'  # magnifier-3.4.zip
                 'b76798371d86a4519c95aaa1bbcf4b82'  # 3.4-install.sh.patch
                 'ee3a4d69653dd73352441bade618d277'  # 3.4-make.sh.patch
                )
        # bsdtar -xf magnifier-3.4.zip, which is what makepkg will be using
        # to extract the archive, refuses to extract an archive into the parent
        # directory. https://bbs.archlinux.org/viewtopic.php?id=241396
        # advised to extract the archive by parepare().
        noextract=("magnifier-${pkgver}.zip")
        ;;
    "3.5")
        pkgname=vmg
        pkgrel=2
        arch=('x86_64')
        conflicts=('vmg-bfs' 'vmg-svn')
        depends=('lib32-gtk2' 'lib32-libcanberra')
        _patches=('3.5-install.sh.patch')
        source=(
            "http://sourceforge.net/projects/magnifier/files/magnifier%20for%20Linux/3.5/magnifier-linux-3.5.tar.bz2"
            'vmg.desktop'
            "${_patches[@]}")
        md5sums=('8302710ad565f1f1de63cf307703f6f5'  # magnifier-linuz.3.5.tar.bz2
                 'e831d6b702672283d3c64202454c6f32'  # vmg.desktop
                 'f53b6ce019148d60f8afbb4890dd96ab'  # 3.5-install.sh.patch
                )
        ;;
    "3.7")
        pkgname=vmg-svn
        pkgrel=3
        arch=('x86_64')
        provides=('vmg')
        conflicts=('vmg-bfs' 'vmg')
        depends=('gdk-pixbuf2')
        makedepends=('subversion' 'lazarus' 'fpc')
        _patches=('3.7-install.sh.patch' '3.7-make.sh.patch')
        source=(
            'svn+http://svn.code.sf.net/p/magnifier/code/trunk'
            'vmg.desktop'
            "${_patches[@]}"
               )
        md5sums=('SKIP'                              # svn source
                 'e831d6b702672283d3c64202454c6f32'  # vmg.desktop
                 '6f2587bb4b1ea99bd9454c8a7836eed4'  # 3.7-install.sh.patch
                 '3ed36dee40248a452d541036eea6cb0d'  # 3.7-make.sh.patch
                )
        ;;
    "*")
        echo pkgver=${pkgver} is not acceptable. Should be one of \{3.4, 3.5, 3.7\}.
        return 1
        ;;
esac

prepare() {
    [[ "${pkgver}" == "3.4" ]]  &&  \
        bsdtar --strip-components 1 --extract --file magnifier-3.4.zip
    for p in "${_patches[@]}"; do
        patch -Np0 -i "$srcdir/$p"
    done
}

build() {
    case "${pkgver}" in
        "3.4") cd magnifier-3.4  ;;
        "3.5") return 0          ;;
        "3.7") cd trunk          ;;
    esac
    make
    # http://wiki.freepascal.org/Lazarus_Faq might worth looking at.
    return 0
}

package() {
    case "${pkgver}" in
        "3.4") cd magnifier-3.4;       make arg="DESTDIR=${pkgdir}" install;;
        "3.5") cd magnifier-linux-3.5; arg="DESTDIR=${pkgdir}" ./install.sh;;
        "3.7") cd trunk;               make arg="DESTDIR=${pkgdir}" install;;
    esac
    install -d ${pkgdir}/usr/share/${pkgname}/doc/
    mv ${pkgdir}/usr/share/magnifier/README* ${pkgdir}/usr/share/${pkgname}/doc/
}

As you can see, I only have to change the pkgver in order to build one of them.

How many source packages are distributed by upstream?
First I tried to see what is the difference between the respective source versions. Since 3.5 is declared by upstream to contain only a prebuilt executable, and other
run time files, I left it aside. By setting pkgver=3.4, and pkgver=3.7,

makepkg –nobuild

can be used to only extracts the 3.4, or 3.7, source.

ls -1lAR src/magnifier-3.4 | wc -l

gives 168 lines for 3.4 and

ls -1lAR src/trunk | wc -l

gives 744 lines for 3.7. but

ls -1lAR src/magnifier-3.4/.* | wc -l

gives 0 dot files for 3.4 while

ls -1lAR src/trunk/.* | wc -l

gives 563 dot files for 3.7. And the 2 svn related directories,

ls -1lAR src/trunk/.{svn,makepkg}* | wc -l

, sums up to 563 files. Therefore, to compare the two source versions I think it is reasonable to consider only the non dot files. So

ls -1lR src/magnifier-3.4 | wc -l

gives 168, and

ls -1lR src/trunk | wc -l

gives 178. Now

diff -qr src/trunk src/magnifier-3.4 | wc -l

is 29, of which 2 are src/trunk/.svn, and src/trunk/.makepkg. These 2 are svn related. Which leaves us with 27 files and directories that differ.

diff -qr src/trunk src/magnifier-3.4 | grep -i only

can be used to see which files are in one version, and not in the other. By examining both

diff -qr src/trunk src/magnifier-3.4

and

diff -qr src/trunk src/magnifier-3.4 | grep -i only

it can be seen that the website directory, and some documentation files, differ. I stopped comparing the source versions at this point because I don’t know Pascal and lazarus to go further. Still, I think one can assume with some certainty that, in general, these 2 source versions are quite close to each other.

Resulted exectuables
Upstream prebuilt i686 3.5 binary fails to run on my x86_64 machine. I get:

(vmg:5864): GLib-GObject-CRITICAL **: 20:17:49.536: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $F77E2F96
TApplication.HandleException Access violation
  Stack trace:
  $F77E2F96
[FORMS.PP] ExceptionOccurred 

even though I installed what I believe are the required lib32 packages from multilib. I have not tried to further debug it. In contrast, x86_64 executables that are built from source using PKGBUILD are working. At least vmg-svn (3.7), possibly also vmg (3.4), writes informational messages to the terminal when started from the command line. Some of this messages are purely information in nature, such as

[TGlass.LoadBitmap] Loading /usr/share/magnifier/right.bmp

Yet some do have suggestions for action, such as

Form resource TAboutWindow not found. For resourceless forms CreateNew constructor must be used. See the global variable RequireDerivedFormResource.

This particular message looks to me as a Pascal, or lazarus, programming suggestion.

PKGBUILDs comparision
The attached PKGBUILD uses upstream make, and other shell instructions files, to build the packages. This shorten the build() and package() functions of the AUR maintainer PKGBUILD. It also sweeps under the rug upstream usage of cp instead of install, which Xyne has point out when these commands were copied verbatim to PKGBUILD. I have taken into account other comments by Xyne. Xyne comments were recorded at 2016 at the vmg (3.5) page.

Perhaps the maintainer of the AUR vmg, and vmg-svn, would like to use my PKGBUILD as the base for a single vmg AUR PKGBUILD.

For completeness, the patch files that are mentioned in the attached PKGBUILD file above are:

3.4-install.sh.patch

--- magnifier-3.4/install.sh	2010-05-24 10:12:38.000000000 +0000
+++ magnifier-3.4/install.sh	2018-10-31 22:39:41.723025380 +0000
@@ -6,15 +6,11 @@
 
 DESTDIR=""
 
-for arg; do
-
-  case $arg in
+case $arg in
 
     DESTDIR=*) DESTDIR=${arg#DESTDIR=};;
 
-  esac;
-
-done
+esac;
 
 #
 # Does the install

3.4-make.sh.patch

--- magnifier-3.4/make.sh	2008-12-11 00:08:05.000000000 +0000
+++ magnifier-3.4/make.sh	2018-10-28 14:23:17.197399799 +0000
@@ -26,4 +26,8 @@ OS="linux"
 echo "Target operating system: $OS"
 
 
-fpc -S2cgi -O1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+fpc -S2cgi -O1 -gl -vewnhi -l -Fu/usr/lib/lazarus/components/lazutils/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+# See https://bbs.archlinux.org/post.php?action=post&tid=241459
+# It could be that  
+# fpc -S2cgi -O1 -gl -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/components/lazutils/lib/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+# seem to works as well.

3.5-install.sh.patch

--- magnifier-linux-3.5/install.sh	2010-05-24 10:12:38.000000000 +0000
+++ magnifier-linux-3.5/install.sh	2018-10-31 22:39:41.723025380 +0000
@@ -6,15 +6,11 @@
 
 DESTDIR=""
 
-for arg; do
-
-  case $arg in
+case $arg in
 
     DESTDIR=*) DESTDIR=${arg#DESTDIR=};;
 
-  esac;
-
-done
+esac;
 
 #
 # Does the install

3.7-install.sh.patch

--- trunk/install.sh	2010-05-24 10:12:38.000000000 +0000
+++ trunk/install.sh	2018-10-31 22:39:41.723025380 +0000
@@ -6,15 +6,11 @@
 
 DESTDIR=""
 
-for arg; do
-
-  case $arg in
+case $arg in
 
     DESTDIR=*) DESTDIR=${arg#DESTDIR=};;
 
-  esac;
-
-done
+esac;
 
 #
 # Does the install

3.7-make.sh.patch

--- trunk/make.sh	2018-10-27 23:20:47.604311884 +0000
+++ trunk/make.sh	2018-10-28 01:21:10.354521068 +0000
@@ -26,4 +26,7 @@ OS="linux"
 echo "Target operating system: $OS"
 
 
-fpc -S2cgi -O1 -gl -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+fpc -S2cgi -O1 -gl -vewnhi -l -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/components/lazutils/lib/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+# It could be that  
+# fpc -S2cgi -O1 -gl -vewnhi -l -Fu/usr/lib/lazarus/components/lazutils/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr
+# seems to work as well.

Offline

Board footer

Powered by FluxBB