Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion automatic/poppler/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# [Poppler](https://chocolatey.org/packages/poppler)

Poppler is a PDF rendering library based on the [xpdf-3.0](http://www.foolabs.com/xpdf) code base.
Poppler is a PDF rendering library based on the [xpdf-3.0](http://www.foolabs.com/xpdf) code base. This version install the packaged zip from [oschwartz10612/poppler-windows](https://github.com/oschwartz10612/poppler-windows) which is built by [conda-forge/poppler-feedstock](https://github.com/conda-forge/poppler-feedstock).
5 changes: 3 additions & 2 deletions automatic/poppler/poppler.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>poppler</id>
<version>26.05.0</version>
<version>26.02.0.0</version>
<packageSourceUrl>https://github.com/chtof/chocolatey-packages/tree/master/automatic/poppler</packageSourceUrl>
<owners>chtof</owners>
<title>Poppler</title>
<authors>Derek Noonburg, Albert Astals Cid.</authors>
<projectUrl>https://poppler.freedesktop.org</projectUrl>
<repository type="git" url="https://github.com/oschwartz10612/poppler-windows.git" commit="a6703d8fdf1b1f66b6103fdeae3df903367b8df6" />
<!--<iconUrl>https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/poppler/poppler.png</iconUrl>-->
<!-- <copyright>Year Software Vendor</copyright> -->
<licenseUrl>https://cgit.freedesktop.org/poppler/poppler/plain/COPYING</licenseUrl>
Expand All @@ -27,4 +28,4 @@
<file src="legal\**" target="legal" />
<file src="tools\**" target="tools" />
</files>
</package>
</package>
24 changes: 10 additions & 14 deletions automatic/poppler/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$packageArgs = @{
packageName = $env:ChocolateyPackageName
destination = "$toolsDir"
file64 = "$toolsDir\poppler-26.05.0.tar.xz"
}
Get-ChocolateyUnzip @packageArgs
$url = 'https://github.com/oschwartz10612/poppler-windows/releases/download/v26.02.0-0/Release-26.02.0-0.zip'
$checksum = '993e4a94376ed712fafc7058d724ea0b943d118bbd2305cd9ed55174eb85cda5'
$checksumType = 'sha256'

$packageArgs_tar = @{
packageName = $env:ChocolateyPackageName
destination = "$toolsDir"
file64 = "$toolsDir\poppler-26.05.0.tar.xz" -Replace (".xz$","") # tar file
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
Url64bit = $url
Checksum64 = $checksum
ChecksumType64 = $checksumType
}
Get-ChocolateyUnzip @packageArgs_tar

Remove-Item $packageArgs.file64
Remove-Item $packageArgs_tar.file64
Install-ChocolateyZipPackage @packageArgs
48 changes: 27 additions & 21 deletions automatic/poppler/update.ps1
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
import-module au
import-module chocolatey-AU

function global:au_BeforeUpdate { Get-RemoteFiles -NoSuffix -Purge }
$releases = 'https://github.com/oschwartz10612/poppler-windows/releases/latest'
$Owner = $releases.Split('/') | Select-Object -Last 1 -Skip 3
$repo = $releases.Split('/') | Select-Object -Last 1 -Skip 2

function global:au_GetLatest {
#$releases = 'https://anaconda.org/conda-forge/poppler/files?sort=basename&sort_order=desc'
$releases = 'https://poppler.freedesktop.org'
$regex = 'poppler-(?<Version>[\d\.]+)(-.*)?.tar.(bz2|xz)$'


$url = (Invoke-WebRequest -Uri $releases -UseBasicParsing).links | ? href -match $regex | Select -First 1

return @{
Version = $matches.Version
URL64 = 'https://poppler.freedesktop.org/' + $url.href
}
}

function global:au_SearchReplace {
@{
@{
"legal\VERIFICATION.txt" = @{
"(?i)(x64: ).*" = "`${1}$($Latest.URL64)"
"(?i)(checksum type:\s+).*" = "`${1}$($Latest.ChecksumType64)"
"(?i)(checksum64:).*" = "`${1} $($Latest.Checksum64)"
}

'tools/chocolateyInstall.ps1' = @{
"(^[$]url\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(^[$]checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
"(^[$]checksumType\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'"
}
}
}

"tools\chocolateyinstall.ps1" = @{
"(?i)(^\s*file64\s*=\s*`"[$]toolsDir\\)(.*?)`"(.*?)$" = "`$1$($Latest.FileName64)`"`$3"
}
}
function global:au_GetLatest {
$tags = Get-GitHubRelease -OwnerName $Owner -RepositoryName $repo -Latest
$urls = $tags.assets.browser_download_url | Where-Object {$_ -match ".zip$"}
$url64 = $urls | Where-Object {$_ -match 'Release-'}
Update-Metadata -key "releaseNotes" -value $tags.html_url
$version = $tags.tag_name.Replace('v','').Replace('-','.')
if($tags.prerelease -match "true") {
$date = $tags.published_at.ToString("yyyyMMdd")
$version = "$version-pre$($date)"
}

$Latest = @{ URL64 = $url64; Version = $version }
return $Latest
}

update -ChecksumFor none
update -NoCheckChocoVersion