Skip to content

Commit

Permalink
(qtcreator) Migrated package and took over maintainance
Browse files Browse the repository at this point in the history
fixes #8
  • Loading branch information
AdmiringWorm committed Dec 3, 2017
1 parent 06e94cf commit b15ff0c
Show file tree
Hide file tree
Showing 9 changed files with 844 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ setup/
*.msi
*.vsix
*.zip
*.7z
1 change: 1 addition & 0 deletions automatic/qtcreator/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Package changelog for [Qt Creator](https://chocolatey.org/packages/qtcreator)
3 changes: 3 additions & 0 deletions automatic/qtcreator/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# [<img src="https://cdn.rawgit.com/AdmiringWorm/chocolatey-packages/afa9a21618e59edddef7d4515d40e20dad0390e0/icons/qtcreator.png" height="48" width="48" /> qtcreator](https://chocolatey.org/packages/qtcreator)

Qt Creator provides a cross-platform, complete integrated development environment (IDE) for application developers to create applications for multiple desktop and mobile device platforms, such as Android and iOS.
704 changes: 704 additions & 0 deletions automatic/qtcreator/legal/LICENSE.txt

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions automatic/qtcreator/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

The embedded software have been downloaded from the listed download
location on <>
and can be verified by doing the following:

1. Download the following:
32-Bit software: <>
64-Bit software: <>
2. Get the checksum using one of the following methods:
- Using powershell function 'Get-FileHash'
- Use chocolatey utility 'checksum.exe'
3. The checksums should match the following:

checksum type:
checksum32:
checksum64:

The file 'LICENSE.txt' has been obtained from <https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/LICENSE.GPL3-EXCEPT>
41 changes: 26 additions & 15 deletions automatic/qtcreator/qtcreator.nuspec
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>qtcreator</id>
<version>4.1.0</version>
<packageSourceUrl>https://github.com/AdmiringWorm/chocolatey-packages/tree/master/automatic/qtcreator</packageSourceUrl>
<owners>AdmiringWorm</owners>
<title>Qt Creator</title>
<authors>Qt Project</authors>
<owners>Qt Project</owners>
<licenseUrl>http://code.qt.io/cgit/qt-creator/qt-creator.git/plain/LICENSE.GPL3-EXCEPT?h=4.1</licenseUrl>
<projectUrl>http://wiki.qt.io/Qt_Creator</projectUrl>
<iconUrl>http://code.qt.io/cgit/qt-creator/qt-creator.git/plain/src/app/qtcreator.xcassets/qtcreator.appiconset/icon_256x256.png?h=4.1</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Qt Creator provides a cross-platform, complete integrated development
environment (IDE) for application developers to create applications for
multiple desktop and mobile device platforms, such as Android and iOS.</description>
<summary>Cross-platform IDE for easy creation of connected devices, UIs and applications.</summary>
<releaseNotes>http://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-4.1.0.md</releaseNotes>
<iconUrl>https://cdn.rawgit.com/AdmiringWorm/chocolatey-packages/afa9a21618e59edddef7d4515d40e20dad0390e0/icons/qtcreator.png</iconUrl>
<copyright>© 2016 The Qt Company Ltd.</copyright>
<tags>c++ qt ide qtcreator admin</tags>
<licenseUrl>http://code.qt.io/cgit/qt-creator/qt-creator.git/plain/LICENSE.GPL3-EXCEPT?h=4.1</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>http://code.qt.io/cgit/qt-creator/qt-creator.git/</projectSourceUrl>
<packageSourceUrl>https://github.com/aportale/chocolatey-packages</packageSourceUrl>
<docsUrl>https://doc.qt.io/qtcreator/</docsUrl>
<mailingListUrl>http://lists.qt-project.org/mailman/listinfo/qt-creator/</mailingListUrl>
<bugTrackerUrl>https://bugreports.qt.io/browse/QTCREATORBUG</bugTrackerUrl>
<tags>c++ qt ide qtcreator admin</tags>
<summary>Cross-platform IDE for easy creation of connected devices, UIs and applications.</summary>
<!-- Do not touch the description here in the nuspec file. Description is imported during update from the Readme.md file -->
<description><![CDATA[Qt Creator provides a cross-platform, complete integrated development environment (IDE) for application developers to create applications for multiple desktop and mobile device platforms, such as Android and iOS.
]]></description>
<releaseNotes>
[Software Changelog](http://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-4.1.0.md)
[Package Changelog](https://github.com/AdmiringWorm/chocolatey-packages/blob/master/automatic/qtcreator/Changelog.md)
</releaseNotes>
<dependencies>
<dependency id="vcredist2013" version="12.0.30501" />
<dependency id="vcredist2015" />
<dependency id="chocolatey-core.extension" version="1.3.3" />
<!--We could set chocolatey to version 0.10.4, but that version was broken so we use 0.10.5-->
<dependency id="chocolatey" version="0.10.5" />
</dependencies>
</metadata>
</package>
<files>
<file src="legal\**" target="legal" />
<file src="tools\**" target="tools" />
</files>
</package>
38 changes: 23 additions & 15 deletions automatic/qtcreator/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
. "$PSScriptRoot\common.ps1"
$ErrorActionPreference = 'Stop'

$ErrorActionPreference = 'Stop';
$toolsPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$installToolsPath = Get-ToolsLocation

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = "https://download.qt.io/official_releases/qtcreator/{0}/{1}/installer_source/windows_vs2013_32/qtcreator.7z" -f $packageVersionMinor, $packageVersionPatch
$checksum = 'e0d6f76bc5babd77894e6d0defc42f5b'
$checksumType = 'md5'
$unzipLocation = Join-Path "$(Get-ToolsLocation)" $packageName
$qtcreatorExe = Join-Path $toolsDir "bin\qtcreator.exe"
$packageArgs = @{
packageName = $env:ChocolateyPackageName
file = "$toolsPath\qtcreator_x32.7z"
file64 = "$toolsPath\qtcreator_x64.7z"
destination = "$installToolsPath\$env:ChocolateyPackageName"
}

Install-ChocolateyZipPackage $packageName $url $toolsDir -checksum $checksum -checksumType $checksumType
Get-ChocolateyUnzip @packageArgs

# generate ignore files, to avoid excessive shims
$files = get-childitem $toolsDir -include *.exe -exclude qtcreator.exe -recurse
foreach ($file in $files) {
New-Item "$file.ignore" -type file -force | Out-Null
Get-ChildItem $packageArgs.destination -Include "*.exe" -Recurse | % {
if ($_.Name -eq "qtcreator.exe") {
Set-Content -Value "" -LiteralPath "$($_.FullName).gui"
$qtCreator = $_.FullName
}
else {
Set-Content -Value "" -LiteralPath "$($_.FullName).ignore"
}
}

Install-ChocolateyShortcut -shortcutFilePath $shortcutFile -targetPath $qtcreatorExe
Install-ChocolateyFileAssociation ".pro" $qtcreatorExe
# Because chocolatey targets 4.0, we are able to use 'Programs' in the 'GetFolderPath'
$programs = [System.Environment]::GetFolderPath("Programs")

Install-ChocolateyShortcut -shortcutFile "$programs\QT Creator.lnk" -targetPath $qtCreator
Install-ChocolateyFileAssociation ".pro" $qtCreator
15 changes: 11 additions & 4 deletions automatic/qtcreator/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
. "$PSScriptRoot\common.ps1"
$ErrorActionPreference = 'Stop'

If (Test-Path $shortcutFile){
Remove-Item $shortcutFile
}
# Remove the start menu shortcut
$startMenu = [System.Environment]::GetFolderPath('Programs')
if (Test-Path "$startMenu\QT Creator.lnk") {
Remove-Item -Force "$startMenu\QT Creator.lnk"
}

$hkey = "HKCR:\.pro"
if (Test-Path $hkey) {
Remove-Item -Force $hkey
}
54 changes: 54 additions & 0 deletions automatic/qtcreator/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Import-Module AU

$releases = 'https://www1.qt.io/download-open-source/'
$softwareName = 'qtcreator*'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -FileNameBase "qtcreator"
}

function global:au_SearchReplace {
@{
".\legal\VERIFICATION.txt" = @{
"(?i)(^\s*location on\:?\s*)\<.*\>" = "`${1}<$($Latest.ReleasesLocation)>"
"(?i)(\s*32\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL32)>"
"(?i)(\s*64\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL64)>"
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)"
"(?i)(^\s*checksum(32)?\:).*" = "`${1} $($Latest.Checksum32)"
"(?i)(^\s*checksum64\:).*" = "`${1} $($Latest.Checksum64)"
}
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*file\s*=\s*`"[$]toolsPath\\).*" = "`${1}$($Latest.FileName32)`""
"(?i)(^\s*file64\s*=\s*`"[$]toolsPath\\).*" = "`${1}$($Latest.FileName64)`""
}
}
}

function global:au_AfterUpdate {
Update-Changelog -useIssueTitle
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing

$re = 'qt-creator.*x86\-.*\.exe$'
$versionURL = $download_page.Links | ? href -match $re | select -first 1 -expand href

$version = $versionURL -split '\/' | select -last 1 -skip 1
$versionTwoPart = $version -replace "^(\d+\.\d+).*", '$1'

$url = "https://download.qt.io/official_releases/qtcreator/$versionTwoPart/$version/installer_source/"
$download_page = Invoke-WebRequest -Uri $url -UseBasicParsing
$links = $download_page.links | ? href -match '^windows' | select -expand href
$url32 = ($links -match '_32\/$' | select -first 1 | % { $url + $_ }) + "qtcreator.7z"
$url64 = ($links -match '_64\/$' | select -first 1 | % { $url + $_ }) + "qtcreator.7z"

return @{
URL32 = $url32
URL64 = $url64
Version = $version
ReleasesLocation = $url
}
}

update -ChecksumFor none

0 comments on commit b15ff0c

Please sign in to comment.