This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Switch from mozilla-build to msys2.

  • Loading branch information...
Arnavion committed Mar 16, 2015
1 parent e9874d4 commit f4bb6006478eb051e7395266b2732cc426a7e7b4
Showing with 97 additions and 139 deletions.
  1. +26 −19 README.md
  2. +0 −6 atk/mod.md
  3. +64 −41 build.ps1
  4. +0 −4 cairo/mod.md
  5. +0 −4 enchant/mod.md
  6. +0 −1 freetype/mod.md
  7. +0 −5 gdk-pixbuf/mod.md
  8. +0 −4 gettext-runtime/mod.md
  9. +0 −5 glib/mod.md
  10. +1 −7 gtk/mod.md
  11. +1 −6 harfbuzz/mod.md
  12. +4 −4 harfbuzz/win32/harfbuzz.vcxproj
  13. +0 −4 libffi/mod.md
  14. +0 −1 libpng/mod.md
  15. +0 −4 libxml2/mod.md
  16. +0 −4 openssl/mod.md
  17. +0 −5 pango/mod.md
  18. +1 −3 perl/mod.md
  19. +0 −3 pixman/mod.md
  20. +0 −4 win-iconv/mod.md
  21. +0 −5 zlib/mod.md
View
@@ -122,45 +122,52 @@ If you want to build the bundle from source yourself, we have a PowerShell scrip
* [Visual Studio 2013 Express for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-2013-express)
* [Windows Management Framework 4.0](https://www.microsoft.com/en-us/download/details.aspx?id=40855) - Not needed for Windows 8.1 and above
* [7-Zip](http://www.7-zip.org/download.html) (install to _C:\Program Files\7-Zip_; do not use the _7z.exe_ bundled with MozillaBuild)
* [7-Zip](http://www.7-zip.org/download.html) (install to _C:\Program Files\7-Zip_)
* [CMake 3.0.2](http://www.cmake.org/download/)
* [MozillaBuild 1.10.0](https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/)
* Perl 5.20 [x86](https://dl.hexchat.net/misc/perl/perl-5.20.0-x86.7z) or [x64](https://dl.hexchat.net/misc/perl/perl-5.20.0-x64.7z) (extract to _C:\mozilla-build\perl-5.20\Win32_ or _C:\mozilla-build\perl-5.20\x64_)
* [Python 2.7](https://www.python.org/downloads/windows/) (install to _C:\mozilla-build\python-2.7\Win32_ or _C:\mozilla-build\python-2.7\x64_)
* [NASM](http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D) (extract to _C:\mozilla-build\nasm_)
* [msgfmt](https://dl.hexchat.net/gtk-win32/msgfmt-0.18.1.7z) (extract to _C:\mozilla-build_)
* [Ragel](https://dl.hexchat.net/gtk-win32/ragel-6.8.7z) (extract to _C:\mozilla-build_)
* [msys2](https://msys2.github.io/)
* Perl 5.20 [x86](https://dl.hexchat.net/misc/perl/perl-5.20.0-x86.7z) or [x64](https://dl.hexchat.net/misc/perl/perl-5.20.0-x64.7z) (extract to _C:\gtk-build\perl-5.20\Win32_ or _C:\gtk-build\perl-5.20\x64_)
* [Python 2.7](https://www.python.org/downloads/windows/) (install to _C:\gtk-build\python-2.7\Win32_ or _C:\gtk-build\python-2.7\x64_)
* [msgfmt](https://dl.hexchat.net/gtk-win32/msgfmt-0.18.1.7z) (extract to _C:\gtk-build_)
* [Ragel](https://dl.hexchat.net/gtk-win32/ragel-6.8.7z) (extract to _C:\gtk-build_)
1. Clone [this repository](https://github.com/hexchat/gtk-win32) repository to _C:\mozilla-build\hexchat\github\gtk-win32_ This repository contains the build script, project files and patches.
1. Follow the instructions on the msys2 page to update the core packages.
1. Install needed packages in the msys2 shell
```bash
pacman -S gzip nasm patch tar xz
```
1. Clone [this repository](https://github.com/hexchat/gtk-win32) repository to _C:\gtk-build\github\gtk-win32_ This repository contains the build script, project files and patches.
1. Now you have to allow PowerShell scripts to be run on your system. Open a PowerShell prompt **as Administrator** and run the following command:
```powershell
Set-ExecutionPolicy RemoteSigned
```
Set-ExecutionPolicy RemoteSigned
```
1. Now start a new PowerShell window as a regular user. Go to the _gtk-win32_ directory and start building with the script. For example, to build the 32-bit bundle, run:
```powershell
cd C:\mozilla-build\hexchat\github\gtk-win32
.\build.ps1
```
cd C:\gtk-build\github\gtk-win32
.\build.ps1
```
To build the 64-bit bundle instead, run:
```powershell
cd C:\mozilla-build\hexchat\github\gtk-win32
.\build.ps1 -Configuration x64
```
cd C:\gtk-build\github\gtk-win32
.\build.ps1 -Configuration x64
```
The script has some parameters you can pass in. Run
```powershell
Get-Help -Full .\build.ps1
```
Get-Help -Full .\build.ps1
```
to see the help for the parameters and examples.
1. When the script is done, your GTK+ stack will be found under _C:\mozilla-build\hexchat\gtk_. Enjoy!
1. When the script is done, your GTK+ stack will be found under _C:\gtk-build\gtk_. Enjoy!
![GTK+ 2 dependency graph](https://hexchat.github.io/gtk-win32/img/dependency-graph.png)
View
@@ -1,5 +1,4 @@
* Download [ATK 2.14.0](http://ftp.gnome.org/pub/gnome/sources/atk/2.14/atk-2.14.0.tar.xz)
* Extract to `C:\mozilla-build\hexchat`
* In `build\win32\vs12\atk-build-defines.props`, replace:
* `intl.lib` with `libintl.lib`
* In `build\win32\vs12\atk-install.props`:
@@ -16,8 +15,3 @@
* Remove all `<Optimization>` lines
* In `build\win32\vs12\install.vcxproj`:
* replace `AtkEtcInstallRoot` with `GlibEtcInstallRoot`
* Open `build\win32\vs12\atk.sln` with VS
* Select `Release|Win32` configuration
* Build in VS
* Release with `release-x86.bat`
* Extract package to `C:\mozilla-build\hexchat\build\Win32`
View
105 build.ps1
@@ -19,8 +19,12 @@ x64 - 64-bit build. Uses the 32-bit cross-compiler with VS Express or the
Setting this to $true forces the items to be built one after the other.
.PARAMETER MozillaBuildDirectory
The directory where you installed Mozilla Build.
.PARAMETER BuildDirectory
The directory where the sources will be downloaded and built.
.PARAMETER Msys2Directory
The directory where you installed msys2.
.PARAMETER ArchivesDownloadDirectory
@@ -35,18 +39,18 @@ The directory where you checked out https://github.com/hexchat/gtk-win32.git
The directory where you installed Visual Studio.
.PARAMETER Patch
The path to a patch.exe binary.
.PARAMETER SevenZip
The path to a 7-zip executable. Do not use the one provided by Mozilla Build as it's too old and will not work.
The path to the 7-zip executable.
.PARAMETER CMakePath
The directory where you installed cmake.
.PARAMETER PerlDirectory
The directory where you installed perl.
.PARAMETER OnlyBuild
A subset of the items you want built.
@@ -67,7 +71,7 @@ Default paths. Items are built one at a time. x86 build.
.EXAMPLE
build.ps1 -MozillaBuildDirectory D:\mozilla-build -ArchivesDownloadDirectory C:\hexchat-deps -SevenZip C:\Downloads\7-Zip\7za.exe
build.ps1 -Msys2Directory D:\msys32 -ArchivesDownloadDirectory C:\hexchat-deps -SevenZip C:\Downloads\7-Zip\7za.exe
Custom paths. x86 build.
@@ -95,26 +99,29 @@ param (
$DisableParallelBuild = $false,
[string]
$MozillaBuildDirectory = 'C:\mozilla-build',
$BuildDirectory = 'C:\gtk-build',
[string]
$ArchivesDownloadDirectory = 'C:\mozilla-build\hexchat\src',
$Msys2Directory = 'C:\msys32',
[string]
$PatchesRootDirectory = 'C:\mozilla-build\hexchat\github\gtk-win32',
$ArchivesDownloadDirectory = "$BuildDirectory\src",
[string]
$VSInstallPath = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0',
$PatchesRootDirectory = "$BuildDirectory\github\gtk-win32",
[string]
$Patch = "$MozillaBuildDirectory\msys\bin\patch.exe",
$VSInstallPath = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0',
[string]
$SevenZip = 'C:\Program Files\7-Zip\7z.exe',
[string]
$CMakePath = 'C:\Program Files (x86)\CMake\bin',
[string]
$PerlDirectory = "$BuildDirectory\perl-5.20",
[string[]][ValidateSet('atk', 'cairo', 'enchant', 'fontconfig', 'freetype', 'gdk-pixbuf', 'gettext-runtime', 'glib', 'gtk', 'harfbuzz', 'libffi', 'libpng', 'libxml2', 'openssl', 'pango', 'pixman', 'win-iconv', 'zlib')]
$OnlyBuild = @()
)
@@ -176,7 +183,7 @@ $items['cairo'].BuildScript = {
$packageDestination = "$PWD-rel"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i cairo-array-vs-struct-initializer.patch
Exec $patch -p1 -i cairo-array-vs-struct-initializer.patch
$originalEnvironment = Swap-Environment $vcvarsEnvironment
@@ -253,7 +260,7 @@ $items['fontconfig'].BuildScript = {
$packageDestination = "$PWD-$filenameArch"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i fontconfig.patch
Exec $patch -p1 -i fontconfig.patch
$originalEnvironment = Swap-Environment $vcvarsEnvironment
@@ -359,13 +366,13 @@ $items['gettext-runtime'].BuildScript = {
$packageDestination = "$PWD-$filenameArch"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i gettext-runtime.patch
Exec $patch -p1 -i gettext-runtime.patch
Remove-Item -Recurse CMakeCache.txt, CMakeFiles -ErrorAction Ignore
$originalEnvironment = Swap-Environment $vcvarsEnvironment
$env:PATH = "${env:PATH};$CMakePath"
$env:PATH += ";$CMakePath"
Exec cmake -G 'NMake Makefiles' "-DCMAKE_INSTALL_PREFIX=`"$packageDestination`"" -DCMAKE_BUILD_TYPE=Release "-DICONV_INCLUDE_DIR=`"$packageDestination\..\..\..\gtk\$platform\include`"" "-DICONV_LIBRARIES=`"$packageDestination\..\..\..\gtk\$platform\lib\iconv.lib`""
Exec nmake clean
Exec nmake
@@ -384,8 +391,8 @@ $items['glib'].BuildScript = {
$packageDestination = "$PWD-rel"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i glib-if_nametoindex.patch
Exec $Patch -p1 -i glib-package-installation-directory.patch
Exec $patch -p1 -i glib-if_nametoindex.patch
Exec $patch -p1 -i glib-package-installation-directory.patch
Add-Utf8Bom .\gio\gdbusaddress.c
Add-Utf8Bom .\gio\gfile.c
@@ -408,10 +415,10 @@ $items['gtk'].BuildScript = {
$packageDestination = "$PWD-rel"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i gtk-revert-scrolldc-commit.patch
Exec $Patch -p1 -i gtk-bgimg.patch
Exec $Patch -p1 -i gtk-accel.patch
Exec $Patch -p1 -i gtk-multimonitor.patch
Exec $patch -p1 -i gtk-revert-scrolldc-commit.patch
Exec $patch -p1 -i gtk-bgimg.patch
Exec $patch -p1 -i gtk-accel.patch
Exec $patch -p1 -i gtk-multimonitor.patch
Add-Utf8Bom .\gdk\gdkkeyuni.c
@@ -421,17 +428,16 @@ $items['gtk'].BuildScript = {
[void] (Swap-Environment $originalEnvironment)
$env:PATH += ";$BuildDirectory\msgfmt"
New-Item -Type Directory $packageDestination\share\locale
$oldPath = $env:Path
$env:Path = "${env:Path};..\..\..\..\..\msgfmt"
Push-Location .\po
Get-ChildItem *.po | %{
New-Item -Type Directory "$packageDestination\share\locale\$($_.BaseName)\LC_MESSAGES"
Exec msgfmt -co "$packageDestination\share\locale\$($_.BaseName)\LC_MESSAGES\gtk20.mo" $_.Name
}
Pop-Location
$env:Path = $oldPath
New-Item -Type Directory $packageDestination\share\doc\gtk
Copy-Item .\COPYING $packageDestination\share\doc\gtk
@@ -601,7 +607,7 @@ $items['openssl'].BuildScript = {
$originalEnvironment = Swap-Environment $vcvarsEnvironment
$env:PATH += ";$MozillaBuildDirectory\perl-5.20\$platform\bin;$MozillaBuildDirectory\nasm"
$env:PATH += ";$PerlDirectory\$platform\bin;$Msys2Directory\usr\bin"
switch ($filenameArch) {
'x86' {
@@ -669,7 +675,7 @@ $items['pango'].BuildScript = {
$packageDestination = "$PWD-rel"
Remove-Item -Recurse $packageDestination -ErrorAction Ignore
Exec $Patch -p1 -i pango-synthesize-fonts-properly.patch
Exec $patch -p1 -i pango-synthesize-fonts-properly.patch
Add-Utf8Bom .\pango\break.c
Add-Utf8Bom .\pango\pango-language-sample-table.h
@@ -735,7 +741,8 @@ $items['win-iconv'].BuildScript = {
$originalEnvironment = Swap-Environment $vcvarsEnvironment
$env:PATH = "${env:PATH};$CMakePath"
$env:PATH += ";$CMakePath"
Exec cmake -G 'NMake Makefiles' "-DCMAKE_INSTALL_PREFIX=`"$packageDestination`"" -DCMAKE_BUILD_TYPE=Release
Exec nmake clean
Exec nmake
@@ -795,6 +802,17 @@ $items['zlib'].BuildScript = {
#========================================================================================================================================================
$patch = "$Msys2Directory\usr\bin\patch.exe"
if (-not $(Test-Path $patch)) {
throw "$patch not found. Please check that you installed patch in msys2 using ``pacman -S patch``"
}
$tar = "$Msys2Directory\usr\bin\tar.exe"
if (-not $(Test-Path $tar)) {
throw "$tar not found. Please check that you installed tar and other unzipping tools in msys2 using ``pacman -S gzip tar xz``"
}
# Verify VS exists at the indicated location, and that it supports the required target
switch ($Configuration) {
'x86' {
@@ -825,17 +843,15 @@ switch ($Configuration) {
'x86' {
$platform = 'Win32'
$filenameArch = 'x86'
$mozillaBuildStartVC = "$MozillaBuildDirectory\start-shell-msvc2013.bat"
}
'x64' {
$platform = 'x64'
$filenameArch = 'x64'
$mozillaBuildStartVC = "$MozillaBuildDirectory\start-shell-msvc2013-x64.bat"
}
}
$workingDirectory = "$MozillaBuildDirectory\hexchat\build\$platform"
$workingDirectory = "$BuildDirectory\build\$platform"
# Set up additional properties on the items
@@ -904,7 +920,7 @@ Remove-Item $logDirectory\*.log
New-Item -Type Directory $workingDirectory\..\..\gtk\$platform -ErrorAction Ignore
# For each item, start a job to download the source archives, extract them to mozilla-build, and copy over the stuff from gtk-win32
# For each item, start a job to download the source archives, extract them to $workingDirectory, and copy over the stuff from gtk-win32
Write-Host "Downloading and extracting source archives to $workingDirectory"
$items.GetEnumerator() | %{
@@ -919,12 +935,18 @@ $items.GetEnumerator() | %{
&$name @arguments
[void] ($LASTEXITCODE -and $(throw "$name $arguments exited with code $LASTEXITCODE"))
}
function ConvertTo-Msys2Path ([string] $Path) {
([regex] '^([a-zA-Z]):').Replace(($Path -replace '\\', '/'), { "/$($args[0].Groups[1].Value.ToLower())" })
}
} -ArgumentList $item {
param ($item)
$ArchivesDownloadDirectory = $using:ArchivesDownloadDirectory
$workingDirectory = $using:workingDirectory
$Msys2Directory = $using:Msys2Directory
$SevenZip = $using:SevenZip
$tar = $using:tar
$workingDirectory = $using:workingDirectory
'Beginning job to download and extract'
@@ -947,8 +969,8 @@ $items.GetEnumerator() | %{
"Extracting $($item.ArchiveFile.Name) to $workingDirectory"
if ($item.ArchiveFile.Name -match '.tar.(?:gz|xz|bz2)$') {
$command = "`"$SevenZip`" x `"$($item.ArchiveFile)`" -y -so | `"$SevenZip`" x -o`"$workingDirectory`" -y -si -ttar";
Exec cmd /C "`"$command`"" > $null
$env:PATH += ";$Msys2Directory\usr\bin"
Exec $tar xf $(ConvertTo-Msys2Path $item.ArchiveFile) -C $(ConvertTo-Msys2Path $workingDirectory)
$outputDirectoryName = [System.IO.Path]::GetFilenameWithoutExtension($item.ArchiveFile.BaseName)
Move-Item "$workingDirectory\$outputDirectoryName" $item.BuildDirectory
@@ -1072,16 +1094,17 @@ while (@($items.GetEnumerator() | ?{ ($_.Value.State -eq 'Pending') -or ($_.Valu
} -ArgumentList $nextPendingItem {
param ($item)
$MozillaBuildDirectory = $using:MozillaBuildDirectory
$mozillaBuildStartVC = $using:mozillaBuildStartVC
$BuildDirectory = $using:BuildDirectory
$CMakePath = $using:CMakePath
$Configuration = $using:Configuration
$vcvarsEnvironment = $using:vcvarsEnvironment
$filenameArch = $using:filenameArch
$Patch = $using:Patch
$Msys2Directory = $using:Msys2Directory
$patch = $using:patch
$PerlDirectory = $using:PerlDirectory
$platform = $using:platform
$vcvarsEnvironment = $using:vcvarsEnvironment
$VSInstallPath = $using:VSInstallPath
$workingDirectory = $using:workingDirectory
$CMakePath = $using:CMakePath
Set-Location $item.BuildDirectory
View
@@ -1,6 +1,5 @@
* Download [cairo 1.14.0](http://cairographics.org/releases/cairo-1.14.0.tar.xz)
* Download [VS solution](https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack?action=AttachFile&do=get&target=cairo-vsprojects.zip)
* Extract to `C:\mozilla-build\hexchat`
* In `msvc\vc12\cairo.props`, replace:
* `<CairoEtcInstallRoot>..\..\..\vs10\$(Platform)</CairoEtcInstallRoot>` with
`<CairoEtcInstallRoot>..\..\..\..\..\gtk\$(Platform)</CairoEtcInstallRoot>`
@@ -24,6 +23,3 @@
* Open `msvc\vc12\cairo.sln` with VS and select `Release_FC` configuration
* Make `cairo-gobject` and `install` buildable
* Make `install` depend on `cairo-gobject`
* Build in VS
* Release with `release-x86.bat`
* Extract package to `C:\mozilla-build\hexchat\build\Win32`
View
@@ -1,5 +1 @@
* Download [Enchant 1.6.0](http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz)
* Extract to `C:\mozilla-build\hexchat`
* Open VS x86 command prompt
* Build with `build-x86.bat`
* Extract package to `C:\mozilla-build\hexchat\build\Win32`
Oops, something went wrong.

0 comments on commit f4bb600

Please sign in to comment.