Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygwin re-installed #719

Closed
FeodorFitsner opened this issue Mar 25, 2016 · 9 comments
Closed

Cygwin re-installed #719

FeodorFitsner opened this issue Mar 25, 2016 · 9 comments
Milestone

Comments

@FeodorFitsner
Copy link
Member

FeodorFitsner commented Mar 25, 2016

Installation script:

Write-Host "Installing Cygwin x86..." -ForegroundColor Cyan

if(Test-Path C:\cygwin) {
    Write-Host "Deleting existing installation..."
    Remove-Item C:\cygwin -Recurse -Force
}

# download installer
New-Item -Path C:\cygwin -ItemType Directory -Force
$exePath = "C:\cygwin\setup-x86.exe"
(New-Object Net.WebClient).DownloadFile('https://cygwin.com/setup-x86.exe', $exePath)

# install cygwin
cmd /c start /wait $exePath -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P mingw64-i686-gcc-g++ -P mingw64-x86_64-gcc-g++ -P gcc-g++ -P autoconf -P automake -P bison -P libtool -P make -P python -P gettext-devel -P intltool -P libiconv -P pkg-config -P wget -P curl

Write-Host "Installed Cygwin x86" -ForegroundColor Green
@Liryna
Copy link

Liryna commented Mar 26, 2016

Hi @FeodorFitsner ,

It that a script available for users ?

@FeodorFitsner
Copy link
Member Author

I put script here for mostly "internal" purposes, but also some people could re-use the same approach for other software.

@rprichard
Copy link

-P mingw-gcc-core -P mingw-gcc-g++

@FeodorFitsner FWIW, these packages are very old and were recently removed from Cygwin. The replacements are the mingw-w64-XXX packages, which can target either 32-bit or 64-bit.

https://cygwin.com/ml/cygwin-announce/2016-03/msg00069.html

@FeodorFitsner
Copy link
Member Author

Thank you, will take a look.

@FeodorFitsner
Copy link
Member Author

What would be an updated installation command then?

@rprichard
Copy link

I typically just install the mingw64-{i686,x86_64}-gcc-g++ packages, and their dependencies include everything I care about. Most of the packages on that command-line look OK as-is, but these are interesting:

  • mingw-runtime
  • mingw-binutils
  • mingw-gcc-core
  • mingw-gcc-g++
  • mingw-pthreads
  • mingw-w32api

I think the corresponding MinGW-w64 content is all installed by installing the mingw64-{i686,x86_64}-gcc-g++ packages, but maybe you also need gcc-core, which pulls in w32api-runtime and w32api-headers. You already have gcc-core, though, so that's taken care of. I think you just need the toplevel G++ packages.

I spent a few minutes poking at the Cygwin package database, in INI file format, because I couldn't find a web interface.

There are no packages that start with mingw- anymore, so all of the packages I quoted can be removed.

If you wanted to be explicit, then I think the closest analogues are:

  • mingw-runtime => mingw64-$(ARCH)-runtime
  • mingw-binutils => mingw64-$(ARCH)-binutils
  • gcc-core => mingw64-$(ARCH)-gcc-core
  • gcc-g++ => mingw64-$(ARCH)-gcc-g++
  • mingw-pthreads => mingw64-$(ARCH)-winpthreads (There are also mingw64-$(ARCH)-pthreads packages, but no other package requires them. Both the mingw64-i686-winpthreads and mingw-i686-pthreads packages contain a /usr/i686-w64-mingw32/sys-root/mingw/include/pthread.h file, and the content is very different. I suggest that we avoid installing the mingw64-$(ARCH)-pthreads packages. Not sure what's up here, actually. I can install both at the same time, and pthreads seems to be winning out, but maybe it's accidental? The mingw64-$(ARCH)-winpthreads packages are required by both the mingw64-$(ARCH)-gcc-core and the mingw64-$(ARCH)-headers packages.)
  • mingw-w32api => mingw64-$(ARCH)-headers, maybe? Maybe w32api-headers and w32api-runtime too? The latter two packages are already pulled in by gcc-core.

When I tested the MSYS2 package list, it also installed compilers for Fortran, Ada, and Objective-C. I'm guessing we aren't that interested in those languages. I didn't see a toplevel package that included them.

@FeodorFitsner FeodorFitsner modified the milestones: mar-27, apr-10 Apr 5, 2016
@FeodorFitsner FeodorFitsner reopened this Apr 5, 2016
@FeodorFitsner
Copy link
Member Author

I'm doing a clean install and I don't get an error while trying to install mingw-runtime package with the following command:

C:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P mingw-runtime

Looks like those mingw-* packages are still there?

@rprichard
Copy link

AFACT, the Cygwin installer doesn't complain if -P names a non-existent package. I ran the installer with --verbose, and I didn't see an error message or a non-zero exit code. Here are my run details.

That said, I did notice that the http://cygwin.mirror.constant.com mirror still has the packages for those files at http://cygwin.mirror.constant.com/x86_64/release/mingw-runtime/. The corresponding directory on the http://mirrors.kernel.org/sourceware/cygwin mirror, on the other hand, is missing. The two mirrors do have the same x86_64/setup.ini files, though, which lack the mingw-runtime package.

In the package selection page of the Cygwin installer, there are no packages starting with mingw-.

@FeodorFitsner
Copy link
Member Author

OK, thank you for your suggestions! After writing a parser to get dependencies in that ini file I've figured out that cygwin thing 😄

We, basically, need only these 2 packages:

gcc-g++ (includes gcc-core, w32api-headers, w32api-runtime)
mingw64-i686-gcc-g++ (includes mingw64-i686-gcc-core, mingw64-i686-binutils, mingw64-i686-runtime, mingw64-i686-winpthreads)

and we're going to leave that random stuff:

autoconf
automake
bison
libtool
make
python
gettext-devel
intltool
libiconv
pkg-config
wget
curl

So, updated installer code would look like this:

Write-Host "Installing Cygwin x86..." -ForegroundColor Cyan

if(Test-Path C:\cygwin) {
    Write-Host "Deleting existing installation..."
    Remove-Item C:\cygwin -Recurse -Force
}

# download installer
New-Item -Path C:\cygwin -ItemType Directory -Force
$exePath = "C:\cygwin\setup-x86.exe"
(New-Object Net.WebClient).DownloadFile('https://cygwin.com/setup-x86.exe', $exePath)

# install cygwin
cmd /c start /wait $exePath -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P mingw64-i686-gcc-g++ -P mingw64-x86_64-gcc-g++ -P gcc-g++ -P autoconf -P automake -P bison -P libtool -P make -P python -P gettext-devel -P intltool -P libiconv -P pkg-config -P wget -P curl

Write-Host "Installed Cygwin x86" -ForegroundColor Green

EDIT: Sorry, forgot to add their mingw64-x86_64-gcc-g++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants