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

Add uthash #203

Merged
merged 2 commits into from
Jan 24, 2024
Merged
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
26 changes: 26 additions & 0 deletions deps.macos/80-uthash.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
autoload -Uz log_debug log_error log_info log_status log_output

## Dependency Information
local name='uthash'
local version='2.3.0'
local url='https://github.com/troydhanson/uthash.git'
local hash='e493aa90a2833b4655927598f169c31cfcdf7861'

## Build Steps
setup() {
log_info "Setup (%F{3}${target}%f)"
setup_dep ${url} ${hash}
}

install() {
autoload -Uz progress

log_info "Install (%F{3}${target}%f)"
cd ${dir}

mkdir -p ${target_config[output_dir]}/include

log_debug "Copying headers to ${target_config[output_dir]}/include"
cp src/(utarray.h|uthash.h|utlist.h|utringbuffer.h|utstack.h|utstring.h) ${target_config[output_dir]}/include
log_status "Copied headers to ${target_config[output_dir]}/include"
}
31 changes: 31 additions & 0 deletions deps.windows/60-uthash.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
param(
[string] $Name = 'uthash',
[string] $Version = '2.3.0',
[string] $Uri = 'https://github.com/troydhanson/uthash.git',
[string] $Hash = "e493aa90a2833b4655927598f169c31cfcdf7861"
)

function Setup {
Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath $Path
}

function Install {
Log-Information "Install (${Target})"
Set-Location "$Path"

New-Item -Path "$($ConfigData.OutputPath)/include" -ItemType Directory -Force *> $null

$Items = @(
@{
Path = @("src/utarray.h", "src/uthash.h", "src/utlist.h", "src/utringbuffer.h", "src/utstack.h", "src/utstring.h")
Destination = "$($ConfigData.OutputPath)/include"
ErrorAction = 'SilentlyContinue'
}
)

$Items | ForEach-Object {
$Item = $_
Log-Output ('{0} => {1}' -f ($Item.Path -join ", "), $Item.Destination)
Copy-Item @Item
}
}
21 changes: 21 additions & 0 deletions licenses/uthash/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2005-2022, Troy D. Hanson https://troydhanson.github.io/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.