I need to install some packages that are either not in the MSys2 system, or are available via the PKGBUILD method. I am not clear on the explicit/exact syntax/steps to do either. For example:
1) In traditional MSys (not MSys2) to build install GTKExtra, it requires
a) dload and extract the tar/zip into a "build" dir ${LOCALBUILDER}
b) run something to the effect of:
cd ${LOCALBUILDDIR} && \ cd gtkextra-3.2.0 && \ ./configure --prefix=${LOCALDESTDIR} --enable-glade && \ make && \ make install
where ${LOCALDESTDIR} would be something like ..\mingw\local32, and is the location where all DIY packages are installed to.
Is this type of approach workable on MSys2?
If so, what exactly would the MSys2 equivalent be for ${LOCALDESTDIR}?
2) Before I can install that, I need to install an older version of Glade (3.8.5), which is not kept in the MSys2 repo. However, it is in the MinGW Repo, and there is an MSys2 PKGBUILD file for it. Unfortunately, I don't understand exactly how to use the PKGBUILD file, and the instructions at the bottom of https://github.com/Alexpux/MINGW-packages are too cryptic for me.
Is there any benifit to using the PKGBUILD approach, or is it just as well to do someithing like above, with:
cd ${LOCALBUILDDIR} && \ cd glade3-3.8.5 && \ ./configure --prefix=${LOCALDESTDIR} && \ make && \ make install
If there is an advantage to PKGBUILD, please explain, and also please provide an EXPLICIT example (i.e. where no guessing or Linux expertise is required to fill in the blanks).
PKGBUILD is script for building packages. It contain functions that split build process to phases.
Instead buiding programs manually by typing commands we use Arch Linux pacman/makepkg system to simplify buid process.
Our packages buided with mingw-w64 toolchains that is incompatible with programs builded with mingw.org toolchains so you can't mix our packages with packages from mingw.org site.
To use PKGBUILD you need write it first. This is just bash script with its structure. After finishing it you need run next coomands in folder with PKGBUILD:
1. "updpkgsums" to update checksums in PKGBUILD
2. "makepkg-mingw -sLf" to build packages
More info see https://sourceforge.net/p/msys2/wiki/Contributing%20to%20MSYS2/
Yeah I'm not provide package for glade-3.8.5 as it will conflict with current glade 3.20.0.
Cheers for that, though things are not quite so straight forward:
1) It is not clear if doing all this in MSys2_Shell or from the desired 32 or 64 shell is required, or makes any difference.
2) The instructions on page (https://sourceforge.net/p/msys2/wiki/Contributing%20to%20MSYS2/) should mention installing Git also.
3) The instruction "MINGW_INSTALLS=mingw32 makepkg-mingw -sLf" never works here, for one or another reason (see also below). Though at least "export MINGW_INSTALLS=mingw32" seems to return without complaint.
4) The instruction "makepkg-mingw -sLf" first errors out on "usr/bin/env" does not exist. So I created one. After that it errors out "/usr/bin/env: bad interpreter: Permission denied"
... no idea how to proceed from there, a web search was not fruitful.
Please advise.
5) Re Glade 3.8.5: I appreciate that it may conflict with more recent versions of Glade. However there are at least two issues MSys2 may wish to consider:
a) Glade > 3.8.5 (or possibly 3.10) will NOT run on WinXP (only Vista or higher, since dependent on dwmapi). As such, it seems that some sort of warning should be provided to users who do not know about this, since otherwise they will install the "current" MSys2 Glade and waste a huge amount of time trying to figure why it won't work.
b) Separate from Win ver issues, various packages will only work with GTK+ "2" (not GTK3), such as GTKExtra, GTK+ (2.xx) requires Glade 3.8.5 for integration.
As MSys2 has both GTK2 and GTK3, perhaps having compatible Glades may warrant further consideration.
Still trying to install Glade3 following the instructions on (https://sourceforge.net/p/msys2/wiki/Contributing%20to%20MSYS2/), still getting the following:
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ makepkg-mingw -sLf
bash: /usr/bin/makepkg-mingw: /usr/bin/env: bad interpreter: Permission denied
Initially, there did not exist a /env dir, so we created it explicitly, now get the "bad interpreter" issue.
Please advise on installing Glade3.
@DrO It's really strange that
env
is not found as it is part of the default installation and should be present on your system.Here some tests I performed:
You said you since it was missing, you created one. How did you do this? Just creating one without the proper content is not enough, it should be the actual required executable.
Seems like a problem in your overall configuration at this point. You probably need to check multiple things. Like what's the content of your
$PATH
environment variable (echo $PATH
). Then, you should see a folder/usr/bin
somewhere in it. Look in this folder and check if you theenv.exe
executable. If it's not present, more debugging will be needed to understand how it happens to be not present.Hope this helps,
Matt
oops, feel a bit stupid, I had initially thought that it was looking for a Dir called usr/bin/env.
So, in fact, env.exe is present in usr/bin, as per:
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ cd /usr/bin
Administrator@art-64 MSYS /usr/bin
$ dir env.*
env.exe
Not sure what to make of that, as everything seems correct on the face of it.
So, I re-ran my attempt to install as per:
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ export MINGW_INSTALLS=mingw32
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ makepkg-mingw -sLf
/usr/bin/env: ‘bash’: No such file or directory
I noticed your experiment did not include the switch -sLf, so lets try that
$ makepkg-mingw
/usr/bin/env: ‘bash’: No such file or directory
... no idea where to go from here, your thoughts would be much appreciated.
PS. just for completeness
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ Dir
bash.exe.stackdump glade3-i686.install glade3-x86_64.install PKGBUILD
Ok, so in fact, it's actually
bash
that is not found. Just for sake of completness,makepkg-mingw
is a simple bash script. When you invoke it, in the terminal, the command interpreter (in our casebash
) reads the first line which is#!/usr/bin/env bash
. From this first line, the two first characters are removed and the rest is executed receiving the file in argument, so in the end,/usr/bin/env bash /usr/bin/makepkg-mingw
is executed.That being, from there, you have some simple stuff to try to check if it works. But first, I see you have a
bash.exe.stackdump
in your directory. This would mean thatbash
is actually crashing. It might explains why you cannot actually test it. Here a couple of tests for you to perform:Otherwise, try these:
If all this works (I would be suprised), I will need new ideas to tackle this further :)
If it fails at some point, you will need to tell me which. If it's the last step, it could mean the actual
makepkg-mingw
makebash
crashes for you. In this case, you could trim down themakepkg-mingw
until it crashes no more. You can see the actual source using:However, if the error is earlier, it would mean there is something very wrong with your configuration as
bash
couldn't run. Anyway, let's see where this gets us in the hope that I can help you further if needed.Regards,
Matt
First tests
Administrator@art-64 MSYS ~
$ cd /home/downloads/MINGW-packages/mingw-w64-glade3
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ rm -rf *.stackdump
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ export MINGW_INSTALLS=mingw32
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ makepkg-mingw
/usr/bin/env: ‘bash’: No such file or directory
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ ls
bash.exe.stackdump glade3-i686.install glade3-x86_64.install PKGBUILD
Second Tests
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ /usr/bin/env --version
env (GNU coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard Mlynarik and David MacKenzie.
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ /usr/bin/bash --version
GNU bash, version 4.3.42(5)-release (x86_64-pc-msys)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ /usr/bin/env bash --version
GNU bash, version 4.3.42(5)-release (x86_64-pc-msys)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ /usr/bin/env bash /usr/bin/makepkg-mingw
/usr/bin/env: ‘bash’: No such file or directory
... as you suspected, it all worked, but for the last step.
Third Test
When I try the instruction
cat
which makepkg-mingw
| lessit does show the contents of the file, but then CRASHES the MSys2 Shell.
So, I openned the file via traditional "windows approach" in an "ascii flat file" editor, and had a look. Quite honestly, I don't actually understand many of the bits therein, so not sure how/where to begin to "trim" it down. I presume you mean to comment out lines in a manner to determine where the crash/problem occurs.
Fourth Test
Finally, and I am not sure if it is significant, however, I am trying to install Glade3 (that is the older 3.8.5, which is GTK2 compatible, and for which there appears to be all the MSys2 specific instal/PKGBUILD files). I am testing the i686/32 variant. The instructions on the MSYs2 pages indicate one must first tell Msys2 that it is the 32 bit version to be installed, and offers two different ways to accomplish this. I use
export MINGW_INSTALLS=mingw32
... since the alternate approach brings us back to the problem at hand.
If I forget to export as above, then I get an errror/warning from the makepkg-mingw file telling me that I don't have x64 toolchain installed etc.
Just a guess, but this seems to imply that it is capable of getting to the very last part of makepkg-mingw, i.e. the block
for _mingw in ${MINGW_INSTALLS}; do
case ${_mingw} in
mingw32)
_arch=i686
_msystem=MINGW32
;;
mingw64)
_arch=x86_64
_msystem=MINGW64
;;
esac
if [ -f "/${_mingw}/bin/gcc.exe" ]; then
MSYSTEM=${msystem} \ // Try commenting this
PATH=/${_mingw}/bin:$(echo $PATH | tr ':' '\n' | awk '$0 != "/opt/bin"' | paste -sd:) \ // Try commenting this
/usr/bin/makepkg --config /etc/makepkg${_mingw}.conf $@ || exit 1 // Try commenting this
else
print_warning "You don't have installed mingw-w64 toolchain for architecture ${_arch}."
print_warning "To install it run: 'pacman -S mingw-w64-${_arch}-toolchain'"
fi
done
So I commented out the statements indicated above, which results with
$ makepkg-mingw -sLf
/usr/bin/makepkg-mingw: line 94: syntax error near unexpected token
else' /usr/bin/makepkg-mingw: line 94:
else'If I comment out only the last of those lines, and remove the "\" from the second of those lines, then
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$ makepkg-mingw -sLf
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-glade3
$
... so it looks like, whatever may be happening is in the line:
/usr/bin/makepkg --config /etc/makepkg_${_mingw}.conf $@ || exit 1
This, again guessing, might imply that the problem may lie in the PKGBUILD file. I had a look at that, but quite honestly, there are things therein I just don't know enough to decipher.
Fifth Test
I wanted to see if I could install some other package from this collection, I chose mingw-w64-gnome-calculator, and found:
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-gnome-calculator
$ export MINGW_INSTALLS=mingw32
Administrator@art-64 MSYS /home/downloads/MINGW-packages/mingw-w64-gnome-calculator
$ makepkg-mingw -sLf
/usr/bin/env: ‘bash’: No such file or directory
This implies that it may not be the PKGBUILD etc files, but something in the make pkg bits.
I also had a look at the ".conf" files, but much of those beyond my meager understanding.
... I am starting to get a little out of my depth here,
Any suggestions on how to proceed would be greatly appreciated.
The fact that
bash
is crashing should not happen, don't need to look further. The crash happen when executing themakepkg-mingw
script. It might be caused by some other process later in the chain, but we must find which line cause this to continue investigation.I created multiple trimmed versions of the
makepkg-mingw
script for you. I left behind some of them since you havbe proven that some parts works correctly.Simply download each scripts individually and then run them using
rm -r *.stackdump && bash makepkg-mingw-<n>
where<n>
is one on the number. Here what I got:Run them and post the results, we will see where we can go with it. It will probably crash in at 6 and hopefully 7, but let's see.
Matt
Many thanks for all of those ... yes, again your prediction was correct, it crashed on "6", here is the entirety of the session:
Administrator@art-64 MSYS /home/Vachon
$ rm -r .stackdump && bash makepkg-mingw-4
rm: cannot remove '.stackdump': No such file or directory
Administrator@art-64 MSYS /home/Vachon
$ bash makepkg-mingw-4
Begin | Line 45 to 75 (inclusive)
End | Line 45 to 75 (inclusive)
Administrator@art-64 MSYS /home/Vachon
$ rm -r .stackdump && bash makepkg-mingw-5
rm: cannot remove '.stackdump': No such file or directory
Administrator@art-64 MSYS /home/Vachon
$ bash makepkg-mingw-5
Begin | Line 45 to 89 (inclusive) slightly modified
End | Line 45 to 89 (inclusive) slightly modified
Administrator@art-64 MSYS /home/Vachon
$ rm -r .stackdump && bash makepkg-mingw-6
rm: cannot remove '.stackdump': No such file or directory
Administrator@art-64 MSYS /home/Vachon
$ bash makepkg-mingw-6
Begin | Just makepkg call (complete)
/usr/bin/env: ‘bash’: No such file or directory
End | Just makepkg call (complete)
Administrator@art-64 MSYS /home/Vachon
$ rm -r *.stackdump && bash makepkg-mingw-7
Begin | Just makepkg PATH environment setup
Path is
/mingw64/bin:
End | Just makepkg PATH environment setup
Please let me know how I can help futher.
Cheers
DrO
Dear Matt
Just a quick hello, and was wondering if there are additional tests, or whatever, to be performed ?
Cheers
DrO
Closing. Sorry if your issue has not been yet resolved. New tickets can be filed at GitHub.